Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #40868
| From | "Alex McDonald" <blog@rivadpm.com> |
|---|---|
| Newsgroups | comp.lang.forth |
| Subject | Re: Forth programming style... |
| Date | 2015-07-28 12:38 +0100 |
| Organization | A noiseless patient Spider |
| Message-ID | <mp7pg6$mjp$1@dont-email.me> (permalink) |
| References | <a0bb956b-a98d-4ed1-b4d4-a5db465be92e@googlegroups.com><37e85f47-5cf3-4033-9e9d-bfc31c582edc@googlegroups.com><1a2e838f-e3f7-4f99-a321-9a02c1d6d6cb@googlegroups.com><84a2fcaf-807e-46a0-8c38-e68515a83c67@googlegroups.com><654e3729-7fce-4a04-a707-a0d5f7ab6050@googlegroups.com><55357ad6-5a4b-4ef6-b46b-7d05f9c5b3cf@googlegroups.com><4a7026e6-18ea-4f7c-a255-7874baba3769@googlegroups.com> <87si8gt1hs.fsf@jester.gateway.sonic.net> <mp7nmo$3h3$1@speranza.aioe.org> |
on 28/07/2015 12:06:46, "HAA" wrote: > Paul Rubin wrote: >> ... >> The genius of Forth was realizing this situation doesn't occur all that >> often. But it does sometimes occur. Chuck's code uses VARIABLEs rather >> freely to deal with it when it arises. That means you either burn RAM >> by permanently allocating a cell for each such variable even when >> they're not simultaneously in use, or else you have to carefully track >> which ones might overlap during nested calls. You also must handle the >> possibility of such variables being used by multiple words. Better is >> to use stack-like allocation for them, plus temporary names, and that >> which is what locals amounts to. > > Too complicated. Use the Forth, Luke. > > 0 value LVAR > > : word1 > LVAR >R > ... do stuff with LVAR ... > R> TO LVAR ; > > : word2 > LVAR >R > ... do stuff with LVAR ... > R> TO LVAR ; > > What? It lacks the eye-candy of ANS/200x locals? Fortunately my > purpose is to offer a solution to the issues raised in the post - not > promote the concept of locals in Forth which Chuck firmly rejects. > > > Well, there's BASE @ followed by BASE ! to address the problem of "gratuitous base bashing" (which iirc is from Stephen Pelc). So it has a history and pedigree. What we need now is a real retro Forth conversation. I'll start with my pet hate; >BODY ! on bodies one should never bang. : inconstant create , does> @ ; 5 inconstant x 6 ' x >body !
Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Forth programming style... Mux <Yvo.Zoer@gmail.com> - 2015-07-21 15:40 -0700
Re: Forth programming style... Julian Fondren <ayrnieu@gmail.com> - 2015-07-21 17:28 -0700
Re: Forth programming style... Julian Fondren <ayrnieu@gmail.com> - 2015-07-21 17:39 -0700
Re: Forth programming style... Mark Wills <markwills1970@gmail.com> - 2015-07-22 00:48 -0700
Re: Forth programming style... "Elizabeth D. Rather" <erather@forth.com> - 2015-07-21 22:25 -1000
Re: Forth programming style... onewingedshark@gmail.com - 2015-07-22 15:13 -0700
Re: Forth programming style... "Elizabeth D. Rather" <erather@forth.com> - 2015-07-22 13:24 -1000
Re: Forth programming style... stephen@mpeforth.com (Stephen Pelc) - 2015-07-23 08:28 +0000
Re: Forth programming style... Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-07-22 02:38 -0700
Re: Forth programming style... Mark Wills <markwills1970@gmail.com> - 2015-07-22 03:14 -0700
Re: Forth programming style... humptydumpty <ouatubi@gmail.com> - 2015-07-22 03:45 -0700
Re: Forth programming style... "Elizabeth D. Rather" <erather@forth.com> - 2015-07-22 08:37 -1000
Re: Forth programming style... Paul Rubin <no.email@nospam.invalid> - 2015-07-22 12:51 -0700
Re: Forth programming style... "Elizabeth D. Rather" <erather@forth.com> - 2015-07-22 10:14 -1000
Re: Forth programming style... anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-07-23 06:23 +0000
Re: Forth programming style... hughaguilar96@gmail.com - 2015-07-23 16:59 -0700
Re: Forth programming style... hughaguilar96@gmail.com - 2015-07-23 20:18 -0700
Re: Forth programming style... "HAA" <someone@microsoft.com> - 2015-07-28 21:06 +1000
Re: Forth programming style... "Alex McDonald" <blog@rivadpm.com> - 2015-07-28 12:38 +0100
Re: Forth programming style... "HAA" <someone@microsoft.com> - 2015-07-23 00:02 +1000
Re: Forth programming style... hughaguilar96@gmail.com - 2015-07-22 21:21 -0700
Re: Forth programming style... "WJ" <w_a_x_man@yahoo.com> - 2015-07-23 09:05 +0000
Re: Forth programming style... hughaguilar96@gmail.com - 2015-07-23 16:47 -0700
Re: Forth programming style... Mark Wills <markwills1970@gmail.com> - 2015-07-24 01:24 -0700
Re: Forth programming style... franck.bensusan@gmail.com - 2015-07-24 03:48 -0700
Re: Forth programming style... Paul Rubin <no.email@nospam.invalid> - 2015-07-24 18:15 -0700
Re: Forth programming style... "HAA" <someone@microsoft.com> - 2015-08-01 13:21 +1000
Re: Forth programming style... hughaguilar96@gmail.com - 2015-07-22 21:48 -0700
Re: Forth programming style... Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-07-22 22:28 -0700
Re: Forth programming style... Bernd Paysan <bernd.paysan@gmx.de> - 2015-08-02 00:43 +0200
Re: Forth programming style... Bernd Paysan <bernd.paysan@gmx.de> - 2015-08-02 00:22 +0200
Re: Forth programming style... hughaguilar96@gmail.com - 2015-08-01 16:41 -0700
Re: Forth programming style... "Rod Pemberton" <boo@fasdfrewar.cdm> - 2015-08-01 22:01 -0400
Re: Forth programming style... anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-08-02 05:50 +0000
Re: Forth programming style... Bernd Paysan <bernd.paysan@gmx.de> - 2015-08-02 16:33 +0200
Re: Forth programming style... "Rod Pemberton" <boo@fasdfrewar.cdm> - 2015-08-01 22:04 -0400
Re: Forth programming style... "Elizabeth D. Rather" <erather@forth.com> - 2015-08-02 08:54 -0500
Re: Forth programming style... "Rod Pemberton" <boo@fasdfrewar.cdm> - 2015-08-03 04:51 -0400
Re: Forth programming style... "Elizabeth D. Rather" <erather@forth.com> - 2015-08-03 17:36 -0500
Re: Forth programming style... anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-07-22 10:16 +0000
Re: Forth programming style... mhx@iae.nl - 2015-07-22 10:02 -0700
Re: Forth programming style... anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-07-22 10:09 +0000
Re: Forth programming style... Syd Rumpo <usenet@nononono.co.uk> - 2015-07-22 12:16 +0100
Re: Forth programming style... Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-07-22 07:59 -0700
Re: Forth programming style... glidedog@gmail.com - 2015-07-23 04:24 -0700
Re: Forth programming style... "Ala'a Alawi" <amalawi@gmail.com> - 2015-07-23 19:32 -0700
Re: Forth programming style... hughaguilar96@gmail.com - 2015-07-23 21:33 -0700
Re: Forth programming style... borota@gmail.com - 2015-07-23 22:09 -0700
Re: Forth programming style... hughaguilar96@gmail.com - 2015-07-23 22:57 -0700
Re: Forth programming style... "Ala'a Alawi" <amalawi@gmail.com> - 2015-07-24 09:26 -0700
Re: Forth programming style... "Ala'a Alawi" <amalawi@gmail.com> - 2015-07-24 09:26 -0700
csiph-web