home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.forth      Forth programmers eat a lot of Bratwurst      117,927 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 116,581 of 117,927   
   albert@spenarnc.xs4all.nl to krishna.myneni@ccreweb.org   
   Re: 0 SET-ORDER why?   
   28 Jun 24 10:04:00   
   
   In article ,   
   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?   
      
   4) Use wordlists as a pure stack.  Also ASSEMBLER  .. PREVIOUS.   
   Define the minumum search order as only handling numbers and other constants.   
   Declare SET-ORDER and GET-ORDER obsolete.   
      
   >   
   >Personally, I favor 3) -- throwing an error when zero is an argument to   
   >SET-ORDER.   
   >   
   >--   
   >Krishna   
   >   
   >Personally   
   >   
   >   
   >2)   
   --   
   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 -   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca