Re: [racket-users] Match: non-greedy, and also repeated elements?

2020-12-31 Thread Jon Zeppieri
Right... except that I completely misread your first example, which is not at all the same as my example with `cons` patterns. Sorry about that. On Thu, Dec 31, 2020 at 2:06 PM Jon Zeppieri wrote: > > On Wed, Dec 30, 2020 at 2:24 PM David Storrs wrote: > > > > First off, is there a way to make

Re: [racket-users] Match: non-greedy, and also repeated elements?

2020-12-31 Thread Jon Zeppieri
On Wed, Dec 30, 2020 at 2:24 PM David Storrs wrote: > > First off, is there a way to make ... in a pattern match non-greedily? i.e., > match as *few* elements as possible instead of as many? As far as I know, no. However, if your first example is really illustrative of what you're trying to

Re: [racket-users] How do I control where expressions may appear in a module language?

2020-12-31 Thread Jay McCarthy
I meant like this: ``` #lang racket/base (require (for-syntax racket/base syntax/parse) syntax/parse/define) ;; Run-time (struct state (a b c d) #:transparent) (define mt (state #f #f #f #f)) (define-simple-macro (set-field st:expr f:id v:expr) (struct-copy state

Re: [racket-users] How do I control where expressions may appear in a module language?

2020-12-31 Thread Sage Gerard
I didn't see an answer to my original question, but I still want to make sure I understood you before I rephrase. Thank you for the insights! By your three step suggestion, is something like this what you meant? I'm not sure I understood Step 3. It seems like I still have to add new structure

Re: [racket-users] How do I control where expressions may appear in a module language?

2020-12-31 Thread Jay McCarthy
Are you trying to take a macro argument and ensure that it is an expression? If so, then you can expand into `#%expression` https://docs.racket-lang.org/reference/__expression.html On the other hand, if you are trying to take a macro argument and ensure that it is NOT an expression... then that

[racket-users] Re: Suggestions for an additive synth on Racket

2020-12-31 Thread parawi...@gmail.com
I've been toying with sound synthesis (and especially additive) within racket for years, but I mostly do it offline (the aiff/aiffc format is pretty straightforward to understand even for a programming illiterate like me). For pseudo real-time you may consider using the command line utility