5 ms·
I strongly dislike Racket's macro system, from my admittedly limited usage of it. Does Racket have a way to address the need to, say, create a dispatching tabl
by madmax96 10y ago
I strongly dislike Racket's macro system, from my admittedly limited usage of it.
Does Racket have a way to address the need to, say, create a dispatching table during syntax expansion and read from that table at runtime? I don't know Racket well, but I've been able to do similar things easily in Guile, Common Lisp, and Clojure without an issue. Googling this problem leads me to believe that it can't be done, which is a pretty severe handicap to have if you're a Lisp.
- samth 10y agoYes, you can certainly do that in Racket. For example, the `case` macro does exactly that when there are many possibilities. Unless you mean something different that I mean by "create and then read from".
- madmax96 10y agoAh. It seems I have misunderstood some of the Racket documentation. Thanks for the comment -- helped me out:) Also adding that what I was doing in Guile, Common Lisp, and Clojure was sloppy. After searching for the case macro, saying 'aha!', and applying what I learned into creating an equivalent Racket macro, I realize that it was a portable solution to Guile, and the same idea applies for non-hygienic macro systems.
- gus_massa 10y agoIf you send a minimized example to the mailing list, I'm sure someone will translate it from Guile to Racket in a few hours. https://groups.google.com/forum/#!forum/racket-users https://groups.google.com/forum/#!forum/racket-users (If the example is not too long, perhaps you can paste it here.)