Megatest

Check-in [4e5c67b31e]
Login
Overview
Comment:Added cond-expand to mtargs so it can be chicken-5 and chicken-4
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.80
Files: files | file ages | folders
SHA1: 4e5c67b31ec6a90e937183a85f01409d63724a56
User & Date: matt on 2023-01-11 06:20:32
Other Links: branch diff | manifest | tags
Context
2023-01-11
07:14
Merged fork check-in: 43e394881f user: mrwellan tags: v1.80
06:20
Added cond-expand to mtargs so it can be chicken-5 and chicken-4 check-in: 4e5c67b31e user: matt tags: v1.80
05:52
Merged fork check-in: 74f81f69c1 user: matt tags: v1.80
Changes

Modified mtargs/mtargs.scm from [4162ab4280] to [c1be4192c1].

17
18
19
20
21
22
23
24
25

26
27
28
29




30
31



32

33
34
35
36
37
38
39


(module mtargs
    (
     arg-hash
     get-arg
     get-arg-from
     usage
     get-args

     print-args
     any-defined?
     )





(import scheme (chicken base) (chicken port) (chicken file) (chicken process-context))
(import srfi-69 srfi-1)





(define arg-hash (make-hash-table))

(define (get-arg arg . default)
  (if (null? default)
      (hash-table-ref/default arg-hash arg #f)
      (hash-table-ref/default arg-hash arg (car default))))








<

>




>
>
>
>
|
|
>
>
>

>







17
18
19
20
21
22
23

24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47


(module mtargs
    (
     arg-hash
     get-arg
     get-arg-from

     get-args
     usage
     print-args
     any-defined?
     )

(import scheme) ;; gives us cond-expand in chicken-4

(cond-expand
 (chicken-5
  (import scheme (chicken base) (chicken port) (chicken file) (chicken process-context))
  (import srfi-69 srfi-1))
 (chicken-4
  (import chicken posix srfi-69 srfi-1))
 (else))

(define usage (make-parameter print))
(define arg-hash (make-hash-table))

(define (get-arg arg . default)
  (if (null? default)
      (hash-table-ref/default arg-hash arg #f)
      (hash-table-ref/default arg-hash arg (car default))))