Artifact
71ff11b4bf3660d35d81cfc214b070fcac6dfdac:
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 65 6e 61 6d 65 20 28 72 6e 72 73 29 20 (rename (rnrs)
0150: 28 66 6f 72 2d 61 6c 6c 20 61 6e 64 6d 61 70 29 (for-all andmap)
0160: 29 0a 20 20 28 73 75 72 66 61 67 65 20 73 37 38 ). (surfage s78
0170: 20 6c 69 67 68 74 77 65 69 67 68 74 2d 74 65 73 lightweight-tes
0180: 74 69 6e 67 29 0a 20 20 28 73 75 72 66 61 67 65 ting). (surfage
0190: 20 73 39 38 20 6f 73 2d 65 6e 76 69 72 6f 6e 6d s98 os-environm
01a0: 65 6e 74 2d 76 61 72 69 61 62 6c 65 73 29 29 0a ent-variables)).
01b0: 0a 28 63 68 65 63 6b 20 28 6c 69 73 74 3f 20 28 .(check (list? (
01c0: 67 65 74 2d 65 6e 76 69 72 6f 6e 6d 65 6e 74 2d get-environment-
01d0: 76 61 72 69 61 62 6c 65 73 29 29 0a 20 20 20 20 variables)).
01e0: 20 20 20 3d 3e 20 23 54 29 0a 28 63 68 65 63 6b => #T).(check
01f0: 20 28 61 6e 64 6d 61 70 20 28 6c 61 6d 62 64 61 (andmap (lambda
0200: 20 28 61 29 0a 20 20 20 20 20 20 20 20 20 20 20 (a).
0210: 20 20 20 20 20 20 28 61 6e 64 20 28 70 61 69 72 (and (pair
0220: 3f 20 61 29 0a 20 20 20 20 20 20 20 20 20 20 20 ? a).
0230: 20 20 20 20 20 20 20 20 20 20 20 28 73 74 72 69 (stri
0240: 6e 67 3f 20 28 63 61 72 20 61 29 29 0a 20 20 20 ng? (car a)).
0250: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0260: 20 20 20 28 70 6f 73 69 74 69 76 65 3f 20 28 73 (positive? (s
0270: 74 72 69 6e 67 2d 6c 65 6e 67 74 68 20 28 63 61 tring-length (ca
0280: 72 20 61 29 29 29 0a 20 20 20 20 20 20 20 20 20 r a))).
0290: 20 20 20 20 20 20 20 20 20 20 20 20 20 28 73 74 (st
02a0: 72 69 6e 67 3f 20 28 63 64 72 20 61 29 29 29 29 ring? (cdr a))))
02b0: 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .
02c0: 28 67 65 74 2d 65 6e 76 69 72 6f 6e 6d 65 6e 74 (get-environment
02d0: 2d 76 61 72 69 61 62 6c 65 73 29 29 0a 20 20 20 -variables)).
02e0: 20 20 20 20 3d 3e 20 23 54 29 0a 28 63 68 65 63 => #T).(chec
02f0: 6b 20 28 61 6e 64 6d 61 70 20 28 6c 61 6d 62 64 k (andmap (lambd
0300: 61 20 28 61 29 0a 20 20 20 20 20 20 20 20 20 20 a (a).
0310: 20 20 20 20 20 20 20 28 6c 65 74 20 28 28 76 20 (let ((v
0320: 28 67 65 74 2d 65 6e 76 69 72 6f 6e 6d 65 6e 74 (get-environment
0330: 2d 76 61 72 69 61 62 6c 65 20 28 63 61 72 20 61 -variable (car a
0340: 29 29 29 29 0a 20 20 20 20 20 20 20 20 20 20 20 )))).
0350: 20 20 20 20 20 20 20 20 28 61 6e 64 20 28 73 74 (and (st
0360: 72 69 6e 67 3f 20 76 29 0a 20 20 20 20 20 20 20 ring? v).
0370: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0380: 20 28 73 74 72 69 6e 67 3d 3f 20 76 20 28 63 64 (string=? v (cd
0390: 72 20 61 29 29 29 29 29 0a 20 20 20 20 20 20 20 r a))))).
03a0: 20 20 20 20 20 20 20 20 28 67 65 74 2d 65 6e 76 (get-env
03b0: 69 72 6f 6e 6d 65 6e 74 2d 76 61 72 69 61 62 6c ironment-variabl
03c0: 65 73 29 29 0a 20 20 20 20 20 20 20 3d 3e 20 23 es)). => #
03d0: 54 29 0a 28 61 73 73 65 72 74 20 28 6e 6f 74 20 T).(assert (not
03e0: 28 61 73 73 6f 63 20 22 42 4c 41 48 22 20 28 67 (assoc "BLAH" (g
03f0: 65 74 2d 65 6e 76 69 72 6f 6e 6d 65 6e 74 2d 76 et-environment-v
0400: 61 72 69 61 62 6c 65 73 29 29 29 29 0a 28 63 68 ariables)))).(ch
0410: 65 63 6b 20 28 67 65 74 2d 65 6e 76 69 72 6f 6e eck (get-environ
0420: 6d 65 6e 74 2d 76 61 72 69 61 62 6c 65 20 22 42 ment-variable "B
0430: 4c 41 48 22 29 0a 20 20 20 20 20 20 20 3d 3e 20 LAH"). =>
0440: 23 46 29 0a 0a 28 63 68 65 63 6b 2d 72 65 70 6f #F)..(check-repo
0450: 72 74 29 0a rt).