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 117,600 of 117,927   
   albert@spenarnc.xs4all.nl to dxforth@gmail.com   
   Re: Generating a random sequence of Fort   
   02 Oct 25 13:07:54   
   
   In article <68de4aaa@news.ausics.net>, dxf   wrote:   
   >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 ;   
      
   CODE 3DUP   
       PUSH  RSP[3*CELL_SIZE]   
       PUSH  RSP[3*CELL_SIZE]   
       PUSH  RSP[3*CELL_SIZE]   
       NEXT,   
      
   How does that look for 5DUP ?   
      
   >   
   >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.   
   >   
   Groetjes Albert   
   --   
   The Chinese government is satisfied with its military superiority over USA.   
   The next 5 year plan has as primary goal to advance life expectancy   
   over 80 years, like Western Europe.   
      
   --- 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