Path: csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: "Rod Pemberton" Newsgroups: comp.lang.forth Subject: Re: One for Elizabeth... Date: Wed, 14 May 2014 04:09:48 -0400 Organization: Aioe.org NNTP Server Lines: 30 Message-ID: References: <5c56c350-73d1-4a9d-9c39-509d8c27870b@googlegroups.com> <335e094a-9b36-42ae-b92e-08b16bbb0b9c@googlegroups.com> <535f57a1.491675324@news.demon.co.uk> <027cdcfc-bdbd-48ff-a1db-0d42b23ef4d2@googlegroups.com> <5364a7a4.839838714@news.demon.co.uk> <4806c4fd-09f0-45d4-b8a0-b14dabe6fcd3@googlegroups.com> <586bd91c-4fd5-40cb-9785-9d267dabf5a6@googlegroups.com> <08f880ce-af81-4b0a-aa2a-b68c2be7ed19@googlegroups.com> <9ca02e36-be4e-48f7-b354-99d6548f715e@googlegroups.com> <7xfvknd0d1.fsf@ruckus.brouhaha.com> <7xeh067x8w.fsf@ruckus.brouhaha.com> <21e9122a-b765-43dd-9290-5212e3a28a1d@googlegroups.com> <7xy4ycd6bx.fsf@ruckus.brouhaha.com> <4b076a40-c35c-4d60-b502-3c7c7903410f@googlegroups.com> <7x7g5wz3ld.fsf@ruckus.brouhaha.com> <453bebff-d3ed-43bd-a7fe-21244a98e5d5@googlegroups.com> <53991bb7-91d9-4148-8c18-6573bb47f093@googlegroups.com> NNTP-Posting-Host: CNsg4fVcCsvs3UaOgZtQCw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.16 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.forth:30353 On Wed, 14 May 2014 01:37:23 -0400, wrote: > I'm guessing that in your code your "local variables" are actually > fields in a struct that is on the heap and you pass the pointer to the > struct around with the xt of the closure, and also pass it into the > closure as a parameter. My working definitions are that a closure has > the local variables on the heap, and a quotation has the local variables > on a locals' stack (usually the return stack). This technique is > routinely done in C, and it can be done in ANS-Forth too. You are not > going to have syntax for your struct-based locals that is at all > comparable to normal syntax for locals. This technique is incredibly > ugly in C, and it would be in ANS-Forth too --- this is just a clunky > work-around that is done in languages that lack quotations (in 2014, > this is mostly just old-school languages such as C and ANS-Forth, as > most of the modern languages have either quotations or closures). > IIRC, your future Forth already has like a half-dozen stacks, so why don't you just add one more for locals? E.g., you've mentioned all of these so far: "single-cell" data "double-cell" data and strings "low precision" floating-point "high precision" floating-point return stack Rod Pemberton