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 117,602 of 117,927    |
|    dxf to minforth    |
|    Re: Generating a random sequence of Fort    |
|    02 Oct 25 19:49:29    |
   
   From: dxforth@gmail.com   
      
   On 2/10/2025 4:42 am, minforth wrote:   
   > Am 01.10.2025 um 17:11 schrieb Hans Bezemer:   
   >> I used something similar - but with a whole slew of stack operations. Very   
   handy thingy. I use it until this day.   
   >>   
   >> ( abc -- abcabc) >r over over r@ rot rot r> \ >r 2dup r@ -rot r>   
   >>   
   >   
   > Different and probably not as efficient as your code generator:   
   >   
   > MinForth 3.6   
   > # : 3DUP { a b c == a b c a b c } ;   
      
   For 3DUP I believe this is the one to beat:   
      
   : 3DUP ( a b c -- a b c a b c ) dup 2over rot ;   
      
   With NTF/LFX the locals version will break even. For others, well, it may   
   be better not to look. For a straight-forward example of 'stack juggling',   
   locals handle it rather poorly.   
      
   --- 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