Re: 0 SET-ORDER why?

Liste des GroupesRevenir à cl forth 
Sujet : Re: 0 SET-ORDER why?
De : albert (at) *nospam* spenarnc.xs4all.nl
Groupes : comp.lang.forth
Date : 27. Jun 2024, 10:05:27
Autres entêtes
Organisation : KPN B.V.
Message-ID : <nnd$70f8bc61$3d91614d@1ca100eb10a2e5f5>
References : 1 2 3 4
User-Agent : trn 4.0-test77 (Sep 1, 2010)
In article <v5ioud$2ii4l$1@dont-email.me>,
Gerry Jackson  <do-not-use@swldwa.uk> wrote:
On 26/06/2024 14:36, Ruvim wrote:
One possible use case:
>
   : turnkey ( -- ) 0 set-order
     also Target definitions
     also Minimal also
   ;
>
ALSO duplicates the wordlist at the head of the search order. If the
search order is empty there is nothing to duplicate. Therefore ALSO
applied to an empty search order ought to be an ambiguous condition.
>
Presumably the above definition works because a target wordlist replaces
whatever garbage ALSO leaves in the search order. So the definition
might as well have 0 1 SET-ORDER instead of 0 SET-ORDER ALSO.
Or better still TARGET-WORDLIST 1 SET-ORDER. Either removes the above
justification for 0 SET-ORDER.
>
But having said that it is better for 0 SET-ORDER to do what is natural
instead of yet another ambiguous condition.
>
Another possible use case:
>
   : s-to-n ( addr u -- n )
     depth >r
     get-order n>r 0 set-order
       ['] evaluate ['] execute-interpreting catch
     nr> set-order
     depth 1- r> <> if -12 throw then
   ;
>
This is a better use case e.g. if BASE is greater than decimal 10
converting an alphanumeric string to a number could clash with a word in
the dictionary. Having an empty search order eliminates that possibility.
>
Incidentally another possibility is that if ['] EVALUATE is replaced in
the above definition with ['] SOME-RECOGNISER, that could be the basis
for an ANS/FORTH 2012 compatible way of implementing recognisers. If the
recogniser fails restore the search order and try again.

I'm more and more convinced that the ciforth solution to make ONLY
a wordlist and stick all the number stuff (plus strings, say denotations) there
is ideal.
Add the rule that you simply cannot the remove the minimal search order,
which may perfect sense.
The only non-ISO aspect is that FORTH-WORDLIST and SET-ORDER is missing.
This is just as well, implementing SET-ORDER politically correctly
would bloat the ciforth kernel with 20%, at least that is my impression
from the discussion here.

And besides shuffling the wordlists searched for is a terrible idea.
I have not seen a use case for that.
Think of python. If you import all with *, at least the underlying
assumption is that the libraries contain no conflicting names
such that the order doesn't matter. Imagine that you can somehow
"unimport integral *" .
The idea from ENVRIONMENT that was supposed to find out portably what
facilities are to be loaded. No sensible use case.

A sensible use of wordlist is e.g.
ALSO INLINING
INCLUDE modulo.frt
PREVIOUS
This adds INLINING to the search order to have all the operators of
modulo calculations automatically inlined: +m -m *m ^m .
Then back off.
Or adding the ASSEMBLER namespace temporarily to add code words.

Or a word like IMPORT that makes an alias from a named wordlist
into the current wordlist (assuming current=context).

--
Gerry
>

Groetjes Albert
--
Don't praise the day before the evening. One swallow doesn't make spring.
You must not say "hey" before you have crossed the bridge. Don't sell the
hide of the bear until you shot it. Better one bird in the hand than ten in
the air. First gain is a cat purring.            - the Wise from Antrim -

Date Sujet#  Auteur
26 Jun 24 * 0 SET-ORDER why?64Krishna Myneni
26 Jun 24 +* Re: 0 SET-ORDER why?3minforth
26 Jun 24 i+- Re: 0 SET-ORDER why?1albert
26 Jun 24 i`- Re: 0 SET-ORDER why?1Krishna Myneni
26 Jun 24 `* Re: 0 SET-ORDER why?60Anton Ertl
26 Jun 24  +* Re: 0 SET-ORDER why?26dxf
26 Jun 24  i`* Re: 0 SET-ORDER why?25Ruvim
27 Jun 24  i +* Re: 0 SET-ORDER why?9dxf
27 Jun 24  i i+* Re: 0 SET-ORDER why?2Gerry Jackson
28 Jun 24  i ii`- Re: 0 SET-ORDER why?1dxf
28 Jun 24  i i`* Re: 0 SET-ORDER why?6Ruvim
28 Jun 24  i i +* Re: 0 SET-ORDER why?4dxf
28 Jun 24  i i i`* Re: 0 SET-ORDER why?3Ruvim
28 Jun 24  i i i `* Re: 0 SET-ORDER why?2dxf
1 Jul 24  i i i  `- Re: 0 SET-ORDER why?1dxf
29 Jun 24  i i `- Re: 0 SET-ORDER why?1dxf
27 Jun 24  i `* Re: 0 SET-ORDER why?15Gerry Jackson
27 Jun 24  i  +* Re: 0 SET-ORDER why?2albert
27 Jun 24  i  i`- Re: 0 SET-ORDER why?1minforth
27 Jun 24  i  +- Re: 0 SET-ORDER why?1dxf
27 Jun 24  i  +* Re: 0 SET-ORDER why?7Krishna Myneni
27 Jun 24  i  i+* Re: 0 SET-ORDER why?4Krishna Myneni
27 Jun 24  i  ii+* Re: 0 SET-ORDER why?2Gerry Jackson
28 Jun 24  i  iii`- Re: 0 SET-ORDER why?1Krishna Myneni
28 Jun 24  i  ii`- Re: 0 SET-ORDER why?1dxf
29 Jun 24  i  i`* Re: 0 SET-ORDER why?2Krishna Myneni
30 Jun 24  i  i `- Re: 0 SET-ORDER why?1albert
28 Jun 24  i  `* Re: 0 SET-ORDER why?4Ruvim
28 Jun 24  i   +* Re: 0 SET-ORDER why?2albert
28 Jun 24  i   i`- Recognizer protocol (was: 0 SET-ORDER why?)1Ruvim
4 Jul 24  i   `- Re: 0 SET-ORDER why?1Gerry Jackson
26 Jun 24  +* Re: 0 SET-ORDER why?3albert
26 Jun 24  i+- Re: 0 SET-ORDER why?1minforth
26 Jun 24  i`- Re: 0 SET-ORDER why?1Krishna Myneni
26 Jun 24  `* Re: 0 SET-ORDER why?30Krishna Myneni
28 Jun 24   `* Re: 0 SET-ORDER why?29Anton Ertl
28 Jun 24    +- Re: 0 SET-ORDER why?1Hans Bezemer
29 Jun 24    `* Re: 0 SET-ORDER why?27Krishna Myneni
30 Jun 24     `* Re: 0 SET-ORDER why?26dxf
30 Jun 24      `* Re: 0 SET-ORDER why?25Krishna Myneni
30 Jun 24       `* Re: 0 SET-ORDER why?24Krishna Myneni
30 Jun 24        `* Re: 0 SET-ORDER why?23minforth
30 Jun 24         `* Re: 0 SET-ORDER why?22Krishna Myneni
30 Jun 24          `* Re: 0 SET-ORDER why?21minforth
1 Jul 24           `* Re: 0 SET-ORDER why?20Krishna Myneni
1 Jul 24            +* Re: 0 SET-ORDER why?2mhx
1 Jul 24            i`- Re: 0 SET-ORDER why?1Krishna Myneni
1 Jul 24            `* Re: 0 SET-ORDER why?17Ruvim
1 Jul 24             +* Re: 0 SET-ORDER why?12Krishna Myneni
1 Jul 24             i+* Re: 0 SET-ORDER why?6dxf
2 Jul 24             ii+- Re: 0 SET-ORDER why?1dxf
3 Jul 24             ii`* Re: 0 SET-ORDER why?4Krishna Myneni
3 Jul 24             ii `* Re: 0 SET-ORDER why?3dxf
3 Jul 24             ii  `* Re: 0 SET-ORDER why?2albert
3 Jul 24             ii   `- Re: 0 SET-ORDER why?1dxf
1 Jul 24             i+* Re: 0 SET-ORDER why?3albert
2 Jul 24             ii`* Re: 0 SET-ORDER why?2sjack
2 Jul 24             ii `- Re: 0 SET-ORDER why?1dxf
2 Jul 24             i`* Re: 0 SET-ORDER why?2Ruvim
3 Jul 24             i `- Re: 0 SET-ORDER why?1Krishna Myneni
21 Sep 24             `* Re: 0 SET-ORDER why?4Anthony Howe
22 Sep 24              `* Re: 0 SET-ORDER why?3Ruvim
22 Sep 24               `* Re: 0 SET-ORDER why?2Anthony Howe
22 Sep 24                `- Re: 0 SET-ORDER why?1Ruvim

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal