Re: The IMMEDIATE mess




Julian V. Noble wrote:

I have nothing against a FIND that supplies more information, but
I fail to see why IMMEDIATE causes a mess. If you get rid of
IMMEDIATE how is ; going to work? Not to mention IF ELSE THEN BEGIN
WHILE UNTIL etc.

IMMEDIATE works. What it does usually isn't quite what you want but you
can make it work. I don't think we can get rid of IMMEDIATE any time
soon -- it would break a lot of existing code. We'll have to keep
IMMEDIATE for a good long time. I want some sharper tools in the
toolbox to go along with IMMEDIATE .

I am not sure that defining a DUP that tells you how often it
is compiled or executed justifies the proposed changes---after
all, you can always sort a program by words and count the
instances of any word.

That might not get the number you want, but my point was that this is a
trivial example that turns much harder than it ought to be.

There ought to be standard ways to extend the compiler. At present
those are very limited. The traditional way to extend the compiler is
by writing new words that do things at compile-time. That works. If you
want to extend the compiler to do something special -- anything special
-- at compile time when the compiler finds a standard word, then you
can make a traditional state-smart word (which has problems) or you can
write your own interpreter (which has other problems).

.



Relevant Pages

  • Re: DISFAVORED Was: name for 3 PICK finally?
    ... if you get rid of the ... immediate header bit then as Bruce pointed out you have 8 categories ... HOST COMPILER TARGET etc could fit in there, ... Forth programming into things that can run on the implementations I ...
    (comp.lang.forth)
  • Re: Forth Frustrations
    ... IMMEDIATE mess if he wants to. ... then you don't want to build them into the compiler. ... has to be something the compiler recognises. ... difference between getting rid of all parsing words versus getting rid ...
    (comp.lang.forth)
  • Re: CASE...OF
    ... OVER isn't immediate, so I don't know what is going on ... POSTPONE FOOBAR means "look at FOOBAR but do not execute its compilation ... : BLAH POSTPONE OVER; IMMEDIATE ... compiler, ...
    (comp.lang.forth)
  • Re: RfD: Synonyms
    ... should IMMEDIATE be applied to a synonym that was already ... On some systems this can result in the synonym ... Compiling in COMPILER, compile HOST words and what to do with COMPILER ...
    (comp.lang.forth)
  • Re: RfD: Synonyms
    ... should IMMEDIATE be applied to a synonym that was already ... On some systems this can result in the synonym ... Compiling in COMPILER, compile HOST words and what to do with COMPILER ...
    (comp.lang.forth)