[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gforth] anonymous inline word definitions
From: |
Bernd Paysan |
Subject: |
Re: [gforth] anonymous inline word definitions |
Date: |
Wed, 05 Dec 2012 01:16:19 +0100 |
User-agent: |
KMail/4.8.5 (Linux/3.4.11-2.16-desktop; KDE/4.8.5; x86_64; ; ) |
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/
signature.asc
Description: This is a digitally signed message part.