Am Dienstag, 4. Dezember 2012, 18:30:46 schrieb John Earnest:
> Howdy folks,
> 
> Factor, PostScript and a few other stack-oriented languages have literal
> syntax for blocks of code- Factor calls these "quotations". I've been
> puzzling over how I might go about building a similar facility in GForth.

Just look at the file quotations.fs in the development version, it's already 
implemented ;-).  There has been some discussion about the name, and as { } 
are already used for locals, we ended up with [: and ;] to start and end 
quotations.

http://git.bernd-paysan.de/?p=gforth.git;a=blob;f=quotations.fs

It's slightly more work, as we want to have a separate locals scope inside the 
quotation - we can't access the outer locals, as we don't know when the 
quotation is executed.

-- 
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://bernd-paysan.de/

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to