Deutsch   English   Français   Italiano  
<v5ioud$2ii4l$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!2.eu.feeder.erje.net!3.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Gerry Jackson <do-not-use@swldwa.uk>
Newsgroups: comp.lang.forth
Subject: Re: 0 SET-ORDER why?
Date: Thu, 27 Jun 2024 05:14:06 +0100
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <v5ioud$2ii4l$1@dont-email.me>
References: <v5fjkr$1p13i$1@dont-email.me>
 <2024Jun26.094910@mips.complang.tuwien.ac.at> <667bd654$1@news.ausics.net>
 <v5h5h6$2565d$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 27 Jun 2024 06:14:05 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="f3c4c8f0e309113597e88724f90abaef";
	logging-data="2705557"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/++iMS+82HgGO1hJ79OHhTykbwlfzQ+Mg="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:JnV0bWjjTgbfmDLV4Ql54+34Qg0=
Content-Language: en-GB
In-Reply-To: <v5h5h6$2565d$1@dont-email.me>
Bytes: 2734

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.

-- 
Gerry