Sujet : Re: Managing custom words [Re: "Back & Forth" is back!]
De : albert (at) *nospam* spenarnc.xs4all.nl
Groupes : comp.lang.forthDate : 25. Nov 2024, 13:08:55
Autres entêtes
Organisation : KPN B.V.
Message-ID : <nnd$11b200e5$0eab5883@abe6e64e390a3eea>
References : 1 2 3 4
User-Agent : trn 4.0-test77 (Sep 1, 2010)
In article <
dfcc6e20ea84a306917427e430df2060d66ff648@i2pn2.org>,
dxf <
dxforth@gmail.com> wrote:
On 23/11/2024 2:46 am, Buzz McCool wrote:
On 11/19/2024 9:48 AM, Buzz McCool wrote:
... Any other tips on word management would be appreciated.
>
I found the "Forth Foundation Library": https://github.com/uho/ffl
>
Is this still widely used? I ask since all the commits are over a decade old.
...
>
AFAIK it was never widely used. When the question as to why arose on c.l.f,
everyone had an excuse as to why it didn't suit them. The reluctance in
Forth to use others' code goes all the way to Moore himself and extends to
things such as the Standard. Elizabeth comments on the phenomena here:
>
https://groups.google.com/g/comp.lang.forth/c/t7DjpOZkR9M/m/GZbK41I_NA4J
>
The library is bloated and cumbersome to use.
E.f. handling arguments runs over 500 lines and relies on 4 other files from
the package.
Compare this with handle arguments in ciforth, essentially one screen,
pulling in one screen for fetching c-strings:
------------------------------------------------
( ARGC ARGV ARG[] SHIFT-ARGS ENV ) CF: ?LI \ AvdH B2sep21
"Z$@" WANTED
\ Return the NUMBER of arguments passed by Linux
: ARGC ARGS @ @ ;
\ Return the argument VECTOR passed by Linux
: ARGV ARGS @ CELL+ ;
\ Return the environment POINTER passed by Linux
: ENV ARGS @ $@ 1+ CELLS + ;
\ Find argument INDEX, counting from one. Return as a STRING.
: ARG[] CELLS ARGV + @ Z$@ ;
\ Return POINTER behind the end-0 of the environment.
: ENV0 ENV BEGIN $@ WHILE REPEAT ;
\ Shift the arguments, so as to remove argument 1.
: SHIFT-ARGS ARGV >R
R@ CELL+ CELL+ R@ CELL+ ENV0 R> - MOVE
-1 ARGS @ +! ;
------------------------------------------------
There is an other screen that is loaded by wina ( windows ciforth version)
that is totally different except for the interface, where the index line
reads:
( ARG$ ARGC ARG[] SHIFT-ARGS ) CF: ?WI \ AvdH B1jul10
Maybe this library is tailored to ciforth, but it illustrates that
there are more practical ways. This approach make substantial programs
(ciasdis manx) portable over Linux and MS-Windows.
ciasdis was ported to Apple once with little problems.
I am interested to seeing ciasdis ported using the fll-library and ISO
compliance.
Groetjes Albert
-- Temu exploits Christians: (Disclaimer, only 10 apostles)Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style WallArt For Home, Office And Garden Decor - Perfect For Windows, Bars,And Gifts For Friends Family And Colleagues.