Re: [racket-users] macros in Racket repository

2021-05-09 Thread Tim Meehan
Thanks folks! > On May 9, 2021, at 09:38, Robby Findler wrote: > >  > Here's one way to write it in modern Racket: > > #lang racket > (require (for-syntax syntax/parse)) > > (module+ test (require rackunit)) > > (define-syntax (my-and stx) > (syntax-parse stx > [(_) #'#f] > [(_

Re: [racket-users] macros in Racket repository

2021-05-09 Thread Robby Findler
Here's one way to write it in modern Racket: #lang racket (require (for-syntax syntax/parse)) (module+ test (require rackunit)) (define-syntax (my-and stx) (syntax-parse stx [(_) #'#f] [(_ e:expr) #'e] [(_ e1:expr e2:expr ...) #'(if e1 (my-and e2 ...) #f)])) (module+ test

Re: [racket-users] macros in Racket repository

2021-05-09 Thread Jens Axel Søgaard
Hi Tim, In this case Ryan's method leads to: https://github.com/racket/racket/blob/master/racket/collects/racket/private/qq-and-or.rkt#L440 But in case you are wondering about the style used in that file: at the point where "qq-and-or.rkt" is used, none of the usual syntax tools (such as

Re: [racket-users] macros in Racket repository

2021-05-09 Thread Ryan Culpepper
Here are the three most convenient ways I know of to find that information (which is "$RACKET/collects/racket/private/qq-and-or.rkt" in this specific case): If you use DrRacket, then open a file that uses `and`, right-click on an occurrence of `and`, and choose "Open Defining File" (which changes

[racket-users] macros in Racket repository

2021-05-09 Thread Tim Meehan
Where in the repository are macros like "and" and "or" defined? I tried searching for "and" and "or" ... but you probably know how that worked out. Thanks folks! -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group