Deutsch   English   Français   Italiano  
<667d5e0a$1@news.ausics.net>

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

Date: Thu, 27 Jun 2024 22:41:46 +1000
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: 0 SET-ORDER why?
Newsgroups: comp.lang.forth
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> <v5ioud$2ii4l$1@dont-email.me>
Content-Language: en-GB
From: dxf <dxforth@gmail.com>
In-Reply-To: <v5ioud$2ii4l$1@dont-email.me>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: news.ausics.net
Message-ID: <667d5e0a$1@news.ausics.net>
Organization: Ausics - https://newsgroups.ausics.net
Lines: 22
X-Complaints: abuse@ausics.net
Path: ...!weretis.net!feeder9.news.weretis.net!news.bbs.nz!news.ausics.net!not-for-mail
Bytes: 1756

On 27/06/2024 2:14 pm, 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.

( orig from ANS)
: ALSO  ( -- )  GET-ORDER  OVER SWAP 1+ SET-ORDER ;

( smarter)
: ALSO  ( -- )
  GET-ORDER  DUP IF OVER ELSE FORTH-WORDLIST THEN
  SWAP 1+ SET-ORDER ;