Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.chainon-marquant.org!nntpfeed.proxad.net!proxad.net!feeder2-2.proxad.net!news.osn.de!diablo2.news.osn.de!news.belwue.de!rz.uni-karlsruhe.de!feed.news.schlund.de!schlund.de!news.online.de!not-for-mail From: Bernd Paysan Newsgroups: comp.lang.forth Subject: Re: return address manipulation Date: Wed, 14 Dec 2011 14:08:34 +0100 Organization: 1&1 Internet AG Lines: 30 Message-ID: References: <4eddf07f.57544369@192.168.0.50> <4edf3e69.143030702@192.168.0.50> <2011Dec7.142922@mips.complang.tuwien.ac.at> <2011Dec8.165153@mips.complang.tuwien.ac.at> <6MqdnZRLdI0XP3rTnZ2dnUVZ_u6dnZ2d@supernews.com> NNTP-Posting-Host: p5dcd67af.dip0.t-ipconnect.de Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Trace: online.de 1323868115 24623 93.205.103.175 (14 Dec 2011 13:08:35 GMT) X-Complaints-To: abuse@einsundeins.com NNTP-Posting-Date: Wed, 14 Dec 2011 13:08:35 +0000 (UTC) User-Agent: KNode/4.7.2 Xref: x330-a1.tempe.blueboxinc.net comp.lang.forth:8062 Andrew Haley wrote: > Turns out it's pretty easy on x86 SwiftForth, but not exactly trivial: > > icode (quotation) > here $400 + call > ret end-code > > : [: postpone (quotation) postpone begin ; immediate > : ;] postpone exit postpone then > postpone r> postpone code> ; immediate > > This takes advantage of the fact that the return stack really is the > processor's return stack and the rather nice ICODE allows the easy > insertion of assembly language fragments. It even generates pretty > efficient code. RECURSE doesn't work properly, though; is that a > problem? Do we even know what RECURSE should to inside a quotation? Probably recurse the nested definition. > The capture of locals' values would be nice to have, but perhaps > that's rather too much. Ah, no closures. Just nested anonymous definitions. What would be nice is when the nested definition could have their own locals. -- Bernd Paysan "If you want it done right, you have to do it yourself" http://bernd-paysan.de/