OK [2] (+ 3 4) 7 [3] (read x) [VM ERROR encountered!] Variable not defined in current environment X [Inspect] Quit [4] (read) 4 4 [5] (-1+ 5) 4 [6] (eq? 6 (+ 3 3)) #T [7] (eq? (car '(a b)) (car '((a b))) ) () [8] (eq? (car '(a b)) (car '(a b))) #T [9] (eq? '(a b) '(a b)) () [10] (equal? '(a b) '(a b)) #T [11] (= '(a b) '(a b)) [VM ERROR encountered!] Non-numeric operand to arithmetic operation (=? (A B) (A B)) [Inspect] Quit [12] (cadr '(1 2 3)) 2 [13] (cddr '(1 2 3)) (3) [14] (caddr '(1 2 3)) 3 [15] (read-char) #\1 [16] (write-char 'a) A [17] (explode 'abcd) (A B C D) [18] (implode (explode 'abcd)) ABCD [19] (explode "abcd") (|a| |b| |c| |d|) [20] (explode "ab cd") (|a| |b| | | |c| |d|) [21] |a| [VM ERROR encountered!] Variable not defined in current environment |a| [Inspect] Quit [22] '|a| |a| [23] (implode '(|a| a A #\space #\return 5)) |aAA | [24] (implode '(a #\space #\newline #\5)) |A 5| [25] (implode '(a #\space b)) |A B| [26] (transcript-off) OK [2] (edwin) Edwin3.03 [Scheme] **define (fact n(((( (cond ((zero? n(( (((else (* n (fact (+ n(((((((((((((print "this edwinEDWIN session hsa as defined the factorial function"((Ctrl-X Write buffer to file : k:\smith\cs256\fact.pcs 152\fact.pcsWriti ng file k:\smith\cs152\fact.pcsWriting file k:\smith\cs152\fact.pcs -- done K:\SMITH\CS152\FACT.PCSMeta- "this EDWIN session has defined the factorial function" OK [3] (fact 4) 24 [4] (trace fact) OK [5] (fact 4) >>> Entering # Argument 1: 4 24 [6] (trace-both fact) OK [7] (fact 4) >>> Entering # Argument 1: 4 <<< Leaving # with value 24 Argument 1: 4 24 [8] (trace-entry fact) OK [9] (fact 4) >>> Entering # Argument 1: 4 <<< Leaving # with value 24 Argument 1: 4 24 [10] (fact 9) >>> Entering # Argument 1: 9 <<< Leaving # with value 362880 Argument 1: 9 362880 [11] (exit) OK [3] (set! pcs-debug-mode 1) 1 [4] (load "k:\\smith\\cs152\\fact") [VM ERROR encountered!] DOS I/O error - File not found "k:\\smith\\cs152\\fact" [Inspect] Quit [5] (load "k:\\smith\\cs152\\fact.pcs") "this EDWIN session has defined the factorial function" OK [6] (fact 4) 24 [7] (trace fact) OK [8] (fact 4) >>> Entering # Argument 1: 4 >>> Entering # Argument 1: 3 >>> Entering # Argument 1: 2 >>> Entering # Argument 1: 1 >>> Entering # Argument 1: 0 24 [9] (trace-both fact) OK [10] (fact 4) >>> Entering # Argument 1: 4 >>> Entering # Argument 1: 3 >>> Entering # Argument 1: 2 >>> Entering # Argument 1: 1 >>> Entering # Argument 1: 0 <<< Leaving # with value 1 Argument 1: 0 <<< Leaving # with value 1 Argument 1: 1 <<< Leaving # with value 2 Argument 1: 2 <<< Leaving # with value 6 Argument 1: 3 <<< Leaving # with value 24 Argument 1: 4 24 [11] (untrace fact) OK [12] (fact) [VM ERROR encountered!] Invalid argument count: Function expected 1 argument(s) but was called with 0 as follows: (#) [Inspect] Value of: fact # = (LAMBDA (N) (COND ((ZERO? N) 1) (ELSE (* N (FACT (-1+ N)))))) [Inspect] Quit [13] (print "this is the only way I know to have Scheme print the text of a function") "this is the only way I know to have Scheme print the text of a function" [14] (define my-port (open-input-file "k:\\smith\\cs152\\fact.pcs") ) MY-PORT [15] (read my-port) (DEFINE (FACT N) (COND ((ZERO? N) 1) (ELSE (* N (FACT (-1+ N)))))) [16] (read-char my-port) #\RETURN [17] (read-char my-port) #\NEWLINE [18] (read-char my-port) #\RETURN [19] (read-char my-port) #\NEWLINE [20] (read-char my-port) #\( [21] (read-char my-port) #\p [22] (read-char my-port) #\r [23] (read-char my-port) #\i [24] (read-char my-port) #\n [25] (read-char my-port) #\t [26] (read my-port) "this EDWIN session has defined the factorial function" [27] (read my-port) [ERROR encountered!] Unexpected `)' encountered before `(' () [Inspect] Quit [28] (read-char my-port) #\RETURN [29] (read-char my-port) #\NEWLINE [30] (read-char my-port) #!EOF [31] (read-char my-port) #!EOF [32] (read-char my-port) #!EOF [33] (transcript-off)