And here is a message from the Forth-200x chair-person:
On Saturday, November 17, 2018 at 9:54:54 PM UTC-7,
ste...@mpeforth.com wrote:
> My name is Stephen Pelc.
> ...
> If you can't stomach the word MASTURBATE you cannot be able
> to raise children from puberty into adulthood.
The Forth-200x committee is basically a circle-jerk.
We have Peter Knaggs who goes to EuroForth-2018 and claims to be
the world's expert on linked lists in Forth,
but he doesn't have any working code.
We have Andrew Haley who goes to EuroForth-2018 and claims to be
the world's expert on a <SWITCH with constant time in Forth,
but he doesn't have any working code.
We have Anton Ertl and Bernd Paysan who go to EuroForth-2018 and
claim to be the world's experts on quotations, but their paper
seems to have no point except to attack the rquotations, claiming
that rquotations fail to access the parent function's local
variables despite the HOF having local variables of its own.
They are lying, of course.
I provided this feature a few days after HumptyDumpty posted his
prototype rquotations that lacked this feature. This was in mid-2016.
These are all Forth-200x committee members jerking each other off.
They are just fantasizing about being the world's experts on
Forth programming. They imagine lowly Forth programmers such as
myself being totally dependent upon their great wisdom.
They can't actually write working Forth code though!
The Forth-200x committee members are the enemies of Forth.
People in the real world (C programmers, etc.) see their incompetence
and gleefully declare that this implies that all Forthers are incompetent.
It is always worthwhile to shine a spotlight on the incompetence
of the Forth-200x committee members --- hopefully shame them into giving up.
Peter Knaggs is not only failing to implement a linked list,
but his design is just a jumble of nonsense and vague dreams.
This is not a design developed by a programmer!
Even if he got is design to work, it would still be worthless.
When (if) our big-time Forth-200x committee member
(Stephen Pelc's pocket-boy) gets his linked-list implemented,
I challenge him to write some simple functions.
1.) Define a list with elements containing a single float.
2.) For testing purposes, generate a list containing
30 random floats in the range [0,1).
3.) For the test list, filter out all of the nodes
with a value < 0.5 and put them in a different list.
4.) Sort the test list ascending, then split it into
two lists of nodes < 0.5 and above.
5.) Clone the test list.
Now, define a child class that has two floats
(the first one is real, the second imaginary).
All of the test functions written above
(#3,#4,#5) should work on lists of the child
type without modification or recompilation.
For me, being a Forth programmer is all about Forth programming.
I enjoy writing Forth code that works. I don't skip this step.
So, here is how I would do the above challenge:
1.) This code defines a class called REAL and provides
KILL-REAL and SHOW-REAL that are typical for classes.
-------------------------------------------------------------------
list
f field .real
constant real
: init-real ( node -- node ) \ float: real --
init-list >r
r@ .real f!
r> ;
: new-real ( -- node ) \ float: real --
real alloc
init-real ;
: kill-real ( head -- )
each[ dealloc ]each ;
: show-real ( head -- )
each[ cr .real f@ f. ]each ;
-------------------------------------------------------------------
Peter Knaggs will fail on writing KILL-REAL because deallocating
a node will corrupt its link field so NEXT won't work.
2.) This code generates a list containing 30 random floats in the range [0,1).
-------------------------------------------------------------------
: test2 ( -- head ) \ generate a test list
nil
30 0 do frnd new-real link loop ;
-------------------------------------------------------------------
3.) This code filters out all of the nodes
with a value < 0.5 and put them in a different list.
-------------------------------------------------------------------
: <test3> ( sml-head big-head node -- )
init-list \ the node is going to another list
dup .real f@ 0.5e f< if swap >r link r> \ link to SML-HEAD
else link then ; \ link to BIG-HEAD
: test3 ( head -- sml-head big-head ) \ filter small nodes (<0.5) into SML-HEAD
nil nil rot ['] <test3> each ;
-------------------------------------------------------------------
Peter Knaggs will fail on writing TEST3 because INIT-LIST changes
the link field of the node so NEXT won't work.
4.) This code sorts the list ascending, then splits it into
two lists of nodes < 0.5 and above.
-------------------------------------------------------------------
: <sort-real> ( new-node node -- new-node prior? )
over .real f@ .real f@ f< ;
: <test4> ( node -- flag )
.real f@ 0.5e f>= ;
: test4 ( head -- sml-head big-head )
['] <sort-real> sort-list
dup ['] <test4> find-node delink ;
-------------------------------------------------------------------
Peter Knaggs will fail on writing TEST4 because he doesn't have
DELINK that splits a list at an arbitrary node.
5.) This is code to clone a list of reals.
-------------------------------------------------------------------
get-current synonym test5 clone-list ( head -- clone )
-------------------------------------------------------------------
Peter Knaggs will fail on writing TEST5 because he doesn't have
ALLOCATION available.
Note that this is a simple example because there are no pointers in
the class. If there are pointers, they have to be cloned manually.
This is code to define a new COMPLEX class.
-------------------------------------------------------------------
real
f field .imaj
constant complex
: init-complex ( node -- node ) \ float: real imaj --
fswap \ float: imaj real --
init-real >r
r@ .imaj f!
r> ;
: new-complex ( -- node ) \ float: real imaj --
complex alloc
init-complex ;
: test2c ( -- head ) \ generate a test list
nil
30 0 do frnd frnd new-complex link loop ;
: show-complex ( head -- )
each[ cr dup .real f@ f. .imaj f@ f. ]each ;
-------------------------------------------------------------------
Peter Knaggs will fail at this because he doesn't know how OOP works.
Here we use TEST2C instead of TEST2 to generate the test list.
We use SHOW-COMPLEX instead of SHOW-REAL to view the list.
KILL-REAL works on COMPLEX lists.
TEST3 TEST4 TEST5 all work on COMPLEX lists without modification
or recompilation.
This seems like very novice-level programming to me.
That is why it is called a "novice-package" --- novices can easily
learn to write code like this --- Peter Knaggs, for example.