SCM (v0201) ( ) 14 4 20 1 SCM 2 SCM 3 SCM 4 5 2 SCM 2.1 SCM SCM 2 1 2 SCM (1) MS-DOS (2) Microsoft(R) Windows 95 (C)Copyright Microsoft Corp 1981-1996. 1
(3) C:\WINDOWS>cd.. C:\>cd scm C:\SCM> C:\SCM> scm C:\SCM>scm SCM version 4e1, Copyright (C) 1990, 1991, 1992, 1993, 1994 Aubrey Jaffer. SCM comes with ABSOLUTELY NO WARRANTY for details type `(terms)'. This is free software, and you are welcome to redistribute it under certain conditions type `(terms)' for details. SCM Turtlegraphics Copyright (C) 1992 sjm@cc.tut.fi, jtl@cc.tut.fi Type `(help-gr)' or `(help-turtlegr)' for a quick reference of the new primitives. loading "berkeley.scm" > (4) > SCM (1) Windows 95 2
(2) SCM ( : Windows 95(C:)) (3) SCM ( : Scm) ( : SCM.exe) (4) SCM (5) > SCM 2.2 SCM SCM > (exit) 3 SCM SCM SCM SCM prompt, >SCM Scheme 1 Scheme LISP 1 Scheme > ALT Enter 3.1 SCM 3.2 3.3 3.4 3.5 (load) 3
3.1 SCM > > 1 1 > (+12) (compound expression) > (+ 1 2) 3 > (+ 1 2) 1 (operator ) (operands) (prex notation) 1 > (+ 1 2 3) 6 > (* 2 3 4) 24 > > t true #t > nil false () 4
> "Statistics is an important subject." "Statistics is an important subject." (Symbol) x > x ERROR: unbound variable: x in expression: x in top level environment. x x > (define x 1) x x > x 1 x (compound expression) () 5
(+ 1 2 3) (function application) SCM + 1 2 3 > (+ 1 2 3) 6 > (+ (* 2 3) 4) 10 (* 2 3) + SCM (simple data) SCM (compound data) list > (list 1 2 3 4 5) (1 2 3 4 5) SCM list SCM Scheme 1 Scheme LISP 1 LISP LISt Processing LISP 6
y (1 2 3 4 5) > (define y (list 1 2 3 4 5)) y y > y (1 2 3 4 5) y (12345) (+ 1 2) > (+ 1 2) 3 (quoting) Say your hobby! Say "your hobby"! () SCM (quote) 7
> (quote (+ 1 2)) (+ 1 2) quote quote quote (special form) SCM quote > '(+ 1 2) (+ 1 2) (quote (+ 1 2)) 3.2 transcripton a: SCM-tk tran1999 tk ( tran transcript 1999 1999 mmddhhmm mm: dd: hh: mm: MS-DOS 8 3 transcript-on ( SCM-tk tran1999 1999 9 29 17 50 transcript-on 8
(transcript-on "a:/scm-tk/tran1999/09291750") transcript > (transcript-off) transcript "a:/scm-tk/tran1999/09291750" > (transcript-off) transcript transcript-on 3.3 60 1 30 SCM sr0130tk sr: s: r: red( ) 0130: : 1 30 tk: t: tetsuo, k: kamijo MS-DOS 8 SCM 9
> (define sr0130tk (list 6 2 1 3 5 5 4 5 2 3 2 6 4 5 6 5 5 4 5 6 1 1 6 1 5 4 5 4 5 5)) sr0130tk > sr0130tk (6 2 1 3 5 5 4 5 2 3 2 6 4 5 6 5 5 4 5 6 1 1 6 1 5 4 5 4 5 5) > (apply + sr0130tk) 121 3.4 a: SCM-tk (1) SCM (define sr0130tk (list 6 2 1 3 5 5 4 5 2 3 2 6 4 5 6 5 5 4 5 6 1 1 6 1 5 4 5 4 5 5)) 10
(2) WZ MIFES (3) a: SCM-tk tkamijo.scm 3.5 (load) 3.4 a: SCM-tk tkamijo.scm sr0130tk (1) SCM, sr0130tk > sr0130tk (6 2 1 3 5 5 4 5 2 3 2 6 4 5 6 5 5 4 5 6 1 1 6 1 5 4 5 4 5 5) > (define sr0130tk nil) sr0130tk > sr0130tk () (2) SCM a: SCM-tk tkamijo.scm sr0130tk > (load "a:/scm-tk/tkamijo.scm") okay (3) sr0130tk > sr0130tk 11
(6 2 1 3 5 5 4 5 2 3 2 6 4 5 6 5 5 4 5 6 1 1 6 1 5 4 5 4 5 5) sr0130tk sr0130tk (list name) s0130(saikoro, 01 30 ) > (define s0130 sr0130tk) s0130 s0130 > s0130 (6 2 1 3 5 5 4 5 2 3 2 6 4 5 6 5 5 4 5 6 1 1 6 1 5 4 5 4 5 5) sr0130tk s0130 4 Windows 95 Excel Lotus 1-2-3 a: SCM-tk tkamijo.scm 60 31 60 sr3160tk MS-DOS 8 (1) a: 12
(2) Windows95 Windows95 (3) SCM-tk tkamijo.scm " " SCM (F) (*.*) a: SCM-tk tkamijo.scm (define sr0130tk (list 6 2 1 3 5 5 4 5 2 3 2 6 4 5 6 5 5 4 5 6 1 1 6 1 5 4 5 4 5 5)) file name: tkamijo.scm tkamijo: tetsuo kamijo scm: Scheme : : October 5, 1999 : data list name: sr3160tk sr: s: saikoro r: red( ) 3160: : 31 60 : : October 5, 1999 : (define sr3160tk (list 3 1 1 2 6 4 2 6 4 3 3 5 1 3 1 1 4 4 1 5 3 2 6 2 3 6 1 1 2 1) ) 13
(4) tkamijo.scm (F) 3.5 a: SCM-tk tkamijo.scm tkamijo.scm sr3160tk (load) (1) SCM, (2) SCM tkamijo.scm > (load "a:/scm-tk/tkamijo.scm") okay (3) sr3160tk > sr3160tk (3 1 1 2 6 4 2 6 4 3 3 5 1 3 1 1 4 4 1 5 3 2 6 2 3 6 1 1 2 1) > (apply + sr3160tk) 87 sr3160tk (list name) s3160 (saikoro, 31 60 ) > (define s3160 sr3160tk) s3160 s3160 14
> s3160 (3 1 1 2 6 4 2 6 4 3 3 5 1 3 1 1 4 4 1 5 3 2 6 2 3 6 1 1 2 1) sr3160tk s3160 5 5.1 append > (define x1 (list 1 2 3)) x1 > (define x2 (list 4)) x2 > (define x3 (list 5 6)) x3 > (append x1 x2 x3) (1 2 3 4 5 6) append sr0130tk sr3160tk append append sr0160tk(saikoro, 01 60 15
> (define sr0160tk (append sr0130tk sr3160tk)) sr0160tk sr0130tk > sr0160tk (6 2 1 3 5 5 4 5 2 3 2 6 4 5 6 5 5 4 5 6 1 1 6 1 5 4 5 4 5 5 3 1 1 2 6 4 2 6 4 3 3 5 1 3 1 1 4 4 1 5 3 2 6 2 3 6 1 1 2 1) > (apply + sr0160tk) 208 sr0160tk (list name) s0160 (saikoro, 01 60 ) > (define s0160 sr0160tk) s0160 s0160 > s0160 (6 2 1 3 5 5 4 5 2 3 2 6 4 5 6 5 5 4 5 6 1 1 6 1 5 4 5 4 5 5 3 1 1 2 6 4 2 6 4 3 3 5 1 3 1 1 4 4 1 5 3 2 6 2 3 6 1 1 2 1) sr0160tk s0160 16
5.2 (special form) set! z > (define z 2) z 5 > (set! z 5) [1] Harvey, B. and Wright, M.[1994], Simply Scheme: Introducing Computer Science, The MIT Press [2] [1994], Scheme [3] Pearce, J.[1998], Programming and Meta-Programming in Scheme, Springer. [4] Springer, G. and Friedman, D.P.[1989], Scheme and the Art of Programming, The MIT Press. [5] Steele, Jr., G.L.[1990], Common LISP: The Language, Second Edition, Digital Press [6] Tierney, L.[1990], LISP-STAT: An Object-Oriented Environment for Statistical Computing andf Dynamic Graphics, Wiley : LISP-STAT, [7] [1991], Scheme, [8] [1991], Scheme, 17