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

[SCHEME](apply macro)[LISP]

Name: Anonymous 2013-02-26 15:03

I want to apply a macro, but obviously that doesn't work because it's syntax. I'm also not very adept with the macro system in general.
In Chicken, amb is a macro. I'd like (apply amb '(1 2 3 4 5)) (or something similar that operates on a list) to function like (amb 1 2 3 4 5). Can it be done (also how?)?
Your answers (and HMA meme instances) are appreciated.

I hope there's still a programmer or two lurking around...

Name: Anonymous 2013-02-26 15:24

I've read up on it, and it seems that it's just not the right application for amb anyway.
Feel free to post neat or helpful macros you've written, though!

Name: Anonymous 2013-02-26 15:26

macros considered harmful

Name: Anonymous 2013-02-26 15:26

This is how I would do it in CL, it should translate easily to scheme

http://pastebin.com/pQdmFwcZ

Name: Anonymous 2013-02-26 15:46

Feel free to post neat or helpful macros you've written, though!

sure bro

http://pastebin.com/3MQd79ej

http://pastebin.com/c66UXt53

http://pastebin.com/0xYzFN8n

Name: Anonymous 2013-02-26 18:04

Hmmm... that's a bit of an odd objective. You can't assign a macro to a variable and perform any sort of logic over them at runtime, whatever you do must happen at macro-expansion time, so it would end up looking always like that, unless we speak of a more complicated macro which lets you operate over macros during expansion, which sounds interesting perhaps for some DSLs, but I can't think of one right now.

Oh, well, going by what you asked:

http://pastebin.com/weaXdSJq

Disclaimer: this is the absolute first Scheme macro I've written, so if there is a better way, I would be glad to know.

Name: Anonymous 2013-02-26 23:35

>>5.1 wow

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