# arg.scm -rw-r--r-- 522 bytes View raw
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
(use-modules (srfi srfi-37))

(define-syntax ->
 (syntax-rules ()
  ((_ x) x)
  ((_ x (form more ...)) (form x more ...))
  ((_ x form) (form x))
  ((_ x form more ...) 
   (-> (-> x form) more ...))))

(define (string=! operand str)
 (-> str (string=? operand) not))

(display 
 (args-fold 
  (command-line)
  (list)
  (lambda (opt name arg operands) operands)
  (lambda (operand operands) 
   (when (string=! operand "print.scm")
    (begin
     (display operand)
     (newline)
     (cons operand operands))))
   '()))