Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

/prog/ challenge

Name: Anonymous 2014-07-16 18:35

Write a macro that, given a term of code, transforms all the calls to the function FOO in that term, and only those calls, into calls to function BAR with the same arguments.
Language: Common Lisp or Scheme.

Name: Anonymous 2014-07-18 19:56

>>36
trolled us all by posting an ill-imposed problem.

Not at all. I was just trying to find out if s-exp languages have any actual advantages for writing macros. Lispers talk much about how cool "code is data" is, and how much easier writing macros is with s-exps. Yet it seemed to me that most of their macros are generative, which the s-exps are not particularly advantageous for (it can be done in any "blub" language, just look at Nemerle or Rust or Metalua, for example). So I wondered if homoiconicity is good for transformative macros. And it turns out that you can't even write a reliable function-swapping macro with it. At least with the s-exp kind of homoiconicity.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List