Re: 0 SET-ORDER why?

Liste des GroupesRevenir à cl forth 
Sujet : Re: 0 SET-ORDER why?
De : dxforth (at) *nospam* gmail.com (dxf)
Groupes : comp.lang.forth
Date : 28. Jun 2024, 06:51:47
Autres entêtes
Organisation : Ausics - https://newsgroups.ausics.net
Message-ID : <667e4f74$1@news.ausics.net>
References : 1 2 3 4 5 6 7
User-Agent : Mozilla Thunderbird
On 28/06/2024 5:22 am, Krishna Myneni wrote:
On 6/27/24 14:09, Krishna Myneni wrote:
On 6/26/24 23:14, Gerry Jackson 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.
>
>
Good analysis showing that
>
1) The definition of TURNKEY is flawed.
>
2) 0 SET-ORDER is not necessary.
>
>
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.
>
>
This use case is convoluted and there may be a better of dealing with the anticipated problem. If not, we should consider what's missing in Forth allowing us to solve the problem more directly.
>
>
No one has pointed to a need for 0 SET-ORDER in interpretation state, and there is no to undo its use in interpretation state in a standard. Furthermore an empty search order contradicts the concept of a minimum search order.
>
The solutions are:
>
1) leave everything as is, and live with the contradiction and the hazard of performing 0 SET-ORDER in interpretation state.
>
2) make SET-ORDER state-smart, and live with the contradiction. This will potentially break code.
>
3) disallow zero as an argument to SET-ORDER e.g. throw an error for zero.
>
Am I missing any other options?
>
Personally, I favor 3) -- throwing an error when zero is an argument to SET-ORDER.
>
 
Edits:
 
No one has pointed to a need for 0 SET-ORDER in interpretation state,
and there is no standard way to undo its use in interpretation state.
 
3) disallow zero as an argument to SET-ORDER e.g. throw an error for zero. This will break existing code where zero is an argument to SET-ORDER.
 
Any idea of frequency of usage for 0 SET-ORDER . I don't believe I have ever used it in a definition.

It appears this topic has come up before:

https://groups.google.com/g/comp.lang.forth/c/Kku0wXJ8zMs/m/CgWkZ7Kl_EMJ

Other posts I've seen suggest Mitch Bradley may have been behind GET-ORDER SET-ORDER
(originally a fix for ONLY/ALSO).  May be worth contacting him.





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