Created
May 2, 2016 21:20
-
-
Save vxe/34694efad380c3711fabacd6da1b8140 to your computer and use it in GitHub Desktop.
janky guile command line parsing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/guile \ | |
-e main -s | |
!# | |
(define (main args) | |
(map (lambda (arg) (display arg) (display " ")) | |
(cdr args)) | |
(newline)) | |
(define (caddddr list) | |
(car (cdr (cdr (cdr (cdr list)))))) | |
(define (cadddddr list) | |
(car (cdr (cdr (cdr (cdr (cdr list))))))) | |
(let | |
(($0 (car (command-line))) | |
($1 (cadr (command-line))) | |
($2 (caddr (command-line))) | |
($3 (cadddr (command-line))) | |
($4 (caddddr (command-line))) | |
($5 (cadddddr (command-line)))) | |
(display $0) | |
(newline) | |
(display $1) | |
(newline) | |
(display $2) | |
(newline) | |
(display $3) | |
(newline) | |
(display $4) | |
(newline) | |
(display $5) | |
(newline)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment