-
Notifications
You must be signed in to change notification settings - Fork 0
/
243.rkt
36 lines (30 loc) · 919 Bytes
/
243.rkt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
;; The first three lines of this file were inserted by DrRacket. They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-intermediate-reader.ss" "lang")((modname 243ex) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
;; Exercise 243
;; ------------
;; Assume the definitions area in DrRacket contains
;;
;; (define (f x)
;; x)
;;
;; Identify the values among the following expressions:
;;
;; (cons f '())
;;
;; (f f)
;;
;; (cons f (cons 10 (cons (f 10) '())))
;;
;; Explain why they're not values.
;;
;--------------------------------------------------------
(define (f x)
x)
(cons f '())
; => (list function:f)
(f f)
; => function:f
(cons f (cons 10 (cons (f 10) '())))
; => (list function:f 10 10)
; They are all values because in ISL, functions are values.