Hex Artifact Content
Not logged in

Artifact ad880a160778eecba1efac93430d6c06c0a2ca64:


0000: 3b 3b 20 43 6f 70 79 72 69 67 68 74 20 28 63 29  ;; Copyright (c)
0010: 20 32 30 30 39 20 44 65 72 69 63 6b 20 45 64 64   2009 Derick Edd
0020: 69 6e 67 74 6f 6e 2e 20 20 41 6c 6c 20 72 69 67  ington.  All rig
0030: 68 74 73 20 72 65 73 65 72 76 65 64 2e 20 20 4c  hts reserved.  L
0040: 69 63 65 6e 73 65 64 20 75 6e 64 65 72 20 61 6e  icensed under an
0050: 0a 3b 3b 20 4d 49 54 2d 73 74 79 6c 65 20 6c 69  .;; MIT-style li
0060: 63 65 6e 73 65 2e 20 20 4d 79 20 6c 69 63 65 6e  cense.  My licen
0070: 73 65 20 69 73 20 69 6e 20 74 68 65 20 66 69 6c  se is in the fil
0080: 65 20 6e 61 6d 65 64 20 4c 49 43 45 4e 53 45 20  e named LICENSE 
0090: 66 72 6f 6d 20 74 68 65 20 6f 72 69 67 69 6e 61  from the origina
00a0: 6c 0a 3b 3b 20 63 6f 6c 6c 65 63 74 69 6f 6e 20  l.;; collection 
00b0: 74 68 69 73 20 66 69 6c 65 20 69 73 20 64 69 73  this file is dis
00c0: 74 72 69 62 75 74 65 64 20 77 69 74 68 2e 20 20  tributed with.  
00d0: 49 66 20 74 68 69 73 20 66 69 6c 65 20 69 73 20  If this file is 
00e0: 72 65 64 69 73 74 72 69 62 75 74 65 64 20 77 69  redistributed wi
00f0: 74 68 0a 3b 3b 20 73 6f 6d 65 20 6f 74 68 65 72  th.;; some other
0100: 20 63 6f 6c 6c 65 63 74 69 6f 6e 2c 20 6d 79 20   collection, my 
0110: 6c 69 63 65 6e 73 65 20 6d 75 73 74 20 61 6c 73  license must als
0120: 6f 20 62 65 20 69 6e 63 6c 75 64 65 64 2e 0a 0a  o be included...
0130: 23 21 72 36 72 73 0a 28 69 6d 70 6f 72 74 0a 20  #!r6rs.(import. 
0140: 20 28 72 6e 72 73 20 62 61 73 65 29 20 3b 20 6e   (rnrs base) ; n
0150: 6f 20 52 36 52 53 20 72 65 63 6f 72 64 73 0a 20  o R6RS records. 
0160: 20 28 6f 6e 6c 79 20 28 72 6e 72 73 20 69 6f 20   (only (rnrs io 
0170: 73 69 6d 70 6c 65 29 20 64 69 73 70 6c 61 79 20  simple) display 
0180: 77 72 69 74 65 20 6e 65 77 6c 69 6e 65 29 0a 20  write newline). 
0190: 20 28 73 75 72 66 61 67 65 20 73 39 20 72 65 63   (surfage s9 rec
01a0: 6f 72 64 73 29 29 0a 0a 28 64 65 66 69 6e 65 2d  ords))..(define-
01b0: 72 65 63 6f 72 64 2d 74 79 70 65 20 74 68 69 6e  record-type thin
01c0: 67 0a 20 20 28 6d 61 6b 65 2d 74 68 69 6e 67 20  g.  (make-thing 
01d0: 78 29 0a 20 20 74 68 69 6e 67 3f 0a 20 20 28 78  x).  thing?.  (x
01e0: 20 74 68 69 6e 67 2d 78 29 0a 20 20 28 79 20 74   thing-x).  (y t
01f0: 68 69 6e 67 2d 79 20 73 65 74 2d 74 68 69 6e 67  hing-y set-thing
0200: 2d 79 21 29 29 0a 0a 28 64 65 66 69 6e 65 20 74  -y!))..(define t
0210: 20 28 6d 61 6b 65 2d 74 68 69 6e 67 20 31 32 33   (make-thing 123
0220: 29 29 0a 28 64 69 73 70 6c 61 79 20 22 74 20 3d  )).(display "t =
0230: 3e 20 22 29 20 28 77 72 69 74 65 20 74 29 20 28  > ") (write t) (
0240: 6e 65 77 6c 69 6e 65 29 0a 28 73 65 74 2d 74 68  newline).(set-th
0250: 69 6e 67 2d 79 21 20 74 20 27 62 6c 61 68 29 0a  ing-y! t 'blah).
0260: 28 64 69 73 70 6c 61 79 20 22 74 20 3d 3e 20 22  (display "t => "
0270: 29 20 28 77 72 69 74 65 20 74 29 20 28 6e 65 77  ) (write t) (new
0280: 6c 69 6e 65 29 0a                                line).