top | item 1334014

Metaprogramming using Scheme

40 points| mahipal | 16 years ago |ibm.com | reply

5 comments

order
[+] wingo|16 years ago|reply
Interesting, I guess it's a good sign to see this kind of article on a more mainstream site like developerworks.

The open-brace, close-brace style of parenthesis placement is not very nice, though, and not idiomatic; and "then" and "else" in his examples aren't exactly reserved words. Still, kudos for trying to explain syntax-case macros.

Syntax-rules macros have a beauty worthy of Scheme. Syntax-case macros have a power worthy of Scheme. That the author's examples were not beautiful was not helped by syntax-case itself ;-)

Andy, who hacks a lot on syntax-case macros and an implementation thereof...

[+] m0th87|16 years ago|reply
It's from 2006, so I'd hardly consider it a good sign ;)
[+] Zak|16 years ago|reply
...making it easier to craft boilerplate code

Funny... I thought the goal of metaprogramming was to eliminate boilerplate code. I suspect that's what they really meant here - maybe they phrased it that way to make the intent understandable to Java programmers.

[+] enntwo|16 years ago|reply
It was worded a bit awkward, but again the goal is not to eliminate the boilerplate code, but to abstract it to a level where you only need to write it once.