I want to be able to write:
(nota E2 82)
instead of:
(define E2
(network ()
[sunet <= sine-wave 82]
[out = (+ sunet)]))
I know I can do this using macros and tried to write this:
(define-syntax (nota stx)
(syntax-case stx ()
[(nota x) #'(network ()
[sunet <= sine-wave x]
[out = (+ sunet)])]))
But I get this error:
nota: bad syntax in: (nota E2 82)
The simplest solution would be
(define-syntax-rule (nota x y)
(define x
(network ()
[sunet <= sine-wave y]
[out = (+ sunet)])))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With