Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #13991
| From | anton@mips.complang.tuwien.ac.at (Anton Ertl) |
|---|---|
| Newsgroups | comp.lang.forth |
| Subject | Re: Is smartness the problem? |
| Date | 2012-07-14 11:53 +0000 |
| Organization | Institut fuer Computersprachen, Technische Universitaet Wien |
| Message-ID | <2012Jul14.135307@mips.complang.tuwien.ac.at> (permalink) |
| References | <m75h1o.ide@spenarnc.xs4all.nl> |
Albert van der Horst <albert@spenarnc.xs4all.nl> writes:
>Recently we had a discussion about formatting.
>The basic idea is:
>
>AVAILABLE "HOST" GET-ENV
>"The computer %s has %d bytes available" FORMAT&TYPE
>
>What FORMAT&TYPE does is
...
>3. EXECUTE s , which gives a string, collect that string
...
>Alternative implementations are now
>1. once you find the string "s" or "d" evaluate it
> with the formatters at the top of the search order.
>2. Use SEARCH-WORD-LIST and EXECUTE
In 3. you say that you EXECUTE it, so EVALUATE (1.) is out.
>I've been bitten hard by a problem caused by using 1
>and the existance of STATE. There is no smart
>word in sight, but it smells the same.
>
>I want to add the phrase
>" ^%s @ %d +" to a method definition, where at %s
>the name of the class is to be filled in and at %d
>the offset of the field where the method is supposed to
>work.
>The string e.g. "^VECTOR @ 4 + " has to be evaluated in
>compilation mode.
>
>However I got the string "^ @ +". It took me some time
>to realize that evaluating "s" in compilation mode,
>merely added s to the current definition, and did nothing
>to end up in the collected string.
>
>So, I wonder what wise lessons concerning STATE I missed
>to get into this trouble.
EVALUATE does not work in general for most of the things that people
want to do with it (but it appears to work for simple cases), because
it uses a lot of context that people do not want in general (at least
not at EVALUATE run-time, when it is used by EVALUATE). STATE is
among that context.
- 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 2012: http://www.euroforth.org/ef12/
Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar
Is smartness the problem? Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-07-14 12:22 +0000 Re: Is smartness the problem? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-07-14 11:53 +0000 Re: Is smartness the problem? Bernd Paysan <bernd.paysan@gmx.de> - 2012-07-14 15:26 +0200
csiph-web