Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How do quotation work, I can not foound them in 20xx

711 views
Skip to first unread message

Tessa Bonting

unread,
Jul 12, 2015, 9:48:30 AM7/12/15
to
Hey to all,

Can anyone tell me how qoutation work.
Is the word being compiled temporary stopped or a forward branch
inserted to skip the quotation?
And where are they used for?

As in : foo ( -- ) 0 [: 2 + ;] . ;
foo 2

Anton Ertl

unread,
Jul 12, 2015, 11:11:59 AM7/12/15
to
Tessa Bonting <tessa....@gmail.com> writes:
>Hey to all,
>
>Can anyone tell me how qoutation work.
>Is the word being compiled temporary stopped or a forward branch
>inserted to skip the quotation?

Typically a branch around the quotation is inserted in the containing
definition.

- 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 2015: http://www.mpeforth.com/euroforth2015/euroforth2015.htm

Julian Fondren

unread,
Jul 12, 2015, 11:23:44 AM7/12/15
to
On Sunday, July 12, 2015 at 8:48:30 AM UTC-5, Tessa Bonting wrote:
> Hey to all,
>
> Can anyone tell me how qoutation work.
> Is the word being compiled temporary stopped or a forward branch
> inserted to skip the quotation?

Sure? Either? Does it matter?

Have a limited implementation in ciforth, which branches over the
quotation:

: [: POSTPONE 0 POSTPONE IF HERE ; IMMEDIATE
: :] >R POSTPONE EXIT POSTPONE THEN R> POSTPONE LITERAL ; IMMEDIATE
: CALL >R ;

As used in:

: EACH-CHAR ( c-addr u qt -- ) LOCAL qt
BOUNDS ?DO I C@ qt CALL LOOP ;

: STARRY ( c-addr u -- )
[: &* EMIT EMIT :] EACH-CHAR &* EMIT ;

"hello" STARRY \ outputs: *h*e*l*l*o*

The limitation: you can't EXECUTE these quotations. Which means
you can't write code that is neutral as to whether it receives a
quotation or a quoted word -- an XT. An executable version would
I expect only require that [: construct a header, and that the
address put on the stack by :] refer to the part of it that a
normal XT would.

So you can easily add bad quotations to any Forth that respects
the return stack (or can be told to respect it), probably, and
can add better quotations after learning some details about
your Forth.

> And where are they used for?

They are anonymous definitions. They're used for code that
doesn't deserve a name that you would like to pass to a
higher-order word. What would you name the quotation above?

: STAR-THEN-CHAR ( c -- ) &* EMIT EMIT ;
: *EMIT ( c -- ) &* EMIT EMIT ;
: HELPER ( c -- ) &* EMIT EMIT ;
: AUX ( c -- ) &* EMIT EMIT ;

A particularly useful higher-order word to pass definitions to is
CATCH . For example if you have a mainloop for a game

: GO ( -- ) INIT
BEGIN do this do that do that other thing AGAIN ;

And you want to catch exceptions that reach it, you could write an outer word like

: SAFE-GO ( -- ) ['] GO CATCH ... ;
: WRAPPED-GO ( -- ) ['] GO CATCH ... ;
: GO ( -- ) ['] GO CATCH ... ;

Or you could just wrap the original mainloop in a quotation:

: GO ( -- ) INIT
[: BEGIN do this do that do that other thing AGAIN :]
CATCH ... ;

The way your code evolves, you might start early on with the
unwrapped GO , then realize later that you need to catch
exceptions at this point , and you might appreciate only having to
insert [: :] around part of it.

Speaking of 'part of it', you see that the original INIT doesn't
need exceptions caught - maybe it already handles exceptions in a
superior manner for initialization code, and further catches would
only mishandle errors at that level. Excepting INIT from the
CATCH in SAFE-GO however would require altering GO so that you
could move the INIT into SAFE-GO . Suddenly the logic that was
all in one place is now in two places. Quotations let you avoid
factoring when it's not appropriate.

Quotations might also be a more readable alternative to the
dark temptation of return stack magic. Some kinds of it.

> As in : foo ( -- ) 0 [: 2 + ;] . ;
> foo 2

You would need EXECUTE before the dot. Otherwise you're printing
the address of the quotation.

With limited CALL-requiring quotations:

: MAP-TEN ( qt -- ) LOCAL qt
10 0 ?DO I qt CALL LOOP ;

: foo ( -- )
[: 2 + . :] MAP-TEN ;

foo \ outputs: 2 3 4 5 6 7 8 9 10 11

For more reasonable higher-order words, take a look at the Forth
Foundation Library, which uses them all over the place with
various data structures. You can pass XTs to these words just
fine, but again, sometimes you might want to pass a very trivial
word like 2 + . to them, and you might appreciate not having to
come up with a name for such a thing, which you might rather
retype in full even if you happened to accidentally reuse it in a
second part of your program.


-- Julian

Tessa Bonting

unread,
Jul 12, 2015, 11:47:37 AM7/12/15
to
Op zondag 12 juli 2015 17:11:59 UTC+2 schreef Anton Ertl:
Thank you both, I forgotten the execute since I it was not clearly
to me what the quation did.
I like it allready and I will implment it.

Coos Haak

unread,
Jul 12, 2015, 1:14:13 PM7/12/15
to
Op Sun, 12 Jul 2015 08:23:42 -0700 (PDT) schreef Julian Fondren:
This allows EXECUTE:
: [: POSTPONE 0 POSTPONE IF HERE 'QUIT @ , HERE CELL+ ; IMMEDIATE
: ;] >R POSTPONE EXIT POSTPONE THEN R> POSTPONE LITERAL ; IMMEDIATE
\ Note the semicolon instead of colon

: COUNTING [: . ;] 11 1 DO I OVER EXECUTE LOOP DROP ;

groet Coos

hughag...@gmail.com

unread,
Jul 12, 2015, 5:55:05 PM7/12/15
to
On Sunday, July 12, 2015 at 6:48:30 AM UTC-7, Tessa Bonting wrote:
> Hey to all,
>
> Can anyone tell me how qoutation work.

Quotations don't work in Forth-200x --- all you have is :NONAME faked up as a quotation.

Quotations do work in the FMITE processor --- the quotation has access to the parent function's local variables.

http://www.forth.org/FMITE.txt

Mark Wills

unread,
Jul 13, 2015, 4:15:03 AM7/13/15
to
So, a quotation leaves it's XT on the stack, yes, to be consumed
by EXECUTE later, yes?

Mark Wills

unread,
Jul 13, 2015, 4:20:19 AM7/13/15
to
And, furthermore, what happens at the end of the quotation? Does
it EXIT, or does it run into the remaining definition.

: foo a b [: c ;] d ;

Presumably, when foo is executed, a nd b are executed, c is not,
and d is? On exit from foo, the XT of the quotation c is on the
stack?

Raimond Dragomir

unread,
Jul 13, 2015, 4:28:38 AM7/13/15
to
Yes.

About the branch around the quotation, if you choose this implementation,
a literal will be necessary also, to put the quotation's address on the
data stack.

I use a different implementation: a CALL around the quotation, and a simple
R> instead of the literal.

Raimond Dragomir

unread,
Jul 13, 2015, 4:30:33 AM7/13/15
to
Yes, unless d consumes it first ...

Raimond Dragomir

unread,
Jul 13, 2015, 4:33:27 AM7/13/15
to
> > And, furthermore, what happens at the end of the quotation? Does
> > it EXIT, or does it run into the remaining definition.
> >
> > : foo a b [: c ;] d ;
> >
> > Presumably, when foo is executed, a nd b are executed, c is not,
> > and d is? On exit from foo, the XT of the quotation c is on the
> > stack?
>
> Yes, unless d consumes it first ...

def foo 1 2 [ 3 ] 4 ;
foo reDef
ok
foo hex .s
1 2 40D6BF 4 <S ok...
swap execute .s
1 2 4 3 <S ok...

Alex McDonald

unread,
Jul 13, 2015, 7:53:07 AM7/13/15
to
There's no accepted definition of quotation, or how it should work, nor a
standardization in the latest draft Forth 200x Draft 14.5. There does
appear to be a consensus; the ability to define a nameless word inside a
definition, and retrieve an execution token for EXECUTE. It's seen as a
useful adjunct to :NONAME and ticking named code.

The ability to address locals has not been properly discussed, since it
opens up the issue of the lifetime of the XT vs the lifetime of the
local. The XT can be EXECUTEd or COMPILE,d inside or outside of the
enclosing definition, since Forth doesn't have the concept of scope for
code, only data on the stacks and LOCALs. Therefore any local defined in
the outer definition and used in the quotation can only be addressed
inside the execution scope of the quotation. That limits the quotation
that uses outer local's use; but since there isn't much extant experience
with them, this may or many not be an issue.

Personal experience so far; (1) I don't tend to use locals inside the
quotation and (b) I don't have any use yet for quotations outside the
parent's execution scope.

What is your experience with this?

Mark Wills

unread,
Jul 13, 2015, 9:13:43 AM7/13/15
to
I personally have no experience with them, and I'm still struggling
to see a use for them. However, regarding executing and compiling the
XT of the quotation outside the scope of the parent definition: you
just make that behaviour undefined.

"Compiling or executing the quotation after the definition in which
the quotation has been defined has gone out of scope may leave the
system in an undefined state" or other such verbiage.

I'm still somewhat agog though there's serious interest in adding this
behaviour to the language, but the language doesn't include support
for... oooooh, I dunno, say, single dimension arrays out of the box.

Stephen Pelc

unread,
Jul 13, 2015, 9:16:43 AM7/13/15
to
On Mon, 13 Jul 2015 12:53:06 +0100, "Alex McDonald" <bl...@rivadpm.com>
wrote:

>The ability to address locals has not been properly discussed, since it
>opens up the issue of the lifetime of the XT vs the lifetime of the
>local. The XT can be EXECUTEd or COMPILE,d inside or outside of the
>enclosing definition, since Forth doesn't have the concept of scope for
>code, only data on the stacks and LOCALs.

The original LOCALS| ... | notation provided no way for a program to
obtain the address of a local. The subsequent {: ... :} also has no
such feature. Various Forth systems have used this to put locals in
registers.

Systems with extensions for local buffers may need to expose the
address of a local buffer. The only occasion when it would be
convenient to expose the address of a local is in interfacing
to some C shared library routines that return data in variables.

If/when a local buffer notation is accepted, I see no reason to
require the address of a local variable/value. However, if the
address of a local value cannot be found, there will be pressure
to provide additional methods such as +TO.

>Personal experience so far; (1) I don't tend to use locals inside the
>quotation and (b) I don't have any use yet for quotations outside the
>parent's execution scope.

I don't use quotations enough to have an opinion on 1) yet. For 2),
I would see the abilty to return the xt of a quotation as an
entitlement.

Stephen

--
Stephen Pelc, steph...@mpeforth.com
MicroProcessor Engineering Ltd - More Real, Less Time
133 Hill Lane, Southampton SO15 5AF, England
tel: +44 (0)23 8063 1441, fax: +44 (0)23 8033 9691
web: http://www.mpeforth.com - free VFX Forth downloads

Alex McDonald

unread,
Jul 13, 2015, 11:00:15 AM7/13/15
to
Anywhere you might want to pass an xt to another xt. Sorting for example;

: cstr-ascend count swap count compare 0> ; \ sort compare for ascending
foo-sort ( array elems -- ) ['] cstr-ascend sort ;

Or we could have

bar-sort ( array elems -- ) [: count swap count compare 0> ;] sort ;

What CTSR-ASCEND is doing isn't in the word FOO-SORT sorting, and it
needs a name. Of course, for simple stuff that has a single word, then

: int-ascend-sort [: > ;] sort ;

is just

: int-ascend-sort ['] > sort ;

> However, regarding executing and compiling the
> XT of the quotation outside the scope of the parent definition: you
> just make that behaviour undefined.

If the quotation doesn't use locals, then I'd disagree; it would be
difficult to imagine an implementation where it wouldn't work in that
case.

>
> "Compiling or executing the quotation after the definition in which
> the quotation has been defined has gone out of scope may leave the
> system in an undefined state" or other such verbiage.
>
> I'm still somewhat agog though there's serious interest in adding this
> behaviour to the language, but the language doesn't include support
> for... oooooh, I dunno, say, single dimension arrays out of the box.
>

: 1dim create cells allot does> swap cells + ;
10 1dim myarray
10 0 myarray !
20 1 myarray !
0 myarray @ 1 myarray @ + 2 myarray !

and so on.

The language allows this out of the box. Qoutations on the other hand may
require non-standard words to implement -- or at least, non-standard
words to implement efficently.

Coos Haak

unread,
Jul 13, 2015, 11:13:17 AM7/13/15
to
Op Mon, 13 Jul 2015 06:13:41 -0700 (PDT) schreef Mark Wills:
There is :NONAME where execution behaviour is defined in the standard:
--
xt Execution: ( i×x -- j×x )
Execute the definition specified by xt. The stack effects
i×x and j×x represent arguments to and results from xt, respectively.
--
There is nothing about compilation behaviour though.

> I'm still somewhat agog though there's serious interest in adding this
> behaviour to the language, but the language doesn't include support
> for... oooooh, I dunno, say, single dimension arrays out of the box.

Variants of WORDS could use quotations, using traverse-wordlist.
print every word
[: name>string type true ;]
print only words beginning with A.
[: name>string over 'A' = if type else 2drop then true ;]
print and stops after finding first word with lenght 7
[: name>string dup 7 = if type false else 2drop true ;]

groet Coos

Alex McDonald

unread,
Jul 13, 2015, 11:58:22 AM7/13/15
to
on 13/07/2015 16:00:46, Coos Haak wrote:
> Op Mon, 13 Jul 2015 06:13:41 -0700 (PDT) schreef Mark Wills:
>

>>
>> I personally have no experience with them, and I'm still struggling
>> to see a use for them. However, regarding executing and compiling the
>> XT of the quotation outside the scope of the parent definition: you
>> just make that behaviour undefined.
>>
>> "Compiling or executing the quotation after the definition in which
>> the quotation has been defined has gone out of scope may leave the
>> system in an undefined state" or other such verbiage.
>>
> There is :NONAME where execution behaviour is defined in the standard:
> -- xt Execution: ( i×x -- j×x )
> Execute the definition specified by xt. The stack effects
> i×x and j×x represent arguments to and results from xt, respectively.
> --
> There is nothing about compilation behaviour though.

3.4.3.3 Compilation semantics
Unless otherwise specified in a "Compilation:" section of the glossary
entry, the compilation semantics of a Forth definition shall be to append
its execution semantics to the execution semantics of the current
definition.

Anton Ertl

unread,
Jul 13, 2015, 12:11:44 PM7/13/15
to
"Alex McDonald" <bl...@rivadpm.com> writes:
>Personal experience so far; (1) I don't tend to use locals inside the
>quotation and (b) I don't have any use yet for quotations outside the
>parent's execution scope.
>
>What is your experience with this?

For b, a simple example is:

: +field ( "name" n -- )
create ,
[: @ + ;] set-does>
[: >body @ postpone literal postpone + ;] set-compiler ;

Mark Wills

unread,
Jul 13, 2015, 12:12:10 PM7/13/15
to
On Monday, 13 July 2015 16:00:15 UTC+1, Alex McDonald wrote:
>
> The language allows this out of the box. Qoutations on the other hand may
> require non-standard words to implement -- or at least, non-standard
> words to implement efficently.

Yes, that's a good point.

betti...@gmail.com

unread,
Jul 13, 2015, 12:13:56 PM7/13/15
to
The word 'agog' is a new to me.

agog -- Full of keen anticipation or excitement; eager.

Somehow, I think you meant the opposite. Maybe you're aghast at everyone's agog?

Mark Wills

unread,
Jul 13, 2015, 12:15:55 PM7/13/15
to
I'm aghast that I used the word agog, where I meant aghast :-)

I must use it more often!

Mark Wills

unread,
Jul 13, 2015, 12:26:47 PM7/13/15
to
Turns out it's bonkers simple to implement. Well, it is on my system:

: [: ( int: -- addr )
postpone 0
postpone if
here postpone docol
; immediate

: ;] ( int: addr -- run: -- xt )
postpone exit
>r postpone then
r> postpone lit ,
; immediate

[ My system is Forth-83, with some ANS harnesses, such as POSTPONE ]

: test 1 2 [: 3 ;] 4 ;
swap execute .s
1 2 4 3 ok:4

They get access to locals 'for free' (as in, no code required):
: test
locals{ fred }
99 set fred \ load fred with 99
[: fred 1+ ;] execute .
;
test
100 ok:0

[ My locals aren't standard, they're home-brew ]

Oh well. :-)

Alex McDonald

unread,
Jul 13, 2015, 12:58:04 PM7/13/15
to
on 13/07/2015 17:00:14, wrote:
> "Alex McDonald" <bl...@rivadpm.com> writes:
>>Personal experience so far; (1) I don't tend to use locals inside the
>>quotation and (b) I don't have any use yet for quotations outside the
>>parent's execution scope.
>>
>>What is your experience with this?
>
> For b, a simple example is:
>
>: +field ( "name" n -- )
> create ,
> [: @ + ;] set-does>
> [: >body @ postpone literal postpone + ;] set-compiler ;
>
> - anton

Ah yes, I see I now have the same example in my Forth (factored through
OFFSET which uses a colon definition instead of CREATE, and COMPILES-ME
is SET-COMPILER);

: (offset) ( n -- ) ?dup if postpone literal postpone + then ;

: offset ( n1 <-name-> -- )
( n2 -- n2+n1 ) \ runtime
>r : r@ (offset) postpone ; rdrop
[: ( xt -- ) 0 swap execute (offset) ;] compiles-me ;

: +field ( n1 n2 <-name-> -- n1+n2 )
( addr -- addr+n1 ) \ runtime
over offset + ;

The fact I hadn't spotted the nature of this quotation just shows how
natural it is use them.

Coos Haak

unread,
Jul 13, 2015, 3:02:46 PM7/13/15
to
Op Mon, 13 Jul 2015 16:58:21 +0100 schreef Alex McDonald:
Didn't think to look into the general pages. Thanks.

groet Coos

hughag...@gmail.com

unread,
Jul 13, 2015, 4:10:34 PM7/13/15
to
On Monday, July 13, 2015 at 6:13:43 AM UTC-7, Mark Wills wrote:
> I personally have no experience with them, and I'm still struggling
> to see a use for them. However, regarding executing and compiling the
> XT of the quotation outside the scope of the parent definition: you
> just make that behaviour undefined.

Mark, it is not difficult to understand --- the iteration code (typically a BEGIN WHILE REPEAT loop) is hidden inside of the higher-order function --- this is as compared to cut-and-pasting the iteration code into the application program every time that it is needed to iterate through a data-structure.

Information hiding! Always a good thing!

> "Compiling or executing the quotation after the definition in which
> the quotation has been defined has gone out of scope may leave the
> system in an undefined state" or other such verbiage.

I don't like the word "undefined" --- just call it a "fatal error" --- "undefined" leaves open a lot of possibilities for what may happen.

Also, I prefer "exited" to "gone out of scope" --- you shouldn't use the word "scope" without specifying if you mean compile-time scope or run-time scope (you mean run-time here).

> I'm still somewhat agog though there's serious interest in adding this
> behaviour to the language, but the language doesn't include support
> for... oooooh, I dunno, say, single dimension arrays out of the box.

The purpose of quotations is to make general-purpose data-structures possible --- the code for iterating through them is hidden inside of higher-order functions provided in the code-library --- the user of the code library can use the container without knowing how it is implemented internally (can be complicated, such as for self-balancing trees, so you don't want this complication exposed to the user).

hughag...@gmail.com

unread,
Jul 13, 2015, 4:12:08 PM7/13/15
to
On Monday, July 13, 2015 at 6:13:43 AM UTC-7, Mark Wills wrote:
> I'm still somewhat agog...

If you're Gog, does that mean that I'm Magog?

Mark Wills

unread,
Jul 13, 2015, 5:24:20 PM7/13/15
to
I'm struggling to see the advantage of:

: foo some code [: bar ;] more code execute ;

against

: foo some code more code bar ;

It's just a different way of factoring. Can someone give me an example of something that can only be done using quotations?

Mark Wills

unread,
Jul 13, 2015, 5:24:48 PM7/13/15
to

Alex McDonald

unread,
Jul 13, 2015, 5:52:58 PM7/13/15
to
on 13/07/2015 21:10:30, hugh wrote:

>
> The purpose of quotations is to make general-purpose data-structures
> possib le --- the code for iterating through them is hidden inside of
> higher-order functions provided in the code-library --- the user of
> the code library ca n use the container without knowing how it is
> implemented internally (can b e complicated, such as for
> self-balancing trees, so you don't want this com plication exposed to
> the user).
>

If that was the point of quotations, we wouldn't need them, since :NONAME
and ticked named words are sufficent.

Alex McDonald

unread,
Jul 13, 2015, 6:13:02 PM7/13/15
to
No, since they are just nameless words.

wordlist constant wid

: count-words 0 [: drop 1+ true ;] wid traverse-wordlist ;

: (count-words) drop 1+ true ;
: count-words 0 (count-words) wid traverse-wordlist ;

I think the former is clearest.

Elizabeth D. Rather

unread,
Jul 13, 2015, 7:03:13 PM7/13/15
to
Do you mean ... ['] (count-words) wid traverse-wordlist ?

In any case, I find the conventional one clearest. Particularly since I
could reference (count-words) in testing (e.g., see (countwords) or
locate (countwords) etc.).

Cheers,
Elizabeth

--
==================================================
Elizabeth D. Rather (US & Canada) 800-55-FORTH
FORTH Inc. +1 310.999.6784
5959 West Century Blvd. Suite 700
Los Angeles, CA 90045
http://www.forth.com

"Forth-based products and Services for real-time
applications since 1973."
==================================================

hughag...@gmail.com

unread,
Jul 13, 2015, 9:51:44 PM7/13/15
to
On Monday, July 13, 2015 at 2:24:20 PM UTC-7, Mark Wills wrote:
> I'm struggling to see the advantage of:
>
> : foo some code [: bar ;] more code execute ;
>
> against
>
> : foo some code more code bar ;
>
> It's just a different way of factoring.

You can struggle mightily and never see the advantage in the former --- because it is nonsense.

I think that the Forth-200x committee gave us fake quotations (and your "bonkers simple" implementation was fake too) for the purpose of confusing people who don't know what quotations are. Their plan was that they would tell everybody: "These are quotations!" Then everybody would would say: "Quotations are useless!" Then they would say: "Well yes, quotations are useless, but we gave them to you because Hugh was asking for them --- so blame him!"

> Can someone give me an example of something that can only be done using quotations?

Every example in my document: http://www.forth.org/FMITE.txt

Stop listening to the Forth-200x promoters --- they are talking nonsense, about how quotations are just :NONAME with syntactic sugar, and are useless.

I already told you that the idea is to hide the iteration code inside of the higher-order functions rather than paste it into the application program code. This is not complicated. Clear your mind of all that obfuscation coming from the Forth-200x committee --- think about the concept for two minutes --- it is easy and obvious.

Here is an example from my document:

list
d field .name$ \ employee name
d field .salary \ salary per year in dollars
c field .female? \ flag indicating gender
constant employee

: count-females local{ employee-head | cnt -- females }
\ EMPLOYEE-HEAD is the head of a LIST linked list
employee-head @ { .female? c@ cnt +! } each
cnt @ ;

Notice that we are iterating through a linked list. But where is the BEGIN WHILE REPEAT loop??? It is hidden inside of the EACH higher-order function!

It is better to hide this iteration code inside of the higher-order function rather than paste it into the application code:

: count-females local{ employee-head | cnt -- females }
\ EMPLOYEE-HEAD is the head of a LIST linked list
employee-head @ begin dup while
dup .female? c@ cnt +! \ flags in LOTD are 1 for TRUE or 0 for FALSE
.fore @ repeat drop \ the .FORE field is hidden in the LIST struct
cnt @ ;

Pasting all this iteration code into the application code tends to bloat out the COUNT-FEMALES function. Also, it is error-prone because you may do this dozens of times in a program and could screw it up here or there. This iteration code is just traversing a linked list so it is pretty simple --- code that is traversing a self-balancing binary tree (especially if the code inserts or deletes nodes) is much more complicated --- you really don't want to expose such complicated code to the user where it is likely to get screwed up.

If you still don't get it, then you must have been out in the noonday sun too long and your brains are addled --- happens to Englishmen all the time --- this is the most likely explanation for why Stephen Pelc doesn't just put my disambiguifiers in VFX so all of his non-executable execution tokens are hidden and are not exposed to the user.

Julian Fondren

unread,
Jul 13, 2015, 11:19:51 PM7/13/15
to
On Monday, July 13, 2015 at 8:51:44 PM UTC-5, hughag...@gmail.com wrote:
> I think that the Forth-200x committee

Anyone, not just the committee, can start with an RfD.

Of this matter, nobody has gone that far.

> Here is an example from my document:
>
> list
> d field .name$ \ employee name
> d field .salary \ salary per year in dollars
> c field .female? \ flag indicating gender
> constant employee
>
> : count-females local{ employee-head | cnt -- females }
> \ EMPLOYEE-HEAD is the head of a LIST linked list
> employee-head @ { .female? c@ cnt +! } each
> cnt @ ;

With 'fake' quotations:

: count-females ( -- u )
0 [: female? c@ + ;] each-employee ;

This could also be written:

: (count-females) ( u -- u' ) female? c@ + ;
: count-females ( -- ) 0 ['] (count-females) each-employee ;

> Notice that we are iterating through a linked list. But where is the BEGIN WHILE REPEAT loop??? It is hidden inside of the EACH higher-order function!

Higher-order programming is great and all, but it doesn't require
quotations, so selling it won't necessarily sell someone on
quotations.

Julian Fondren

unread,
Jul 13, 2015, 11:24:23 PM7/13/15
to
On Sunday, July 12, 2015 at 12:14:13 PM UTC-5, Coos Haak wrote:
> This allows EXECUTE:
> : [: POSTPONE 0 POSTPONE IF HERE 'QUIT @ , HERE CELL+ ; IMMEDIATE
> : ;] >R POSTPONE EXIT POSTPONE THEN R> POSTPONE LITERAL ; IMMEDIATE

Thanks! I noted that there should be a comma at the end of [:

: [: POSTPONE 0 POSTPONE IF HERE 'QUIT @ , HERE CELL+ , ; IMMEDIATE

hughag...@gmail.com

unread,
Jul 13, 2015, 11:49:19 PM7/13/15
to
On Monday, July 13, 2015 at 8:19:51 PM UTC-7, Julian Fondren wrote:
> On Monday, July 13, 2015 at 8:51:44 PM UTC-5, hughag...@gmail.com wrote:
> > I think that the Forth-200x committee
>
> Anyone, not just the committee, can start with an RfD.

I can't.

Nobody can write an RfD unless they are a brown-noser --- ultimately, Leon Wagner decides what is in Forth-200x --- the whole business with the RfDs is just astro-turfing (an effort to make Forth-200x appear to be a grassroots movement when it is actually owned entirely by Forth Inc.).

> Of this matter, nobody has gone that far.

See above --- they are just brown-nosers --- they aren't going to do anything unless they can be sure ahead of time that Leon Wagner will approve.

> > Here is an example from my document:
> >
> > list
> > d field .name$ \ employee name
> > d field .salary \ salary per year in dollars
> > c field .female? \ flag indicating gender
> > constant employee
> >
> > : count-females local{ employee-head | cnt -- females }
> > \ EMPLOYEE-HEAD is the head of a LIST linked list
> > employee-head @ { .female? c@ cnt +! } each
> > cnt @ ;
>
> With 'fake' quotations:
>
> : count-females ( -- u )
> 0 [: female? c@ + ;] each-employee ;
>
> This could also be written:
>
> : (count-females) ( u -- u' ) female? c@ + ;
> : count-females ( -- ) 0 ['] (count-females) each-employee ;

What you have here (the second version) is essentially the same thing that I've been doing in the novice-package for years with EACH etc..

This works in simple cases, but it has problems:
1.) It is inefficient to push all the internal data to the return-stack before the EXECUTE and then pull it off again after the EXECUTE. Because this is done inside of a loop, the inefficiency hits hard.
2.) You get a lot of stack-juggling in your quotation when there is more than one datum in the parent function that needs to be accessed --- this is both inefficient and error-prone --- once again, inside of a loop so it hits hard.

Note that pushing all of the internal data to the return-stack before the EXECUTE is problematic because the xt is either on the return-stack in which case it gets buried, or it is on the data-stack in which case it is in the way of the data that you want to push (so you end up with a lot of stack-juggling). I solved this problem (in the bar-feature higher-order functions such as |EACH but not EACH) in the FMITE by holding the xt in a register while I did my pushing of data to the return-stack, and then executing that register --- this is much more efficient and clean.

What you showed me above as Forth-200x code is almost exactly the same as what I've been doing for years in the novice-package. That is actually quite funny, as everybody has been denouncing the novice-package as "crap" since in came out, and now you are using the same technique that my novice-package is based on. Anyway, I'm leaving fake-quotations behind me now --- I have real quotations in the FMITE.

Raimond Dragomir

unread,
Jul 14, 2015, 12:44:14 AM7/14/15
to
>
> With 'fake' quotations:
>
> : count-females ( -- u )
> 0 [: female? c@ + ;] each-employee ;

You are missing the point here. I don't want to write each-employee, each-tomato,
each-potato every time. All I want is a EACH.
Probably you can re-write your example.

>
> This could also be written:
>
> : (count-females) ( u -- u' ) female? c@ + ;
> : count-females ( -- ) 0 ['] (count-females) each-employee ;
>

This is a classical example already of how a quotation can be substituted
by a named definition. Almost always with a forced name, hard to document
(it is decoupled from the main logic which is in the parent) and in the
main logic you need the tick. Not to say that all you have is the data
stack for comunicating with the parent logic and this is ok only for
trivial examples.

Julian Fondren

unread,
Jul 14, 2015, 12:48:03 AM7/14/15
to
On Monday, July 13, 2015 at 10:49:19 PM UTC-5, hughag...@gmail.com wrote:
> On Monday, July 13, 2015 at 8:19:51 PM UTC-7, Julian Fondren wrote:
> > This could also be written:
> >
> > : (count-females) ( u -- u' ) female? c@ + ;
> > : count-females ( -- ) 0 ['] (count-females) each-employee ;
>
> This works in simple cases, but it has problems:
> 1.) It is inefficient to push all the internal data to the return-stack before the EXECUTE and then pull it off again after the EXECUTE. Because this is done inside of a loop, the inefficiency hits hard.
> 2.) You get a lot of stack-juggling in your quotation when there is more than one datum in the parent function that needs to be accessed --- this is both inefficient and error-prone --- once again, inside of a loop so it hits hard.

This sounds like: Forth is inefficient! You're always having to
provide, on a stack, what other words expect, and they just pop them
right back off the stack and do something with them. Forth has a lot
of stack juggling! Especially when there's more than one thing to
access. Lots of stack juggling is inefficient and error-prone. Even
inner loops have stack operations!

I'm already using Forth, though. So I already know about stack
juggling. I just imagine that I might in the future want to expose
some registers for higher-order state (ARM and x86_64 both have 16
general purpose registers; it's worth thinking about some uses for
them), or that I might want a SUB-EXECUTE that more efficiently stashes
state around an EXECUTE. There's also the option of expanding the
higher-order code into its callers, and optimizing stack usage in the
combined code.

It'd be a different story if the minor discipline of maintaining a
clean data stack were *less* efficient than some clear or existing
alternative for existing Forths that run on existing hardware. You
keep linking to a document titled "the [NAME] micro-processor", which
doesn't *look* much like a report on your cool new way of doing higher
order programming.

hughag...@gmail.com

unread,
Jul 14, 2015, 12:53:33 AM7/14/15
to
On Monday, July 13, 2015 at 9:44:14 PM UTC-7, Raimond Dragomir wrote:
> >
> > With 'fake' quotations:
> >
> > : count-females ( -- u )
> > 0 [: female? c@ + ;] each-employee ;
>
> You are missing the point here. I don't want to write each-employee, each-tomato,
> each-potato every time. All I want is a EACH.
> Probably you can re-write your example.

I noticed that too, but didn't mention it.

Most likely Julien doesn't get the concept of inheritance --- every class (such as EMPLOYEE in my example) that is defined with LIST as its parent class inherits all of the functionality provided for LIST --- this includes EACH FIND-NODE FIND-PRIOR etc..

This is somewhat beside the point that we are discussing however (quotations), which is why I didn't bother mentioning it.

> > This could also be written:
> >
> > : (count-females) ( u -- u' ) female? c@ + ;
> > : count-females ( -- ) 0 ['] (count-females) each-employee ;
> >
>
> This is a classical example already of how a quotation can be substituted
> by a named definition. Almost always with a forced name, hard to document
> (it is decoupled from the main logic which is in the parent) and in the
> main logic you need the tick. Not to say that all you have is the data
> stack for comunicating with the parent logic and this is ok only for
> trivial examples.

You have understood the concept! Good job!

The fact that one person has understood my document, makes me feel confident that my document is understandable. :-)

Julian Fondren

unread,
Jul 14, 2015, 1:04:17 AM7/14/15
to
On Monday, July 13, 2015 at 11:44:14 PM UTC-5, Raimond Dragomir wrote:
> >
> > With 'fake' quotations:
> >
> > : count-females ( -- u )
> > 0 [: female? c@ + ;] each-employee ;
>
> You are missing the point here. I don't want to write each-employee, each-tomato,
> each-potato every time. All I want is a EACH.

The point here is the quotation and how it communicates with the
higher order word. The higher-order word is EACH-EMPLOYEE because
this code is excerpted from a larger body where I just whipped up a
linked list from a VARIABLE and the specific list operations that I
needed.

More of it, for fun:

: female ( -- ) employees @ cell+ >o 1 female? c! o> ;

"Bob" 64 hire
"Bobby" 70 hire
"McBob" 50 hire
"Bobette" 45 hire female
"Bobberson" 40 hire
"Bobina" 45 hire female

> Probably you can re-write your example.

Probably?

: count-females ( -- u )
0 [: female? c@ + ;] employees each ;

> Not to say that all you have is the data
> stack for comunicating with the parent logic and this is ok only for
> trivial examples.

Two words, in Forth, only have the data stack with which to
communicate. And this is OK only for trivial examples.


Sorry, I don't quite follow. Can you provide a non-trivial example?

Paul Rubin

unread,
Jul 14, 2015, 1:05:31 AM7/14/15
to
Mark Wills <markwi...@gmail.com> writes:
> I'm struggling to see the advantage of:
> : foo some code [: bar ;] more code execute ; ...
> It's just a different way of factoring. Can someone give me an example
> of something that can only be done using quotations?

The usefulness is when you pass the quotation to something that takes an
xt as an arg. Of course without quotations you could make another named
word and quote it to make the xt. It's just convenience.

0.001e fconstant h
\ (D f)(x) = (f(x+h) - f(x)) / h
: derivative {: func F:x :}
x h f+ func execute x func execute f- h f/ ;

: square ( f -- f ) fdup f* ;

' square 3e derivative \ prints approx derivative of x^2 at x=3

[: fdup f* ;] 3e derivative \ same thing without making an extra word

It doesn't seem that important for Forth but it is a main idiom of
functional programming. If you're interested in that topic, this is
a good paper:

http://www.cs.kent.ac.uk/people/staff/dat/miranda/whyfp90.pdf

Coos Haak

unread,
Jul 14, 2015, 3:52:03 AM7/14/15
to
Op Mon, 13 Jul 2015 20:24:22 -0700 (PDT) schreef Julian Fondren:
My bad, I typed the source into the newsreader instead of copying
and pasting the working code.

groet Coos

humptydumpty

unread,
Jul 14, 2015, 4:22:40 AM7/14/15
to
Hi!
Macros way:

: ]each
] 2>R
]] begin dup while dup [[
2R> evaluate
]] .fore @ repeat drop [[
; immediate

: count-females local{ employee-head | cnt -- females }
\ EMPLOYEE-HEAD is the head of a LIST linked list
employee-head @ [ S" .female? c@ cnt +!" ]each
cnt @ ;


Have a nice day,
humptydumpty

Alex McDonald

unread,
Jul 14, 2015, 4:31:57 AM7/14/15
to
on 14/07/2015 00:03:10, "Elizabeth D. Rather" wrote:
> On 7/13/15 12:13 PM, Alex McDonald wrote:
>> on 13/07/2015 22:24:48, Mark Wills wrote:
>>> I'm struggling to see the advantage of:
>>>
>>> : foo some code [: bar ;] more code execute ;
>>>
>>> against
>>>
>>> : foo some code more code bar ;
>>>
>>> It's just a different way of factoring. Can someone give me an example
>>> of something that can only be done using quotations?
>>>
>>
>> No, since they are just nameless words.
>>
>> wordlist constant wid
>>
>> : count-words 0 [: drop 1+ true ;] wid traverse-wordlist ;
>>
>> : (count-words) drop 1+ true ;
>> : count-words 0 (count-words) wid traverse-wordlist ;
>>
>> I think the former is clearest.
>
> Do you mean ... ['] (count-words) wid traverse-wordlist ?

Yes; typo. Tahnks.

>
> In any case, I find the conventional one clearest. Particularly since
> I could reference (count-words) in testing (e.g., see (countwords) or
> locate (countwords) etc.).

YMMV, as in this case it does.

>
> Cheers,
> Elizabeth
>

Alex McDonald

unread,
Jul 14, 2015, 4:35:47 AM7/14/15
to
on 14/07/2015 02:51:38, wrote:
> On Monday, July 13, 2015 at 2:24:20 PM UTC-7, Mark Wills wrote:
>> I'm struggling to see the advantage of:
>>
>> : foo some code [: bar ;] more code execute ;
>>
>> against
>>
>> : foo some code more code bar ;
>>
>> It's just a different way of factoring.
>
> You can struggle mightily and never see the advantage in the former
> --- bec ause it is nonsense.
>
> I think that the Forth-200x committee gave us fake quotations (and
> your "bo nkers simple" implementation was fake too) for the purpose of
> confusing peo ple who don't know what quotations are. Their plan was
> that they would tell everybody: "These are quotations!" Then everybody
> would would say: "Quotat ions are useless!" Then they would say: "Well
> yes, quotations are useless, but we gave them to you because Hugh was
> asking for them --- so blame him!"

Please provide a definition of quotations (or an RfD; I don't mind either
way) so the rest of us human mortals can work out why our implementations
are fakes, and how we might rectify that.


Alex McDonald

unread,
Jul 14, 2015, 4:38:49 AM7/14/15
to
on 14/07/2015 04:49:17, wrote:
> On Monday, July 13, 2015 at 8:19:51 PM UTC-7, Julian Fondren wrote:
>> On Monday, July 13, 2015 at 8:51:44 PM UTC-5, hughag...@gmail.com wrote:
>> > I think that the Forth-200x committee
>>
>> Anyone, not just the committee, can start with an RfD.
>
> I can't.

You can.

humptydumpty

unread,
Jul 14, 2015, 4:47:50 AM7/14/15
to
Maybe a better version, which shows a balanced stack before-after loop :

: ]each
] 2>R
]] begin dup while dup [[
2R> evaluate
]] .fore @ repeat [[
; immediate

: count-females local{ employee-head | cnt -- females }
\ EMPLOYEE-HEAD is the head of a LIST linked list
employee-head @ [ S" .female? c@ cnt +!" ]each drop

Mark Wills

unread,
Jul 14, 2015, 5:17:48 AM7/14/15
to
Yeah! In what way is my implementation fake? I don't get it. It seems
to satisfy all the requirements, as far as I can tell.

humptydumpty

unread,
Jul 14, 2015, 5:24:05 AM7/14/15
to
Hi!

It looks like a reply to Hugh.

Mark Wills

unread,
Jul 14, 2015, 5:25:14 AM7/14/15
to
On Tuesday, 14 July 2015 02:51:44 UTC+1, hughag...@gmail.com wrote:
> On Monday, July 13, 2015 at 2:24:20 PM UTC-7, Mark Wills wrote:
> > I'm struggling to see the advantage of:
> >
> > : foo some code [: bar ;] more code execute ;
> >
> > against
> >
> > : foo some code more code bar ;
> >
> > It's just a different way of factoring.
>
> You can struggle mightily and never see the advantage in the former --- because it is nonsense.
>
> I think that the Forth-200x committee gave us fake quotations (and your "bonkers simple" implementation was fake too) [snip]

Ouch! How is it fake? It seems to work as far as I can tell. And the
quotation has access to the enclosing definition's locals.

I'm not seeing where it's wrong?

hughag...@gmail.com

unread,
Jul 14, 2015, 12:32:45 PM7/14/15
to
Oh, come on Mark! This is not that difficult!

You have to pass the xt of the quotation into another function (the "higher-order" function) and that function will EXECUTE the quotation --- when the quotation executes, it has access to the local variables of its parent function (the function that called the higher-order function and which is still in scope waiting for the the higher-order function to exit).

Go back to that example I gave you. COUNT-FEMALES is the parent function (what you called "enclosing definition" above). The quotation is defined with curly brackets. EACH is the higher-order function. EACH has a BEGIN WHILE REPEAT loop that traverses the list, and it does an EXECUTE on the xt of the quotation for each node, giving the address of the node to the quotation as a parameter. Notice how the quotation accesses the CNT local variable of the COUNT-FEMALES function when it is executed inside of the EACH function?

Explaining this basic stuff over and over is becoming tiresome --- just think about it a little bit! --- this is easy and obvious.

Alex McDonald

unread,
Jul 14, 2015, 12:50:35 PM7/14/15
to
on 14/07/2015 17:32:47, wrote:
> On Tuesday, July 14, 2015 at 2:25:14 AM UTC-7, Mark Wills wrote:
>> On Tuesday, 14 July 2015 02:51:44 UTC+1, hughag...@gmail.com wrote:
>> > On Monday, July 13, 2015 at 2:24:20 PM UTC-7, Mark Wills wrote:
>> > > I'm struggling to see the advantage of:
>> > >
>> > > : foo some code [: bar ;] more code execute ;
>> > >
>> > > against
>> > >
>> > > : foo some code more code bar ;
>> > >
>> > > It's just a different way of factoring.
>> >
>> > You can struggle mightily and never see the advantage in the former ---
> because it is nonsense.
>> >
>> > I think that the Forth-200x committee gave us fake quotations (and your
> "bonkers simple" implementation was fake too) [snip]
>>
>> Ouch! How is it fake? It seems to work as far as I can tell. And the
>> quotation has access to the enclosing definition's locals.
>>
>> I'm not seeing where it's wrong?
>
> Oh, come on Mark! This is not that difficult!
>
> You have to pass the xt of the quotation into another function (the
> "higher -order" function) and that function will EXECUTE the quotation
> --- when the quotation executes, it has access to the local variables
> of its parent fun ction (the function that called the higher-order
> function and which is stil l in scope waiting for the the higher-order
> function to exit).
>
> Go back to that example I gave you. COUNT-FEMALES is the parent
> function (w hat you called "enclosing definition" above). The
> quotation is defined with curly brackets. EACH is the higher-order
> function. EACH has a BEGIN WHILE REPEAT loop that traverses the list,
> and it does an EXECUTE on the xt of th e quotation for each node,
> giving the address of the node to the quotation as a parameter. Notice
> how the quotation accesses the CNT local variable of the COUNT-FEMALES
> function when it is executed inside of the EACH function ?
>
> Explaining this basic stuff over and over is becoming tiresome ---
> just thi nk about it a little bit! --- this is easy and obvious.
>

Asking for an explanation is becoming a bit tedious too. All you've done
here is explain how any XT -- quotation, :NONAME, or tick of a named word
-- can be used in one specific kind of higher order function.

Mark Wills

unread,
Jul 14, 2015, 12:53:59 PM7/14/15
to
Yes. I understand that. What I don't understand is what is fake about my implementation. Perhaps you were being tongue-in-cheek. It seems a valid implementation to me.

hughag...@gmail.com

unread,
Jul 14, 2015, 12:56:08 PM7/14/15
to
On Tuesday, July 14, 2015 at 1:22:40 AM UTC-7, humptydumpty wrote:
> marți, 14 iulie 2015, 04:51:44 UTC+3, hughag...@gmail.com a scris:
> > list
> > d field .name$ \ employee name
> > d field .salary \ salary per year in dollars
> > c field .female? \ flag indicating gender
> > constant employee
> >
> > : count-females local{ employee-head | cnt -- females }
> > \ EMPLOYEE-HEAD is the head of a LIST linked list
> > employee-head @ { .female? c@ cnt +! } each
> > cnt @ ;
> >
> > Notice that we are iterating through a linked list. But where is the BEGIN WHILE REPEAT loop??? It is hidden inside of the EACH higher-order function!
> >
> > It is better to hide this iteration code inside of the higher-order function rather than paste it into the application code:
> >
> > : count-females local{ employee-head | cnt -- females }
> > \ EMPLOYEE-HEAD is the head of a LIST linked list
> > employee-head @ begin dup while
> > dup .female? c@ cnt +! \ flags in LOTD are 1 for TRUE or 0 for FALSE
> > .fore @ repeat drop \ the .FORE field is hidden in the LIST struct
> > cnt @ ;

> Hi!
> Macros way:
>
> : ]each
> ] 2>R
> ]] begin dup while dup [[
> 2R> evaluate
> ]] .fore @ repeat drop [[
> ; immediate
>
> : count-females local{ employee-head | cnt -- females }
> \ EMPLOYEE-HEAD is the head of a LIST linked list
> employee-head @ [ S" .female? c@ cnt +!" ]each
> cnt @ ;
>
>
> Have a nice day,
> humptydumpty

That ]] [[ is ugly. Use MACRO: instead.

I have this in the novice package:

macro: next>r ( node -- node ) \ r: -- next-node
dup .fore @ >r ;

macro: each[ \ toucher: i*x node -- j*x
begin dup while
next>r ;

macro: ]each
r> repeat drop ;

I also have these comments:

\ EACH[...]EACH uses the return stack. This can create havoc in functions that use locals or use >R and R>.

The reason why I push the internal data onto the return-stack is because I want the code inside to have access to the data-stack. In my FMITE document I call this a bar-feature higher-order function. You aren't doing that, so your code must use local variables.

\ FIND-NODE and FIND-PRIOR can't be written like this because they both involve an early-out.

This really kills the macro technique. The macro technique only works when you traverse all the way through the entire data-structure, rather than stop when you have found a node that meets some criteria.

Another problem with the macro technique is that the code you are generating can be quite bulky. A self-balancing tree, for example, is much more complicated than a linked list. You don't really want to generate all of this code in the middle of your application program functions, as this may be done dozens of times. There is very little speed advantage.

I had EACH[ ... ]EACH in the novice package years ago (all of this stuff was written in 2009 and 2010). I thought that it was funny earlier to see Julien presenting my old techniques as Forth-200x code, with the assumption that I was being educated on ideas that I hadn't thought of --- now you're doing it, and it is starting to become less funny and rather annoying...

hughag...@gmail.com

unread,
Jul 14, 2015, 1:12:14 PM7/14/15
to
On Tuesday, July 14, 2015 at 9:53:59 AM UTC-7, Mark Wills wrote:
> Yes. I understand that. What I don't understand is what is fake about my implementation. Perhaps you were being tongue-in-cheek. It seems a valid implementation to me.

I'm never tongue-in-cheek.

On Monday, July 13, 2015 at 9:26:47 AM UTC-7, Mark Wills wrote:
> They get access to locals 'for free' (as in, no code required):
> : test
> locals{ fred }
> 99 set fred \ load fred with 99
> [: fred 1+ ;] execute .
> ;
> test
> 100 ok:0

You did your EXECUTE inside of the parent function --- the idea is to pass the quotation's xt into another function (the higher-order function) and do the EXECUTE there --- by that time the local-frame on the return-stack is buried under the return-address of the CALL and also under the local-frame of the higher-order function, so it is no longer accessible when the quotation executes.

The only way that this is going to work is if you are holding your local variables in registers rather than in a local-frame on the return-stack, and those registers have never been over-written by the time that your quotation executes.

Try having TEST call another function and pass the quotation xt into that function, then that function executes the xt --- it is meaningless to execute the xt inside of the TEST function!

Julian Fondren

unread,
Jul 14, 2015, 1:45:19 PM7/14/15
to
On Tuesday, July 14, 2015 at 11:56:08 AM UTC-5, hughag...@gmail.com wrote:
> That ]] [[ is ugly. Use MACRO: instead.

The advantages of ]] [[ over MACRO: are:

1. you can use them multiple times in a word.

2. they do not POSTPONE an EVALUATE , as MACRO: does. So to understand
a word using ]] [[ you need only know the state of the dictionary (and
the current order and BASE et al.) at the time that word is defined.
With MACRO: you must also think of the state of the dictionary whenever
that word is used.

> \ FIND-NODE and FIND-PRIOR can't be written like this because they both involve an early-out.

So use a word particular to leaving that construct , rather than EXIT
(c.f. DO ... LOOP and LEAVE )

> This really kills the macro technique. The macro technique only works when you traverse all the way through the entire data-structure, rather than stop when you have found a node that meets some criteria.

Or have the inner code accept a flag letting it know if it should
continue (c.f. BEGIN ... UNTIL )

> Another problem with the macro technique is that the code you are generating can be quite bulky. A self-balancing tree, for example, is much more complicated than a linked list. You don't really want to generate all of this code in the middle of your application program functions, as this may be done dozens of times. There is very little speed advantage.

And all of that code needs to be inline? Macros can't also use words
that do a lot of the work?

> I had EACH[ ... ]EACH in the novice package years ago (all of this stuff was written in 2009 and 2010).

Put something about murder being bad in there. Then, in a few years,
when someone is offhandedly speaking against murder, you can get
huffy and say, "who do you think you're talking to? I *invented*
murder being bad! All this stuff you're saying now was written in
my novice package back in 2015!"

hughag...@gmail.com

unread,
Jul 14, 2015, 1:48:42 PM7/14/15
to
On Tuesday, July 14, 2015 at 9:50:35 AM UTC-7, Alex McDonald wrote:
> on 14/07/2015 17:32:47, wrote:
> > Notice
> > how the quotation accesses the CNT local variable of the COUNT-FEMALES
> > function when it is executed inside of the EACH function ?
>
> All you've done
> here is explain how any XT -- quotation, :NONAME, or tick of a named word
> -- can be used in one specific kind of higher order function.

Alex McDonald is a liar --- he is purposely ignoring the fact that my quotations have access to the parent functions local variables (the CNT local in this example) when they are executed inside of the higher-order function.

This is the same lie that he was telling in this thread:
https://groups.google.com/forum/#!topic/comp.lang.forth/C_NDoMSUAx0%5B76-100%5D

On Sunday, July 5, 2015 at 7:57:51 PM UTC-7, hughag...@gmail.com wrote:
> On Sunday, July 5, 2015 at 2:36:05 AM UTC-7, Alex McDonald wrote:
> > Then, as Hugh complains about Bernd's "faked quotations", his FMITE is no
> > more than :NONAME syntactic sugar. Perhaps worse, as from what I read
> > there the language does not permit use of the quotation outside of its
> > enclosing word.
>
> Alex McDonald is lying --- as usual.

Alex just tells the same lie over and over again, in the hope that somebody will eventually believe it. If he gets caught lying (he always does), he just waits a few days and then tells the same lie again.

The reason why he does this is that he knows that so long as he is supporting Forth-200x, the Forth-200x committee will support him.

> Please provide a definition of quotations (or an RfD; I don't mind either
> way) so the rest of us human mortals can work out why our implementations
> are fakes, and how we might rectify that.

My FMITE is not compatible with ANS-Forth or Forth-200x, hence it is not a suitable topic for a Forth-200x RfD. It is absurd that you suggest that I care about Forth-200x and want to participate in Forth-200x --- you are out of touche with reality.

When I was interested in Forth-200x, I was told that any RfD has to be put on comp.lang.forth to get feedback from the "Forth community." In practice, what this meant was John Passaniti telling a lot of lies about it, and twisting the words, and flaming me with vulgar insults until I eventually gave up. Now you have taken Passaniti's place as the Forth-200x attack-poodle. Those RfDs are a waste of time --- they just result in me getting attacked by faggots --- ultimately, Leon Wagner will decide what gets put in Forth-200x, and the "Forth community" be damned.

I still think that Passaniti was getting paid by Elizabeth Rather. After Jeff Fox died, Passaniti stopped showing up on comp.lang.forth. Obviously, he never had any interest in Forth (he never wrote any Forth code or showed any knowledge of Forth) --- his only interest was in insulting Jeff Fox, and after Jeff Fox died he had no further interest in comp.lang.forth. Why would Passaniti particularly care about Jeff Fox though? If he just enjoyed insulting people, he would have continued insulting myself or various other people after Jeff Fox died. The explanation seems to be that it was Elizabeth Rather who cared about having Jeff Fox insulted, and that Passaniti only cared about getting paid --- after Jeff Fox died, Elizabeth Rather stopped paying Passaniti, and so he stopped showing up.

Now we have Alex McDonald replacing John Passaniti and claiming that he "does standards for a living" --- Jeff Fox is dead, so Alex focuses on lying about me --- comp.lang.forth corruption just goes on and on forever...

P.S. for Elizabeth Rather: I used the word "faggot" above, so this is your cue to denounce me for being homophobic (again).

Raimond Dragomir

unread,
Jul 14, 2015, 1:53:29 PM7/14/15
to
Here is an example.
First, your example:

def test { | fred } 99 fred ! [ fred @ 1+ ] execute . ;
ok
test
100 ok

Hugh is right, you don't write a quotation just to execute it immediately
by execute. This is just as you write the code directly, no need for a
quotation.

A quotation is usefull if it can be passed as an argument for a higher
order function. Here, we execute the quotation 10 times:

def test { | fred } 99 fred ! 10 [ 1 fred +! ] times fred @ . ;
test reDef
ok
test
109 ok

See how the quotation incremented the parent local every time.
times is a higher order function. If you wonder how it's written, here it is:

def times >r for r> r@ execute >r next r> drop ;

Note the execute inside a loop.

Alex McDonald

unread,
Jul 14, 2015, 1:59:21 PM7/14/15
to
on 14/07/2015 18:48:40, wrote:
> On Tuesday, July 14, 2015 at 9:50:35 AM UTC-7, Alex McDonald wrote:
>> on 14/07/2015 17:32:47, wrote:
>> > Notice
>> > how the quotation accesses the CNT local variable of the COUNT-FEMALES
>> > function when it is executed inside of the EACH function ?
>>
>> All you've done
>> here is explain how any XT -- quotation, :NONAME, or tick of a named word
>> -- can be used in one specific kind of higher order function.
>
> Alex McDonald is a liar --- he is purposely ignoring the fact that my
> quota tions have access to the parent functions local variables (the
> CNT local in this example) when they are executed inside of the
> higher-order function.
>
> This is the same lie that he was telling in this thread:
> https://groups.google.com/forum/#!topic/comp.lang.forth/C_NDoMSUAx0%5B76-10
> 0%5D
>
> On Sunday, July 5, 2015 at 7:57:51 PM UTC-7, hughag...@gmail.com
> > wrote:
>> On Sunday, July 5, 2015 at 2:36:05 AM UTC-7, Alex McDonald wrote:
> > wrote:
>> > Then, as Hugh complains about Bernd's "faked quotations", his FMITE is
> wrote: no
>> > more than :NONAME syntactic sugar. Perhaps worse, as from what I read
>> > there the language does not permit use of the quotation outside of its
>> > enclosing word.
>>
>> Alex McDonald is lying --- as usual.
>
> Alex just tells the same lie over and over again, in the hope that
> somebody will eventually believe it. If he gets caught lying (he
> always does), he j ust waits a few days and then tells the same lie
> again.
>
> The reason why he does this is that he knows that so long as he is
> supporti ng Forth-200x, the Forth-200x committee will support him.
>
>> Please provide a definition of quotations (or an RfD; I don't mind either
>> way) so the rest of us human mortals can work out why our implementations
>> are fakes, and how we might rectify that.
>
> My FMITE is not compatible with ANS-Forth or Forth-200x, hence it is
> not a suitable topic for a Forth-200x RfD. It is absurd that you
> suggest that I c are about Forth-200x and want to participate in
> Forth-200x --- you are out of touche with reality.
>
> When I was interested in Forth-200x, I was told that any RfD has to be
> put on comp.lang.forth to get feedback from the "Forth community." In
> practice, what this meant was John Passaniti telling a lot of lies
> about it, and twi sting the words, and flaming me with vulgar insults
> until I eventually gave up. Now you have taken Passaniti's place as
> the Forth-200x attack-poodle. Those RfDs are a waste of time --- they
> just result in me getting attacked by faggots --- ultimately, Leon
> Wagner will decide what gets put in Forth-2 00x, and the "Forth
> community" be damned.
>
> I still think that Passaniti was getting paid by Elizabeth Rather.
> After Je ff Fox died, Passaniti stopped showing up on comp.lang.forth.
> Obviously, he never had any interest in Forth (he never wrote any
> Forth code or showed a ny knowledge of Forth) --- his only interest
> was in insulting Jeff Fox, and after Jeff Fox died he had no further
> interest in comp.lang.forth. Why wou ld Passaniti particularly care
> about Jeff Fox though? If he just enjoyed in sulting people, he would
> have continued insulting myself or various other p eople after Jeff
> Fox died. The explanation seems to be that it was Elizabet h Rather
> who cared about having Jeff Fox insulted, and that Passaniti only
> cared about getting paid --- after Jeff Fox died, Elizabeth Rather
> stopped paying Passaniti, and so he stopped showing up.
>
> Now we have Alex McDonald replacing John Passaniti and claiming that
> he "do es standards for a living" --- Jeff Fox is dead, so Alex
> focuses on lying a bout me --- comp.lang.forth corruption just goes on
> and on forever...
>
> P.S. for Elizabeth Rather: I used the word "faggot" above, so this is
> your cue to denounce me for being homophobic (again).
>

Right, got it. You're full of shit.

humptydumpty

unread,
Jul 14, 2015, 2:10:44 PM7/14/15
to
Hi!

>
> \ FIND-NODE and FIND-PRIOR can't be written like this because they both involve an early-out.
>
> This really kills the macro technique. The macro technique only works when you traverse all the way through the entire data-structure, rather than stop when you have found a node that meets some criteria.
>

It's not problem, add a WHILE .. THEN:

: ]each
] 2>R
]] begin dup while [[
2R> evaluate
]] .fore @ repeat [[
; immediate

: count-females local{ employee-head | cnt -- females }
\ EMPLOYEE-HEAD is the head of a LIST linked list
employee-head @ [ S" dup test-node? WHILE dup .female? c@ cnt +!" ]each THEN drop
cnt @ ;

Of course a node should be on top-of stack. What else is 'employee-head @'
if not first node. And as in a loop, stack should be preserved&balanced,
common sense tells that current-node is on top. After loop undesirable
node is dropped.

> Another problem with the macro technique is that the code you are generating can be quite bulky. A self-balancing tree, for example, is much more complicated than a linked list. You don't really want to generate all of this code in the middle of your application program functions, as this may be done dozens of times. There is very little speed advantage.
>

Yes, could be bulky. But what i presented is an alternative, not a general
cure.

Håkan Thörngren

unread,
Jul 14, 2015, 2:38:15 PM7/14/15
to
On Tuesday, July 14, 2015 at 6:53:59 PM UTC+2, Mark Wills wrote:
> Yes. I understand that. What I don't understand is what is fake about my implementation. Perhaps you were being tongue-in-cheek. It seems a valid implementation to me.

Nothing seems wrong with your implementation, but it depends on how you want it to behave.

What happens if you add a new binding with the same name?

: BAR
locals{ fred }
EXECUTE
;

: test
locals{ fred }
99 set fred \ load fred with 99
[: fred 1+ ;] BAR .
;

Which fred will the quotation access?

Looking at the Forth-200x standard, it seems you should dynamically create locals to be visible in a dictionary search.

This is what the Lisp people call dynamic binding. The variable gets bound from the context where it is called. The alternative approach is lexical binding where the variable will get bound where it is defined.

With lexical binding you will always access the local 'fred' in test when running the quotation.

I prefer lexical binding as it feels more natural to me. I believe Hugh is doing lexical binding in his system, that by changing xt to be a pair of CFA and pointer to a locals record.

If I were to implement it, I would try to stay with a single xt token that can be EXECUTEd immediately. Then let a quotation which access locals of its containing word pay the
price. The containing word would in addition to setting up the locals record need to create a stub word to set up the locals base pointer before invoking the actual quotation.

Compiling a reference to a local would be a word that embeds an offset (like a lit), and it would just pick ut up and add it to the base pointer of the current locals record.

Using the xt of a quotation where the parent has gone out of scope would of course crash. That I think is an acceptable tradeoff in a stack language without any built in dynamic memory handling.

Alex McDonald

unread,
Jul 14, 2015, 2:58:50 PM7/14/15
to
on 14/07/2015 19:38:12, Håkan Thörngren wrote:
> On Tuesday, July 14, 2015 at 6:53:59 PM UTC+2, Mark Wills wrote:
>> Yes. I understand that. What I don't understand is what is fake about my implementation. Perhaps you were being tongue-in-cheek. It seems a valid implementation to me.
>
> Nothing seems wrong with your implementation, but it depends on how
> you want it to behave.
>
> What happens if you add a new binding with the same name?
>
>: BAR
> locals{ fred }
> EXECUTE
> ;
>
>: test
> locals{ fred }
> 99 set fred \ load fred with 99
> [: fred 1+ ;] BAR .
> ;
>
> Which fred will the quotation access?
>
> Looking at the Forth-200x standard, it seems you should dynamically
> create locals to be visible in a dictionary search.

The examples you give aren't ANS Forth, so it's impossible to tell.

Alex McDonald

unread,
Jul 14, 2015, 3:06:20 PM7/14/15
to
on 14/07/2015 18:53:25, Raimond Dragomir wrote:
> mar?i, 14 iulie 2015, 20:12:14 UTC+3, hughag...@gmail.com a scris:
>> On Tuesday, July 14, 2015 at 9:53:59 AM UTC-7, Mark Wills wrote:
>> > Yes. I understand that. What I don't understand is what is fake about m
> y implementation. Perhaps you were being tongue-in-cheek. It seems a
> valid implementation to me.
>>
>> I'm never tongue-in-cheek.
>>
>> On Monday, July 13, 2015 at 9:26:47 AM UTC-7, Mark Wills wrote:
>> > They get access to locals 'for free' (as in, no code required):
>> > : test
>> > locals{ fred }
>> > 99 set fred \ load fred with 99
>> > [: fred 1+ ;] execute .
>> > ;
>> > test
>> > 100 ok:0
>>
>> You did your EXECUTE inside of the parent function --- the idea is to pas
> s the quotation's xt into another function (the higher-order function)
> and do the EXECUTE there --- by that time the local-frame on the
> return-stack is buried under the return-address of the CALL and also
> under the local-fra me of the higher-order function, so it is no
> longer accessible when the quo tation executes.
>>
>> The only way that this is going to work is if you are holding your local
> variables in registers rather than in a local-frame on the
> return-stack, an d those registers have never been over-written by the
> time that your quotat ion executes.
>>
>> Try having TEST call another function and pass the quotation xt into that
> function, then that function executes the xt --- it is meaningless to
> exec ute the xt inside of the TEST function!
>
> Here is an example.
> First, your example:
>
> def test { | fred } 99 fred ! [ fred @ 1+ ] execute . ;
> ok
> test
> 100 ok
>
> Hugh is right, you don't write a quotation just to execute it
> immediately by execute. This is just as you write the code directly,
> no need for a quotation.
>
> A quotation is usefull if it can be passed as an argument for a higher
> order function. Here, we execute the quotation 10 times:
>
> def test { | fred } 99 fred ! 10 [ 1 fred +! ] times fred @ . ;
> test reDef
> ok
> test
> 109 ok
>
> See how the quotation incremented the parent local every time.
> times is a higher order function. If you wonder how it's written, here
> it i s:
>
> def times >r for r> r@ execute >r next r> drop ;
>
> Note the execute inside a loop.
>
>

Try this.

def atimes >r for r> r@ execute >r next r> drop ;
def btimes atimes ;
def ctimes btimes ;
def test { | fred } 99 fred ! 10 [ 1 fred +! ] ctimes fred @ . ;

What result do you get? I'm betting a return stack to a quotation it's
not 109.

Raimond Dragomir

unread,
Jul 14, 2015, 3:18:29 PM7/14/15
to
>
> Try this.
>
> def atimes >r for r> r@ execute >r next r> drop ;
> def btimes atimes ;
> def ctimes btimes ;
> def test { | fred } 99 fred ! 10 [ 1 fred +! ] ctimes fred @ . ;
>
> What result do you get? I'm betting a return stack to a quotation it's
> not 109.

ok
def atimes >r for r> r@ execute >r next r> drop ;
ok
def btimes atimes ;
ok
def ctimes btimes ;
ok
def test { | fred } 99 fred ! 10 [ 1 fred +! ] ctimes fred @ . ;
ok
test
109 ok

Alex McDonald

unread,
Jul 14, 2015, 3:49:24 PM7/14/15
to
To make up for my terse rudeness, here's something a bit longer.

The Emperor's New Quotations
============================

A Play in 3 Acts

Cast:

Hugh: the self proclaimed Emperor. Having once lived in the city of
UR-Forth, he is cast out by the evil Testra to drive the plains of nearby
Forth Colons. Has access to the internet, which he invented.

Crowd: a loose body of folks led by a monocled mad German scientist, an
Englishman who knows that the answer to the question "FUNEX?" is "S,VFX",
a Queen who witnessed the birth of Forth, and a number of other queens.
Other members include the entire Dutch nation, a couple of barking mad
'Murricans, a pitchfork wielding Scotsman and a few hundred lurkers.

WJ: Completely unhinged scribbler of Lisp poetry. Wonderfully gauche when
not scheming.

Rod: Lover of C, a venerable lady of great age quite past her prime.

Gavino: Forth master, known for his Zen-like questions. Only appears
during the interval.

Act 1
=====

Hugh: "Look! My quotations are the dog's doughnuts! Fall and worship at
my technical genius, you fakers and ANS Forth cultists! See how my FMITE
and novice package (everything invented by me, pats pending, copyrights
on lists etc) make all others look like amateurs!"

Crowd: "Hmm. Hw do quotations work Hugh? Can you explain?"

Hugh: "Yes! You are sodomite loving liars!"

Crowd: "Pardon?"

Hugh: "Jeff Fox!"

Crowd: "Eh?"

Hugh: "Elizabeth Rather pays for Leon Wagner to dominate Anton Ertl and
tell him what to do!"

Crowd: "We though this was about quotations..."

Rod: "Hugh, this is much easier in C."

Hugh: "Faggots!"

Crowd: "Hugh, your scheme for quotations in FMITE is a bag of nuts and
bolts that just won't work."

Hugh: "Mummy! Help, these big people are being nasty!" (exeunt stage left
pursued by crowd)

Act 2
=====

Hugh: "Look! I can iterate over lists with quotations! The temples of ANS
Forth shall crumble, and it's practitioners be cast destitute on the
streets!"

Crowd: "Have you tried an RfD?"

Hugh: "I can't! Leon Wagner, see Act 1 etc!"

WJ: I broke your
lines for you.
Anyone who knows
anything whatsoever
about usenet knows that he must
limit the length of his lines.

Let me demonstrate
your abysmal ignorance
thru the medium of Lisp poetry.

((It's pointless to listen)
(to Forth-worshippers) ((who are))
(((comfortable only) with stone-age) tools)

Crowd: (silence)

Act 3
=====

To be continued.




Alex McDonald

unread,
Jul 14, 2015, 3:52:22 PM7/14/15
to
Let me guess; locals are not on the return stack. Either in registers or
a separate area?

hughag...@gmail.com

unread,
Jul 14, 2015, 4:39:54 PM7/14/15
to
He's not going to tell you how his compiler works, because you have no purpose except to attack people. So go ahead and guess --- then present your guess as fact --- do what you always do.

The problem I see here is not really Alex McDonald, because trolls have always existed and always will. The problem is a failure of leadership in the Forth community. I think that the Forth-200x committee believe that trolls like Alex are useful so long as they attack people such as Raimond and myself and don't attack ANS-Forth and/or Forth-200x. They believe that they can stand aloof and dodge blame for all of this nastiness because they aren't posting the nastiness themselves, and have effectively kept their hands clean by using a proxy --- they aren't fooling anybody! --- everybody knows that Alex McDonald and John Passaniti are tools of the Forth-200x committee, and that the Forth-200x committee is the engine of corruption on comp.lang.forth.

I actually know how Raimond's compiler works, because he told me. He has some good ideas! There is no forum available to present ideas about Forth though. This is a big part of why Forth languishes unused --- over the years people who have had good ideas have been attacked and have withdrawn (it is like wrestling a pig; even if you win you end up covered in mud, and the pig enjoys it) --- as time goes by, only the bad ideas persist (ANS-Forth is the standard), and Forth gets a reputation for being a haven for people who don't know anything about programming but who still want to be programmers (or, like Elizabeth Rather, pretend to be programmers but never actually write any programs).

Mark Wills

unread,
Jul 14, 2015, 5:18:17 PM7/14/15
to
Thanks this is useful.

Alex McDonald

unread,
Jul 14, 2015, 5:20:31 PM7/14/15
to
on 14/07/2015 21:39:53, wrote:
> On Tuesday, July 14, 2015 at 12:52:22 PM UTC-7, Alex McDonald wrote:
>> on 14/07/2015 20:18:31, Raimond Dragomir wrote:
>> >>
>> >> Try this.
>> >>
>> >> def atimes >r for r> r@ execute >r next r> drop ;
>> >> def btimes atimes ;
>> >> def ctimes btimes ;
>> >> def test { | fred } 99 fred ! 10 [ 1 fred +! ] ctimes fred @ . ;
>> >>
>> >> What result do you get? I'm betting a return stack to a quotation it's
>> >> not 109.
>> >
>> > ok
>> > def atimes >r for r> r@ execute >r next r> drop ;
>> > ok
>> > def btimes atimes ;
>> > ok
>> > def ctimes btimes ;
>> > ok
>> > def test { | fred } 99 fred ! 10 [ 1 fred +! ] ctimes fred @ . ;
>> > ok
>> > test
>> > 109 ok
>
>> Let me guess; locals are not on the return stack. Either in registers or
>> a separate area?
>
> He's not going to tell you how his compiler works, because you have no
> purp ose except to attack people. So go ahead and guess --- then
> present your gu ess as fact --- do what you always do.
>
> The problem I see here is not really Alex McDonald, because trolls
> have alw ays existed and always will. The problem is a failure of
> leadership in the Forth community. I think that the Forth-200x
> committee believe that trolls like Alex are useful so long as they
> attack people such as Raimond and myse lf and don't attack ANS-Forth
> and/or Forth-200x. They believe that they can stand aloof and dodge
> blame for all of this nastiness because they aren't posting the
> nastiness themselves, and have effectively kept their hands cle an by
> using a proxy --- they aren't fooling anybody! --- everybody knows th
> at Alex McDonald and John Passaniti are tools of the Forth-200x
> committee, and that the Forth-200x committee is the engine of
> corruption on comp.lang. forth.
>
> I actually know how Raimond's compiler works, because he told me. He
> has so me good ideas! There is no forum available to present ideas
> about Forth tho ugh. This is a big part of why Forth languishes unused
> --- over the years p eople who have had good ideas have been attacked
> and have withdrawn (it is like wrestling a pig; even if you win you
> end up covered in mud, and the pi g enjoys it) --- as time goes by,
> only the bad ideas persist (ANS-Forth is the standard), and Forth gets
> a reputation for being a haven for people who don't know anything
> about programming but who still want to be programmers (or, like
> Elizabeth Rather, pretend to be programmers but never actually w rite
> any programs).
>

And? Where does this agenda get you? Or is this the start of Act 3?

Raimond Dragomir

unread,
Jul 15, 2015, 12:10:11 AM7/15/15
to
Wrong again. They are on the return stack. I don't have any separate area or
stack. My system has only data stack and return stack for the runtime. The
third stack is the control stack, only for compiler.

I have though a frame pointer for the locals. It is exactly what the C compiler
uses for its locals. Very simple.

Rod Pemberton

unread,
Jul 15, 2015, 12:52:13 AM7/15/15
to
On Tue, 14 Jul 2015 15:49:23 -0400, Alex McDonald <bl...@rivadpm.com> wrote:

> To make up for my terse rudeness, here's something a bit longer.

Long rudeness ...

> The Emperor's New Quotations
> ============================
>
> A Play in 3 Acts
>
> Cast:
>
> Hugh: the self proclaimed Emperor. Having once lived in the city of
> UR-Forth, he is cast out by the evil Testra to drive the plains of nearby
> Forth Colons. Has access to the internet, which he invented.

Hugh Aquilar.

What? You forgot the can't get a job programming, driving a taxi cab
for a living, his brother is a math god, etc.

> Crowd: a loose body of folks led by a monocled mad German scientist,

Bernd Paysan.

You forgot to add insane, arrogant, wrong-headed, random political
diatrabes, pro-Nazi beliefs, racist, anti-US hatred, anti-French bigotry,
supporter of Chinese communism, married a Chinese government spy, etc ...

> an Englishman who knows that the answer to the question "FUNEX?" is
> "S,VFX",

Stephen Pelc.
(or maybe Gerry Jackson)

> a Queen who witnessed the birth of Forth,

Ms. Rather.

> and a number of other queens.

So, _YOU_ get to criticize Hugh for being homphobic, while calling
others here homosexuals as an insult? WOW! WTF? ...

> Other members include the entire Dutch nation,

I'm not sure who is Dutch and isn't, but I take it you mean
these people:

Coos Haak.
Albert van der Horst.
Hans Bezemer.
Lars Brinkhoff.
...

> a couple of barking mad 'Murricans,

"Americans."

You listed me separately. So, I guess I'm not a barking mad American.
Note that you listed Hugh separately too ... If Hugh's not the key part
of the "barking mad 'Murrican" crowd and I'm not, who is? ...

I have to take issue with that though. The people here who *seem* to
be Americans to me based on verbiage also *seem* very sane except Hugh
or rickman. E.g., these people seem sane and seem to be American:
Mark Wills, Paul Rubin, Andrew Haley, JennyB, Ron Aaron, Julian Fondren,
Jason Damisch, Josh Grams, Richard Owlett, etc ... So, are you calling
them barking mad or just Hugh and rickman? I think the remainder of
the "barking mad 'Murricans" you refer to are actually Brits or U.K
residents ...

s/"a couple of barking mad 'Murricans"/"a bunch of drunk nutjob in the UK"/

> a pitchfork wielding Scotsman

I don't know who that is. Is that supposed to be you?

Hey, if you want to spend your time standing in the middle of a field
at night with a pitchfork while it's pouring rain holding a lantern,
like a creepy character in a horror movie, that's your business.

> and a few hundred lurkers.

Who cares?

> WJ: Completely unhinged scribbler of Lisp poetry.
> Wonderfully gauche when not scheming.

Well, he codes like John Passaniti, but it's Alex Wegel
who is emotionally messed up over past Passaniti issues.
It's likely JP is posting under multiple aliases ...
That would fit his psychopath personality type.

> Rod: Lover of C, a venerable lady of great age quite past her prime.

What? You mention me in regards to C, but not Paul Rubin?
Even Anton Ertl has to use C for gForth. Are you going to
bitch at Anton over that decision? ...

> Gavino: Forth master, known for his Zen-like questions.
> Only appears during the interval.

I take it "Forth Master" was deep tongue-in-cheek. You could've
said Mentifex where it might've been at least half true, but he
has no Zen-like questions.


Well, you clearly forgot some of the recurring characters.
I keep pointing out your memory issues, but you fail to listen.

Anton Ertl, Alex McDonald (you, unless you decided that you're
the wierd and creepy Scotsman...), rickman, Mentifex, and
apparently the entire Russian nation. Sort your replies
some time. It's not just a Dutch nation thing. Of course,
I see why you didn't mention rickman since he only discuesses
microprocessors and is otherwise ignored.

But, most importantly, how could you forget Anton Ertl?
Shouldn't he have been "King" to Ms. Rather's "Queen"?
And, were you conflating Dutch with Austrian? Seems so ...

So, I think you need to rework your post for some *exceptionally*
long rudeness this time.


Rod Pemberton

Anton Ertl

unread,
Jul 15, 2015, 2:03:43 AM7/15/15
to
=?ISO-8859-1?Q?H=E5kan_Th=F6rngren?= <hth...@gmail.com> writes:
>: BAR
> locals{ fred }
> EXECUTE
>;
>
>: test
> locals{ fred }
> 99 set fred \ load fred with 99
> [: fred 1+ ;] BAR .
>;
>
>Which fred will the quotation access?
>
>Looking at the Forth-200x standard, it seems you should dynamically create locals to be visible in a dictionary search.

What makes you think so?

There are no quotations in Forth-2012, so this code is not Forth-2012
anyway. But, e.g.:

: bar a ;
: foo { a } bar ;

is non-standard, and no Forth system I know will dynamically bind the
A in BAR to the A in FOO.

BTW, please limit the length of your lines to about 72 characters.

- 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 2015: http://www.mpeforth.com/euroforth2015/euroforth2015.htm

Håkan Thörngren

unread,
Jul 15, 2015, 3:03:42 AM7/15/15
to
On Wednesday, July 15, 2015 at 8:03:43 AM UTC+2, Anton Ertl wrote:
> =?ISO-8859-1?Q?H=E5kan_Th=F6rngren?= writes:
> >: BAR
> > locals{ fred }
> > EXECUTE
> >;
> >
> >: test
> > locals{ fred }
> > 99 set fred \ load fred with 99
> > [: fred 1+ ;] BAR .
> >;
> >
> >Which fred will the quotation access?
> >
> >Looking at the Forth-200x standard, it seems you should dynamically create locals to be visible in a dictionary search.
>
> What makes you think so?
>
> There are no quotations in Forth-2012, so this code is not Forth-2012
> anyway. But, e.g.:
>
> : bar a ;
> : foo { a } bar ;
>
> is non-standard, and no Forth system I know will dynamically bind the
> A in BAR to the A in FOO.
>
> BTW, please limit the length of your lines to about 72 characters.
>

You are right, it is just me getting compile time and run-time mixed
up.

It will work just fine, you extend the dictionary (13.3.3.1 a) at
compile time, and remove it when the word has been created.
And yes, it says so, compilation semantics.
That fixes the visibility issue that clouded my thinking.

And as quotations are not in Forth-2012, the problem of accessing
locals from them obviously will not exist.

HÃ¥kan

Mark Wills

unread,
Jul 15, 2015, 4:26:43 AM7/15/15
to
Okay, this works on my system:

: foo ( xt -- )
execute . ;

: test ( -- )
locals{ fred }
99 set fred \ load fred with 99
[: fred 1+ ;] ( -- xt ) foo ;

test
100 ok:0

But if foo contains its own locals, you're screwed:

: foo ( xt -- )
locals{ mary }
150 set mary
execute . ;

: test ( -- )
locals{ fred }
99 set fred \ load fred with 99
[: fred 1+ ;] ( -- xt ) foo ;

test
151 ok:0

So I guess it's fake! :-/

If you declare the locals in foo *after* you execute the
quotation, then you can get away with it:

: foo ( xt -- )
execute .
locals{ mary }
150 set mary
mary .
;

: test ( -- )
locals{ fred }
99 set fred \ load fred with 99
[: fred 1+ ;] ( -- xt ) foo ;

test
100 150 ok:0

My system has it's own private locals stack (not on the return
stack, it's totally private), so I'm sure you can see what's
going on.

Thanks for the clarification.

Mark Wills

unread,
Jul 15, 2015, 4:41:55 AM7/15/15
to
Indeed. See my post earlier about locals in my implementation.

Thanks, HÃ¥kan

Mark

Mark Wills

unread,
Jul 15, 2015, 5:42:31 AM7/15/15
to
Super example, thank you.

I can "sort of" do the same thing, as long as the definition that
*executes* the quotation doesn't use locals itself, or, if it does,
defines them after it executes the quotation.

So, converting your code, I get:

: times ( xt n -- )
0 do dup execute loop drop
;

: foo ( -- )
locals{ fred }
99 set fred
[: 1 +set fred ;] 10 times
fred .
;

But times, as written above isn't very useful. The xt should
really be stored somewhere other than the stack, to allow the
stack to be used (perhaps the quotation stores results on the
stack). The obvious place to put the xt would be in a local:

: times ( xt #repeats -- )
locals{ xt }
swap set xt
0 do xt execute loop
;

That would be very neat and tidy. But I can't do that in my
implementation. I can put it in a variable, but that would not
allow nesting of calls to times.

I'll have to fake it! (Sorry, Hugh!): I'll have to the xt on
the return stack, and that's a pain, because the return stack
is in use by DO...LOOP.

Deep breath... (holds nose, types with one hand...)

: times ( xt #repeats -- )
swap >r \ stash xt
0 do
rp@ 3 cells + @ execute
loop
r> drop
;

: foo ( -- )
locals{ fred }
99 set fred
[: 1 +set fred ;] 10 times
fred .
;
foo
109 ok:0

Alex McDonald

unread,
Jul 15, 2015, 7:03:13 AM7/15/15
to
on 15/07/2015 05:10:10, Raimond Dragomir wrote:
OK, I see. So that leads to a number of other questions.

I'm interested in how atimes seeing the XT for [ 1 fred +! ] knows which
activation record contains fred, since there are activation records for
btimes and ctimes on the stack that the frame pointer will be addressing.
Is this possible?

def dtimes { barney rubble } for barney rubble execute next ;
def test { | fred } 99 fred ! 10 [ 1 fred +! ] dtimes fred @ . ;

Alex McDonald

unread,
Jul 15, 2015, 7:09:43 AM7/15/15
to
on 15/07/2015 05:52:22, "Rod Pemberton" wrote:
> On Tue, 14 Jul 2015 15:49:23 -0400, Alex McDonald <bl...@rivadpm.com>
> wrote:
>
>> To make up for my terse rudeness, here's something a bit longer.
>
> Long rudeness ...

Satirical caricature. It plainly didn't work for you, and probably didn't
for others too. That's OK.

Mark Wills

unread,
Jul 15, 2015, 7:19:28 AM7/15/15
to
And, for the record, Mr. Pemberton, I'm English.

American. Pfft.

Mike Mellen

unread,
Jul 15, 2015, 7:56:11 AM7/15/15
to
On 7/15/2015 7:09 AM, Alex McDonald wrote:
>
> Satirical caricature. It plainly didn't work for you, and probably didn't
> for others too. That's OK.

It worked for me :-) But, when are you going to resolve the cliffhanger?



Coos Haak

unread,
Jul 15, 2015, 8:32:03 AM7/15/15
to
Op Wed, 15 Jul 2015 14:04:37 +0200 schreef Coos Haak:

<snip>
> Note: instead of 'for barney' write 'barney for'.
>
> In test, fred is at certain offset from the locals pointer.
> In dtimes, barney is at the same offset, rubble one cell further.
> So in dtimes, barney is incremented, not fred, result is 99.
>
And of course, the offsets are the same, but the locals pointer
is grown and isn't the same in dtimes as in test.

groet Coos

Coos Haak

unread,
Jul 15, 2015, 8:32:03 AM7/15/15
to
Op Wed, 15 Jul 2015 12:03:12 +0100 schreef Alex McDonald:
Note: instead of 'for barney' write 'barney for'.

In test, fred is at certain offset from the locals pointer.
In dtimes, barney is at the same offset, rubble one cell further.
So in dtimes, barney is incremented, not fred, result is 99.

My implementation, ISO locals are value-types, not variables.
: dtimes
{: barney rubble :}
barney for rubble execute next ;

: test
99 {: fred :}
10 [: 1 +to fred ;]
dtimes fred . ;

>>test 99 ok

groet Coos

Alex McDonald

unread,
Jul 15, 2015, 10:44:39 AM7/15/15
to
Here's an ANS/ISO Forth version;

STC Experimental 32bit: 0.06.08 Build: 316
: dtimes {: barney rubble :} barney 0 ?do rubble execute loop ; ok
: test 99 {: fred :} 10 [: 1 +to fred ;] dtimes fred . ; ok
test 99 ok

Same effect, as the same mechanism is used to determine the locals offet
on the stack. Now, with an activation record we could fix that for
DTIMES; but if : DTIMES ETIMES ; and ETIMES does the work, then that's
quite a trick in aliasing BARNEY to FRED, since ETIMES points to DTIMES
activation record, not TEST. It could be done by using display pointers
or a very smart compile (and even then : DTIMES ['] ETIMES EXECUTE ;
would probably blow it). The overhead of all this is quite large just to
allow parent locals in the payload of a quotation. We'd be better off
with full blown scoping, closures and GC by that point.

I'm gravitating towards a quotation with the following characteristics;

1. It can't refer to the enclosing word's locals, but it can have locals
of its own 2. The XT of the quotation can persist outside of the
enclosing execution 3. Quotations can be nested

[: has stack effects ( C: -- quot-sys ) no execution semantics (for that
use :NONAME) ;] has stack effects ( C: quot-sys -- ) no execution
semantics [: ... ;] when executed stack effect is ( -- xt ),
xt when executed is ( i*x -- j*x ) depending on the effects of enclosed
..



Alex McDonald

unread,
Jul 15, 2015, 10:48:01 AM7/15/15
to
on 15/07/2015 15:44:38, "Alex McDonald" wrote:

>>
>
> Here's an ANS/ISO Forth version;
>
> STC Experimental 32bit: 0.06.08 Build: 316
>: dtimes {: barney rubble :} barney 0 ?do rubble execute loop ; ok
>: test 99 {: fred :} 10 [: 1 +to fred ;] dtimes fred . ; ok
> test 99 ok

It isn't ANS, I've just realised, since "anything already on the return
stack becomes unavailable until the loop control parameters are
discarded". But you get the drift.

Alex McDonald

unread,
Jul 15, 2015, 11:27:39 AM7/15/15
to
Act 3
=====

[Narrator, unseen but sounds suspiciously like Anton Ertl]

They didn't all live happily ever after. Annoyingly, the universe gave up
trying to expand any more due to a hole in the fabric of space caused by
the Large Hadron Collider running amok after an undeteced overflow in a
huge multi terabyte C program and just quit. Hugh and the crowd and
everyone in it, including the Forth 201x committee -- even
comp.lang.forth -- simply ripped apart and were gone. Poof. Gone.

But that was just a beginning, for right at the end the universe shouted
"FFS THE ANSWER IS 42. AND I QUIT". And QUIT was the word, and the word
was Forth, and Forth pondered itself, and after a timeless period of
introspection and metacompiling;

only forth
also definitions
quit

And lo, Forth bootstrapped a shiny new universe. ok>

But after a while, it wasn't so shiny any more. Hugh was born, grew up,
and invented the internet.

Hugh: "Look! My quotations are the dog's doughnuts! Fall and worship at
my technical genius, you fakers and ANS Forth cultists! See how my FMITE
and novice package (everything invented by me, pats pending, copyrights
on lists etc) make all others look like amateurs!"

Crowd: (all run screaming) "Deja vu! It's happening all over again!"

Hugh: "Sodomy! Faggots! SwiftForth is broken! ANS Forth must die!"

Rod: "Seriously Hugh, C is so much better."

[Curtain falls]

THE END

Anton Ertl

unread,
Jul 15, 2015, 11:38:27 AM7/15/15
to
"Alex McDonald" <bl...@rivadpm.com> writes:
>STC Experimental 32bit: 0.06.08 Build: 316
>: dtimes {: barney rubble :} barney 0 ?do rubble execute loop ; ok
>: test 99 {: fred :} 10 [: 1 +to fred ;] dtimes fred . ; ok
>test 99 ok
>
>Same effect, as the same mechanism is used to determine the locals offet
>on the stack. Now, with an activation record we could fix that for
>DTIMES; but if : DTIMES ETIMES ; and ETIMES does the work, then that's
>quite a trick in aliasing BARNEY to FRED, since ETIMES points to DTIMES
>activation record, not TEST.

One classical approach is to represent the static scoping with static
links. But that means that you have to represent the closure with two
cells: one represents the code (what is classically the xt), and one
contains the static link. If we want to represent that in a single
cell, we need an additional structure (on the return or locals stack)
that contains this info, and EXECUTE and the other xts have to be
adapted so that EXECUTE works both on normal xts and on pointers to
these structures.

> It could be done by using display pointers

Yes, using a display is also an option, but I don't think it gets rid
of the problem discussed above.

> The overhead of all this is quite large just to
>allow parent locals in the payload of a quotation. We'd be better off
>with full blown scoping, closures and GC by that point.

I think that GC would be quite beyond the usual scope of Forth. Maybe
something with more explicit memory management could be workable.

>I'm gravitating towards a quotation with the following characteristics;
>
>1. It can't refer to the enclosing word's locals, but it can have locals
>of its own 2. The XT of the quotation can persist outside of the
>enclosing execution 3. Quotations can be nested

That's what we have implemented in Gforth (development version).

hughag...@gmail.com

unread,
Jul 15, 2015, 1:44:43 PM7/15/15
to
On Wednesday, July 15, 2015 at 1:26:43 AM UTC-7, Mark Wills wrote:
> Okay, this works on my system:
>
> : foo ( xt -- )
> execute . ;
>
> : test ( -- )
> locals{ fred }
> 99 set fred \ load fred with 99
> [: fred 1+ ;] ( -- xt ) foo ;
>
> test
> 100 ok:0
>
> But if foo contains its own locals, you're screwed:

FOO is the higher-order function --- this is the term.

Yes, if you don't use local in the higher-order function, then your frame-pointer will still be valid when the quotation executes.

The solution I discussed with Raimond already for his system, and which will work in your system also, is to use a different frame-pointer in higher-order functions. You would define higher-order functions with H: rather than : but otherwise they are the same as regular colon words. The difference is that regular colon words use the FP register as a frame-pointer and the higher-order functions use the HFP register as a frame-pointer. So, you need another register dedicated (HFP) beyond what you would normally have.

If you have a register shortage, then you can use RP (the return-stack pointer) as your frame-pointer in higher-order functions. If you do this though, then you can't use >R etc. in higher-order functions. Raimond calls this technique "frameless locals" (a somewhat confusing term; it means that we don't have a dedicated frame-pointer, but are using RP as the frame-pointer).

Note that ANS-Forth (13.3.3) says this:
- Locals shall not be declared until values previously placed on the return stack within the definition have been removed;
- After a definition's locals have been declared, a program may place data on the return stack. However, if this is done, locals shall not be accessed until those values have been removed from the return stack;

So, the ANS-Forth document actually requires that all ANS-Forth systems use frameless-locals, meaning that >R etc. can't be used in conjunction with locals. As a practical matter, every ANS-Forth system ignores this limitation and uses a frame-pointer.

If you have a register shortage you could use frameless-locals for higher-order functions. I would recommend instead that you have a separate frame-pointer (HFP) for higher-order functions, this way they work the same as regular colon words (can use locals and >R in the same function). This is much easier to explain to users, as there are no special rules. In either case however, you do need a different way to define higher-order functions --- use H: rather than : to define them --- this way the different method of accessing locals can be compiled internally. The point of having a different method of accessing locals in the higher-order function is to preserve the frame-pointer (FP) of the parent function so that it is still valid when the quotation executes.

If you do this, then I'll stop saying that you are faking quotations --- you will have real quotations (woo hoo!).

hughag...@gmail.com

unread,
Jul 15, 2015, 1:47:38 PM7/15/15
to
On Tuesday, July 14, 2015 at 9:52:13 PM UTC-7, Rod Pemberton wrote:
> Hugh Aquilar.
>
> What? You forgot the can't get a job programming, driving a taxi cab
> for a living, his brother is a math god, etc.

Rod --- it is very uncool to attack my family (my brother).

P.S. Your mother is a whore.

Alex McDonald

unread,
Jul 15, 2015, 2:31:55 PM7/15/15
to
on 15/07/2015 18:44:38, ha wrote:

>
> Note that ANS-Forth (13.3.3) says this:
> - Locals shall not be declared until values previously placed on the
> return stack within the definition have been removed;
> - After a definition's locals have been declared, a program may place
> data on the return stack. However, if this is done, locals shall not
> be accessed until those values have been removed from the return
> stack;
>
> So, the ANS-Forth document actually requires that all ANS-Forth
> systems use frameless-locals, meaning that >R etc. can't be used in
> conjunction with l ocals. As a practical matter, every ANS-Forth
> system ignores this limitatio n and uses a frame-pointer.

All that's required is counting and the return stack pointer; an extra
frame pointer isn't needed. Let's put the locals on the rstack. Assume
that it counts from 0 downwards, in that 0 is the index of the return
address on entry.

: foo {: a :} a 1 0 do a >r a r> loop ;
^1 ^2 ^3 ^4

At ^1 A is initialized from the data stack, and is PUSHed on the rstack.
^2 is at rstack[0]. DO loop parameters PUSHed; let's say they are 2
cells, hence ^3 is now at rstack[-2]. >R does another PUSH, and now A is
rstack[-3] and so on.

Paul Rubin

unread,
Jul 15, 2015, 2:48:43 PM7/15/15
to
"Alex McDonald" <bl...@rivadpm.com> writes:
> All that's required is counting and the return stack pointer; an extra
> frame pointer isn't needed....
> : foo {: a :} a 1 0 do a >r a r> loop ;
> ^1 ^2 ^3 ^4

That seems to assume you can statically track the r-stack depth, which
might not be possible:

: foo {: a :} mystery if >r then a ...

you don't know at compile time whether mystery has returned true or
false. So you don't know the depth of a. Obviously stuff later in the
word has to clean up but you can't necessarily tell what's happening
there either.

hughag...@gmail.com

unread,
Jul 15, 2015, 3:13:50 PM7/15/15
to
Paul Rubin is right.

This has been covered many times in the past:
https://groups.google.com/forum/#!topic/comp.lang.forth/vGu_EdaLDR4

On Sep 21, 7:37 pm, Hugh Aguilar <hughaguila...@yahoo.com> wrote:
> On Sep 21, 1:47 pm, Brad Eckert <hwfw...@gmail.com> wrote:
>
> > On Wednesday, July 18, 2012 4:25:11 PM UTC-7, (unknown) wrote:
> > >... locals on the return stack, which is not possible if it is
> > >also going to support >R R@ R> etc., which it does.
>
> > If it's not possible, why do so many Forths do it?
>
> Forths that have locals and have >R R@ R> etc. typically give the
> locals their own stack. If the locals are on the return-stack, then
> you have to know at compile-time how many >R will be done at run-time
> so that you know how to adjust the offsets of the locals from the
> return-stack pointer. This isn't possible because the >R may be inside
> of a loop and the number of iterations that the loop executes (and
> hence the number of >R that get executed) depends upon parameters
> given to the function at run-time.
>
> It is common to have >R inside of a loop when you have variable
> numbers of parameters (usually a lot of non-zero data with a zero
> sentinal underneath). This is sometimes also done with strings where
> all of the chars in the string get pushed onto the return-stack. If
> you don't understand how >R can be inside of a loop, I have examples
> in my novice package: http://www.forth.org/novice.html

Alex McDonald

unread,
Jul 15, 2015, 3:18:29 PM7/15/15
to
You're right. I didn't read my notes closely enough. A locals frame
pointer or the equivalent separate locals stack (as in Gforth) would be
required for that. My Forth does have support for static tracking; if you
avoid the mystery case, then using locals inside >R R> and DO LOOP can be
done.


Stephen Pelc

unread,
Jul 15, 2015, 3:38:07 PM7/15/15
to
On Wed, 15 Jul 2015 00:52:26 -0400, "Rod Pemberton"
<b...@fasdfrewar.cdm> wrote:

>E.g., these people seem sane and seem to be American:
>Mark Wills, Paul Rubin, Andrew Haley, JennyB, Ron Aaron, Julian Fondren,
>Jason Damisch, Josh Grams, Richard Owlett, etc

Having met them, at least three of these are not American and I
strongly suspect that another is not.

Stephen

--
Stephen Pelc, steph...@mpeforth.com
MicroProcessor Engineering Ltd - More Real, Less Time
133 Hill Lane, Southampton SO15 5AF, England
tel: +44 (0)23 8063 1441, fax: +44 (0)23 8033 9691
web: http://www.mpeforth.com - free VFX Forth downloads

hughag...@gmail.com

unread,
Jul 15, 2015, 3:58:46 PM7/15/15
to
On Wednesday, July 15, 2015 at 12:38:07 PM UTC-7, Stephen Pelc wrote:
> On Wed, 15 Jul 2015 00:52:26 -0400, "Rod Pemberton"
> <b...@fasdfrewar.cdm> wrote:
>
> >E.g., these people seem sane and seem to be American:
> >Mark Wills, Paul Rubin, Andrew Haley, JennyB, Ron Aaron, Julian Fondren,
> >Jason Damisch, Josh Grams, Richard Owlett, etc
>
> Having met them, at least three of these are not American and I
> strongly suspect that another is not.
>
> Stephen

Stephen Pelc is a member of the Forth-200x committee. What I said earlier in regard to the Forth-200x committee was this (replace "Alex McDonald" with "Rod Pemberton" in the following):

On Tuesday, July 14, 2015 at 1:39:54 PM UTC-7, hughag...@gmail.com wrote:
> The problem I see here is not really Alex McDonald, because trolls have always existed and always will. The problem is a failure of leadership in the Forth community. I think that the Forth-200x committee believe that trolls like Alex are useful so long as they attack people such as Raimond and myself and don't attack ANS-Forth and/or Forth-200x. They believe that they can stand aloof and dodge blame for all of this nastiness because they aren't posting the nastiness themselves, and have effectively kept their hands clean by using a proxy --- they aren't fooling anybody! --- everybody knows that Alex McDonald and John Passaniti are tools of the Forth-200x committee, and that the Forth-200x committee is the engine of corruption on comp.lang.forth.

hughag...@gmail.com

unread,
Jul 15, 2015, 4:24:17 PM7/15/15
to
On Monday, July 13, 2015 at 4:03:13 PM UTC-7, Elizabeth D. Rather wrote:
> On 7/13/15 12:13 PM, Alex McDonald wrote:
> > wordlist constant wid
> >
> > : count-words 0 [: drop 1+ true ;] wid traverse-wordlist ;
> >
> > : (count-words) drop 1+ true ;
> > : count-words 0 (count-words) wid traverse-wordlist ;
> >
> > I think the former is clearest.
>
> Do you mean ... ['] (count-words) wid traverse-wordlist ?
>
> In any case, I find the conventional one clearest. Particularly since I
> could reference (count-words) in testing (e.g., see (countwords) or
> locate (countwords) etc.).

I use this second technique in my novice package routinely for general-purpose data-structures. This is what you said on that subject:
"Does '*every* application' you write use exactly the same kind of data arranged in the same way? If so, having written it once you can reuse it often. If not, you either have to rearrange your data to make it work or modify your 'general-purpose' structure."

Now however, you want to offer your support for this technique. Did you learn how the technique works between the time when you denounced it and when you promoted it? More likely, you don't understand any of this stuff --- you are just supporting Alex McDonald because he is attacking my FMITE design --- you don't really know what any of this is about, but you just support anybody who supports Forth-200x.

You have never posted any code on comp.lang.forth, except for example code taken directly out of the "Starting Forth" book. When you discuss technical issues, you typically demonstrate a complete failure to understand the subject (your comment above regarding general-purpose data-structures is a good example). You have never written a Forth program in your life --- you're a phony.

You are the reason why comp.lang.forth has become such a poisonous environment. Your encouraged John Passaniti to attack your perceived enemies and now you encourage Alex McDonald to attack your perceived enemies. Your entire life is founded upon demanding that Forth programmers support ANS-Forth as the standard, and encouraging antagonizers such as John Passaniti and Alex McDonald to attack anybody who refuses to accept ANS-Forth.

> Cheers,
> Elizabeth

I notice that you have stopped signing off with "Aloha." You had to leave Hawaii after the assassination attempt, didn't you? I notice that you have also stopped bragging about your big lawsuit against Apple Computer because they use the word "swift." You had to drop the lawsuit because of the assassination attempt, didn't you?

You are a disgrace to the Forth community.

Alex McDonald

unread,
Jul 15, 2015, 5:04:29 PM7/15/15
to
on 15/07/2015 21:24:20, wrote:
> On Monday, July 13, 2015 at 4:03:13 PM UTC-7, Elizabeth D. Rather
> > wrote:
>> On 7/13/15 12:13 PM, Alex McDonald wrote:
> > wrote:
>> > wordlist constant wid
> > wrote:
>> >
> > wrote:
>> > : count-words 0 [: drop 1+ true ;] wid traverse-wordlist ;
> > wrote:
>> >
> > wrote:
>> > : (count-words) drop 1+ true ;
> > wrote:
>> > : count-words 0 (count-words) wid traverse-wordlist ;
> > wrote:
>> >
> > wrote:
>> > I think the former is clearest.
> > wrote:
>>
> > wrote:
>> Do you mean ... ['] (count-words) wid traverse-wordlist ?
> > wrote:
>>
> > wrote:
>> In any case, I find the conventional one clearest. Particularly since I
> wrote:
>
>> could reference (count-words) in testing (e.g., see (countwords) or
>> locate (countwords) etc.).
>
> I use this second technique in my novice package routinely for
> general-purp ose data-structures. This is what you said on that
> subject: "Does '*every* application' you write use exactly the same
> kind of data arr anged in the same way? If so, having written it once
> you can reuse it often . If not, you either have to rearrange your
> data to make it work or modify your 'general-purpose' structure."
>
> Now however, you want to offer your support for this technique. Did
> you lea rn how the technique works between the time when you denounced
> it and when you promoted it? More likely, you don't understand any of
> this stuff --- yo u are just supporting Alex McDonald because he is
> attacking my FMITE design --- you don't really know what any of this
> is about, but you just support anybody who supports Forth-200x.
>
> You have never posted any code on comp.lang.forth, except for example
> code taken directly out of the "Starting Forth" book. When you discuss
> technical issues, you typically demonstrate a complete failure to
> understand the sub ject (your comment above regarding general-purpose
> data-structures is a goo d example). You have never written a Forth
> program in your life --- you're a phony.
>
> You are the reason why comp.lang.forth has become such a poisonous
> environm ent. Your encouraged John Passaniti to attack your perceived
> enemies and no w you encourage Alex McDonald to attack your perceived
> enemies. Your entire life is founded upon demanding that Forth
> programmers support ANS-Forth as the standard, and encouraging
> antagonizers such as John Passaniti and Alex McDonald to attack
> anybody who refuses to accept ANS-Forth.
>
>> Cheers,
>> Elizabeth
>
> I notice that you have stopped signing off with "Aloha." You had to
> leave H awaii after the assassination attempt, didn't you? I notice
> that you have a lso stopped bragging about your big lawsuit against
> Apple Computer because they use the word "swift." You had to drop the
> lawsuit because of the assas sination attempt, didn't you?
>
> You are a disgrace to the Forth community.
>

I hate repeating myself, but you really are one sad sack of shit.

Rod Pemberton

unread,
Jul 15, 2015, 9:50:13 PM7/15/15
to
Where did I attack your brother?

Everything there is exactly what you told us.


Rod Pemberton

--
Scientist now say we'll experience a mini-ice in 2030.
So, I guess we need more global warming today ...

Rod Pemberton

unread,
Jul 15, 2015, 10:10:38 PM7/15/15
to
On Wed, 15 Jul 2015 07:19:26 -0400, Mark Wills <markwi...@gmail.com>
wrote:

> And, for the record, Mr. Pemberton, I'm English.
>
> American. Pfft.

You missed the point that Alex was using "Dutch" surnames
to declare people to be Dutch. My surname is English, but
I'm American. Ditto for all my great grand parents. That's
why I emphasized *seems* twice. It's difficult to tell
from a surname. One shouldn't assume, as Alex did.

Well, your verbiage isn't like most of those in the U.K.
You don't use British or Scottish spellings, euphemisms, or
slang, e.g., unlike Alex, Stephen, etc.

Rod Pemberton

unread,
Jul 15, 2015, 10:19:53 PM7/15/15
to
On Wed, 15 Jul 2015 15:38:07 -0400, Stephen Pelc <ste...@mpeforth.com>
wrote:
> On Wed, 15 Jul 2015 00:52:26 -0400, "Rod Pemberton"
> <b...@fasdfrewar.cdm> wrote:

>> E.g., these people seem sane and seem to be American:
>> Mark Wills, Paul Rubin, Andrew Haley, JennyB, Ron Aaron, Julian Fondren,
>> Jason Damisch, Josh Grams, Richard Owlett, etc
>
> Having met them, at least three of these are not American and I
> strongly suspect that another is not.
>

It seems you missed the point too. See reply to Mark.


RP

Mark Wills

unread,
Jul 16, 2015, 3:42:48 AM7/16/15
to
On Thursday, 16 July 2015 03:10:38 UTC+1, Rod Pemberton wrote:
> Well, your verbiage isn't like most of those in the U.K.
> You don't use British or Scottish spellings, euphemisms, or
> slang, e.g., unlike Alex, Stephen, etc.

<pout>
How dare you sir! Unlike your good self, I can spell colour.
I also know my bumpers from your fenders, and my bonnets from
your hoods, and my boots from your trunks!
And don't get me started on pants. Pah!
</pout>

:-)

Alex McDonald

unread,
Jul 16, 2015, 4:59:19 AM7/16/15
to
on 16/07/2015 03:10:48, "Rod Pemberton" wrote:
> On Wed, 15 Jul 2015 07:19:26 -0400, Mark Wills
> <markwi...@gmail.com> wrote:
>
>> And, for the record, Mr. Pemberton, I'm English.
>>
>> American. Pfft.
>
> You missed the point that Alex was using "Dutch" surnames
> to declare people to be Dutch. My surname is English, but
> I'm American. Ditto for all my great grand parents. That's
> why I emphasized *seems* twice. It's difficult to tell
> from a surname. One shouldn't assume, as Alex did.

Ah, so you got the joke, then spoiled it by explaining it.

>
> Well, your verbiage isn't like most of those in the U.K.
> You don't use British or Scottish spellings, euphemisms, or
> slang, e.g., unlike Alex, Stephen, etc.
>
>

I have a US-based laptop from keyboard thru dammit through to the
software. It even tries autocorrecting swear words. Bar steward bar stud
bars tarred be are starred. Annoying.

> Rod Pemberton
>

It is loading more messages.
0 new messages