Search Results
7/3/2025, 3:04:58 PM
>>105786300
>I don't get how this part ($ path? path) Is supposed to work
I messed up it's a typo, the pattern should be (? path? path) where path? could be (in guile at least)
(define (path? path)
(and (file-exists? path)
(eq? (stat:type (stat path)) 'regular)))
In anon's original input >>105760777
>$ scriptname /path/to/input --switch-flag-on --output /path/to/output
they want to match 3 common cases: (--switch), (--switch option), and (path). path is tricky as it could be positional, optional, or overridden by later paths. The function >>105765142 handles the latter case so the final pattern can report any failed matches (which is nearly certain, most command line lists start with the name of the program), instead of raising these questions with anon I tried to do the least annoying thing and let them fix it
>I don't get how this part ($ path? path) Is supposed to work
I messed up it's a typo, the pattern should be (? path? path) where path? could be (in guile at least)
(define (path? path)
(and (file-exists? path)
(eq? (stat:type (stat path)) 'regular)))
In anon's original input >>105760777
>$ scriptname /path/to/input --switch-flag-on --output /path/to/output
they want to match 3 common cases: (--switch), (--switch option), and (path). path is tricky as it could be positional, optional, or overridden by later paths. The function >>105765142 handles the latter case so the final pattern can report any failed matches (which is nearly certain, most command line lists start with the name of the program), instead of raising these questions with anon I tried to do the least annoying thing and let them fix it
Page 1