Hi all,
I've done a little hacking on alexapaner (petrofsky.org/src/alexpander.scm) to make it works with DSSSL optional/keyword/rest values.
It seems to works, and I have uploaded on Dumping Grounds.
Now, I'd like integrate it in Gambit's `eval'.
I'm not sure if it can works as ##expand-source and c#expand-source.
Suggestions?
--marco
Afficher les réponses par date
You can look at blackhole (http://github.com/pereckerdal/blackhole) and see how it integrates its macro system.
It should work with ##expand-source, it just takes a function which expands code.
- James
On Sun, Mar 7, 2010 at 1:45 PM, Marco Benelli mbenelli@yahoo.com wrote:
Hi all,
I've done a little hacking on alexapaner (petrofsky.org/src/alexpander.scm) to make it works with DSSSL optional/keyword/rest values.
It seems to works, and I have uploaded on Dumping Grounds.
Now, I'd like integrate it in Gambit's `eval'.
I'm not sure if it can works as ##expand-source and c#expand-source.
Suggestions?
--marco
Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
10 mar 2010 kl. 19.20 skrev James Long:
You can look at blackhole (http://github.com/pereckerdal/blackhole) and see how it integrates its macro system.
It should work with ##expand-source, it just takes a function which expands code.
- James
There's a little bit more to it: ##expand-source hooks to eval and load. c#expand-source is the hook that gets invoked by the compiler.
/Per
Thanks James and Per.
I have already (quickly) tried ##expand-source, resulting in a segmentation fault. I will try harder.
--marco
Oh, the expand-source hooks must return an internal Gambit structure called source. It is used to mark s-expressions with source location information. See _eval.scm for details about it. I don't remember exactly how it works, but here's something that might help you get going:
(##sourcify '(hej (du)) ##source1-marker)
#(#(source2) (hej (du)) source2 #\u0c09)
(##sourcify-deep '(hej (du)) ##source1-marker)
#(#(source2) (#(#(source2) hej source2 #\u0c09) #(#(source2) (#(#(source2) du source2 #\u0c09)) source2 #\u0c09)) source2 #\u0c09)
(I'm not sure if it is correct to pass ##source1-marker as the second argument, I don't really remember what it means. I just checked it out real quick.
/Per
11 mar 2010 kl. 10.04 skrev Marco Benelli:
Thanks James and Per.
I have already (quickly) tried ##expand-source, resulting in a segmentation fault. I will try harder.
--marco
From: Per Eckerdal per.eckerdal@gmail.com
Oh, the expand-source hooks must return an internal Gambit structure called source. It is used to mark s-expressions with source location information. See _eval.scm for details about it. I don't remember exactly how it works, but here's something that might help you get going:
Yes, I've seen ##surcify and the likes, but I wasn't sure it was the right way to go. Now I can try to understand them better.
Thank you very much.
--marco