Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #1116
| From | anton@mips.complang.tuwien.ac.at (Anton Ertl) |
|---|---|
| Subject | Re: Implementation of execute-parsing-file |
| Newsgroups | comp.lang.forth |
| References | (4 earlier) <2995683f-b76e-4544-9cda-a2e6f7ad37a7@k30g2000yqb.googlegroups.com> <2011Apr7.183251@mips.complang.tuwien.ac.at> <d5839e54-1805-4556-92dc-ce5ffbb13f93@k9g2000yqi.googlegroups.com> <2011Apr9.151054@mips.complang.tuwien.ac.at> <MfCdnRQ2OeD6_zzQnZ2dnUVZ_vmdnZ2d@supernews.com> |
| Organization | Institut fuer Computersprachen, Technische Universitaet Wien |
| Date | 2011-04-10 13:11 +0000 |
| Message-ID | <2011Apr10.151122@mips.complang.tuwien.ac.at> (permalink) |
Andrew Haley <andrew29@littlepinkcloud.invalid> writes:
>Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
>>
>> An advice frequently given here is "Don't do this!". And I agree:
>> Don't use late binding for referencing words that you know at
>> compile time. And don't design words such that they require late
>> binding.
>
>This seems like an extreme solution. One of the advantages of Forth
>over a static language like C is that you can use late binding, and
>it's a shame to abandon it altogether because it fails if misused.
>Lots of things fail if misused.
If you design a word such that the usual use is a misuse, it's
misdesigned.
It's easy to get late binding from early binding words in Forth (see
below). It's harder to get early binding from late-binding words in
Forth (look at all the hoops that the implementation of
EXECUTE-PARSING in standard Forth jumps through).
In the rare case when we want late binding, we can get it by using
EVALUATE. In the case of EXECUTE-PARSING-FILE, it's a little more
complicated, because we want the input source when executing the
late-bound word to be the file, not the EVALUATEd string. Still, we
can use FIND or "['] ' EXECUTE-PARSING" to get a late-bound xt and
pass that to EXECUTE-PARSING-FILE.
- anton
--
M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
New standard: http://www.forth200x.org/forth200x.html
EuroForth 2010: http://www.euroforth.org/ef10/
Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar
Implementation of execute-parsing-file Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2011-04-05 10:50 +0100
Re: Implementation of execute-parsing-file David Kuehling <dvdkhlng@gmx.de> - 2011-04-05 11:58 +0200
Re: Implementation of execute-parsing-file Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2011-04-05 12:26 +0100
Re: Implementation of execute-parsing-file Josh Grams <josh@qualdan.com> - 2011-04-05 22:35 +0000
Re: Implementation of execute-parsing-file BruceMcF <agila61@netscape.net> - 2011-04-05 18:31 -0700
Re: Implementation of execute-parsing-file Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2011-04-06 10:15 +0100
Re: Implementation of execute-parsing-file BruceMcF <agila61@netscape.net> - 2011-04-06 09:04 -0700
Re: Implementation of execute-parsing-file Josh Grams <josh@qualdan.com> - 2011-04-07 10:19 +0000
Re: Implementation of execute-parsing-file BruceMcF <agila61@netscape.net> - 2011-04-07 07:54 -0700
Re: Implementation of execute-parsing-file anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2011-04-07 16:32 +0000
Re: Implementation of execute-parsing-file BruceMcF <agila61@netscape.net> - 2011-04-08 18:22 -0700
Re: Implementation of execute-parsing-file anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2011-04-09 13:10 +0000
Re: Implementation of execute-parsing-file BruceMcF <agila61@netscape.net> - 2011-04-09 12:43 -0700
Re: Implementation of execute-parsing-file anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2011-04-10 13:22 +0000
Re: Implementation of execute-parsing-file BruceMcF <agila61@netscape.net> - 2011-04-10 09:44 -0700
Re: Implementation of execute-parsing-file anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2011-04-11 14:22 +0000
Re: Implementation of execute-parsing-file BruceMcF <agila61@netscape.net> - 2011-04-11 08:37 -0700
Re: Implementation of execute-parsing-file BruceMcF <agila61@netscape.net> - 2011-04-11 09:05 -0700
Re: Implementation of execute-parsing-file anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2011-04-13 16:50 +0000
Re: Implementation of execute-parsing-file BruceMcF <agila61@netscape.net> - 2011-04-13 12:37 -0700
Re: Implementation of execute-parsing-file Andrew Haley <andrew29@littlepinkcloud.invalid> - 2011-04-10 02:55 -0500
Re: Implementation of execute-parsing-file anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2011-04-10 13:11 +0000
Re: Implementation of execute-parsing-file Andrew Haley <andrew29@littlepinkcloud.invalid> - 2011-04-10 09:27 -0500
Re: Implementation of execute-parsing-file anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2011-04-11 14:11 +0000
Re: Implementation of execute-parsing-file Doug Hoffman <glidedog@gmail.com> - 2011-04-07 11:46 -0400
Re: Implementation of execute-parsing-file BruceMcF <agila61@netscape.net> - 2011-04-08 18:24 -0700
Re: Implementation of execute-parsing-file Doug Hoffman <glidedog@gmail.com> - 2011-04-09 02:53 -0400
Re: Implementation of execute-parsing-file BruceMcF <agila61@netscape.net> - 2011-04-09 13:01 -0700
Re: Implementation of execute-parsing-file BruceMcF <agila61@netscape.net> - 2011-04-06 09:14 -0700
Re: Implementation of execute-parsing-file Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2011-04-06 10:15 +0100
csiph-web