The IMMEDIATE mess
  Home FAQ Contact Sign in
comp.lang.forth only
 
Advanced search
POPULAR GROUPS

more...

comp.lang.forth Profile…
 Up
The IMMEDIATE mess         


Author: J Thomas
Date: Aug 28, 2006 07:24

I don't have a proposal thought out, only some beginning ideas. Anybody
is welcome to build on them for whatever purpose, or to criticise them.

Usually what we need is not IMMEDIATE words or state-smart words.
IMMEDIATE was a quick simple hack that people have been working around
for 30 years. It's usually adequate, but not good.

Any word that includes POSTPONE or executes COMPILE, (or [COMPILE] ?)
is compile-only, and recursively any word that executes a word that
includes POSTPONE etc it compile-only.

The complications of state-smart etc don't belong in the words
themselves. The issue doesn't come up after you execute the words. The
issue comes up in the interpreter/compiler, when you FIND words and
decide what to do with them.

What if FIND (or its string-and-count replacement) were to give more
information? What if it were to give
Show full article (2.11Kb)
103 Comments
Re: The IMMEDIATE mess         


Author: Mark W. Humphries
Date: Aug 28, 2006 07:51

J Thomas wrote:
[snip]
> What if FIND (or its string-and-count replacement) were to give more
> information?
[snip]

I use a variant of FIND that accepts a mask telling it which behavior
I'm looking for:

" wordX" interpretation lookup
" wordX" compilation lookup

Lookup returns an lfa which I can interrogate further with IMMEDIATE?
for example.

Cheers,
Mark Humphries
Manila, Philippines
no comments
Re: The IMMEDIATE mess         


Author: Andrew Haley
Date: Aug 28, 2006 08:13

J Thomas gmail.com> wrote:
> I don't have a proposal thought out, only some beginning ideas. Anybody
> is welcome to build on them for whatever purpose, or to criticise them.
> Usually what we need is not IMMEDIATE words or state-smart words.
> IMMEDIATE was a quick simple hack that people have been working
> around for 30 years. It's usually adequate, but not good.
> Any word that includes POSTPONE or executes COMPILE, (or [COMPILE]
> ?) is compile-only, and recursively any word that executes a word
> that includes POSTPONE etc it compile-only.
> The complications of state-smart etc don't belong in the words
> themselves.

Semi-seriously: The complications of state-smart don't belong
anywhere. Give it up; you'll feel much better. :-)
> The issue doesn't come up after you execute the words. The issue
> comes up in the interpreter/compiler, when you FIND words and decide
> what to do with them.
> What if FIND (or its string-and-count replacement) were to give more
> information? What if it were to give
Show full article (2.23Kb)
61 Comments
Re: The IMMEDIATE mess         


Author: Jean-François Michaud
Date: Aug 28, 2006 08:23

J Thomas wrote:
> I don't have a proposal thought out, only some beginning ideas. Anybody
> is welcome to build on them for whatever purpose, or to criticise them.
>
> Usually what we need is not IMMEDIATE words or state-smart words.
> IMMEDIATE was a quick simple hack that people have been working around
> for 30 years. It's usually adequate, but not good.
>
> Any word that includes POSTPONE or executes COMPILE, (or [COMPILE] ?)
> is compile-only, and recursively any word that executes a word that
> includes POSTPONE etc it compile-only.
>
> The complications of state-smart etc don't belong in the words
> themselves. The issue doesn't come up after you execute the words. The
> issue comes up in the interpreter/compiler, when you FIND words and
> decide what to do with them.
>
> What if FIND (or its string-and-count replacement) were to give more
> information? What if it were to give
> ...
Show full article (2.95Kb)
8 Comments
Re: The IMMEDIATE mess         


Author: J Thomas
Date: Aug 28, 2006 10:20

Andrew Haley wrote:
>> The complications of state-smart etc don't belong in the words
>> themselves.
> Semi-seriously: The complications of state-smart don't belong
> anywhere. Give it up; you'll feel much better. :-)

I agree with you about state-smart words. Having two behaviors for one
name is almost as bad as using two names for one behavior. :-)
> I don't see how making state even more complicated is likely to
> simplify anything.

Well, I wanted to include the common practice and add something new so
it wouldn't have to break existing code. Doing that almost inevitably
means adding complication -- you can't get rid of the existing garbage
but can only add something new and (hopefully) better.
>> Wordlists don't clean up the IMMEDIATE mess, they make more messes
>> attempting to solve that. IMMEDIATE affects FIND . State-smart words
>> don't work because they try to fix something that ought to happen
>> while parsing with something that happens at execution time --
>> whenever execution happens.
Show full article (4.13Kb)
60 Comments
Re: The IMMEDIATE mess         


Author: J Thomas
Date: Aug 28, 2006 10:29

Jean-François Michaud wrote:
> Hmmm. My version of FIND doesn't differentiate between IMMEDIATE words
> and non IMMEDIATE words, it simply finds the word I'm asking for.

That doesn't fit the standard, but it might easily fit the new
standard. Why shouldn't FIND be factored?
> The behavior that you propose seems overly complex to me.

Maybe. What I want to do doesn't seem complex to me. I want to be able
to redefine any word and invisibly give it new behaviors, and have it
still keep its old behaviors visible. Is that too much to ask?

The 94 standard went a long way in that direction -- it didn't say
which words had nondefault compile behavior unless it was words that
had to have it. So you could make DUP immediate and hope to get all the
right results as well as whatever new results you wanted. But immediate
state-smart DUP did not work.
> In my system, the word I use for this is IMMEDIATE?

I like that factoring. So the word I would want to provide more
information would be that one instead of FIND .
7 Comments
Re: The IMMEDIATE mess         


Author: Jean-François Michaud
Date: Aug 28, 2006 11:43

J Thomas wrote:
> Jean-François Michaud wrote:
>
>> Hmmm. My version of FIND doesn't differentiate between IMMEDIATE words
>> and non IMMEDIATE words, it simply finds the word I'm asking for.
>
> That doesn't fit the standard, but it might easily fit the new
> standard. Why shouldn't FIND be factored?
>
>> The behavior that you propose seems overly complex to me.
>
> Maybe. What I want to do doesn't seem complex to me. I want to be able
> to redefine any word and invisibly give it new behaviors, and have it
> still keep its old behaviors visible. Is that too much to ask?

Hmmm. This completely depends on your definition of invisible. To whom?
To the users? I'm not certain I understand clearly what you are trying
to do:
Show full article (2.71Kb)
6 Comments
Re: The IMMEDIATE mess         


Author: Jean-François Michaud
Date: Aug 28, 2006 12:01

J Thomas wrote:
> Andrew Haley wrote:
>
>>> The complications of state-smart etc don't belong in the words
>>> themselves.
>
>> Semi-seriously: The complications of state-smart don't belong
>> anywhere. Give it up; you'll feel much better. :-)
>
> I agree with you about state-smart words. Having two behaviors for one
> name is almost as bad as using two names for one behavior. :-)
>
>> I don't see how making state even more complicated is likely to
>> simplify anything.
>
> Well, I wanted to include the common practice and add something new so
> it wouldn't have to break existing code. Doing that almost inevitably
> means adding complication -- you can't get rid of the existing garbage
> but can only add something new and (hopefully) better.
> ...
Show full article (6.04Kb)
no comments
Re: The IMMEDIATE mess         


Author: J Thomas
Date: Aug 28, 2006 12:29

Jean-François Michaud wrote:
> J Thomas wrote:
>> Jean-François Michaud wrote:
>>> The behavior that you propose seems overly complex to me.
>> Maybe. What I want to do doesn't seem complex to me. I want to be able
>> to redefine any word and invisibly give it new behaviors, and have it
>> still keep its old behaviors visible. Is that too much to ask?
> Hmmm. This completely depends on your definition of invisible. To whom?
> To the users? I'm not certain I understand clearly what you are trying
> to do:

I mean, invisible to standard programs that don't already know about
its extra function.
Show full article (4.52Kb)
5 Comments
Re: The IMMEDIATE mess         


Author: Jean-François Michaud
Date: Aug 28, 2006 17:28

J Thomas wrote:
> Jean-François Michaud wrote:
>> J Thomas wrote:
>>> Jean-François Michaud wrote:
>
>>>> The behavior that you propose seems overly complex to me.
>
>>> Maybe. What I want to do doesn't seem complex to me. I want to be able
>>> to redefine any word and invisibly give it new behaviors, and have it
>>> still keep its old behaviors visible. Is that too much to ask?
>
>> Hmmm. This completely depends on your definition of invisible. To whom?
>> To the users? I'm not certain I understand clearly what you are trying
>> to do:
>
> I mean, invisible to standard programs that don't already know about
> its extra function.
>
> If you were to redefine DUP so that it still did everything DUP is
> required to do, and it doesn't do anything else that shows (It uses ...
Show full article (6.08Kb)
1 Comment
1 2 3 4 5 6 7 8 9