Others have given good reasons to take alternate approaches, but if I were
writing your define-lookup-function macro, I would avoid using a dictionary
type and have the macro expand to `case`, like this:
[lhs:expr rhs:expr] ...)
#'(define (name arg)
[(lhs) rhs] ...
[else (error 'name (format "no matching clause for ~e"
For a pre-made solution, I'd look at match-lambda.
I'm interested to see what you're doing with this code! (I'm a musicology
student when I'm not playing with Racket.)
On Mon, Aug 7, 2017 at 1:01 PM, Luis Sanjuán <luisj.sanj...@gmail.com>
> On Monday, August 7, 2017 at 6:39:58 PM UTC+2, Luis Sanjuán wrote:
> > EDIT.
> > In the description of the 'Interval' data type, replace 'notes' with
> > In the signature of the function `interval`, replace 'Nat' with
> Another one:
> In the signature of `fifths-from-to` replace the returned type `Nat` with
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
For more options, visit https://groups.google.com/d/optout.