Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #134232
| Newsgroups | comp.lang.forth |
|---|---|
| Subject | Re: Generating a random sequence of Forth words |
| References | <2025Sep30.183350@mips.complang.tuwien.ac.at> <nnd$60c544bd$6fdf6f8e@13070880e71750ef> <mk5b0uFubm8U1@mid.individual.net> <68de4aaa@news.ausics.net> |
| From | albert@spenarnc.xs4all.nl |
| Message-ID | <nnd$22ca1fe9$28f84452@be32e8d2a0a178a3> (permalink) |
| Organization | KPN B.V. |
| Date | 2025-10-02 13:07 +0200 |
In article <68de4aaa@news.ausics.net>, dxf <dxforth@gmail.com> 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.
Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar
Generating a random sequence of Forth words anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2025-09-30 16:33 +0000
Re: Generating a random sequence of Forth words minforth <minforth@gmx.net> - 2025-10-01 11:20 +0200
Re: Generating a random sequence of Forth words anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2025-10-01 17:10 +0000
Re: Generating a random sequence of Forth words Hans Bezemer <the.beez.speaks@gmail.com> - 2025-10-01 17:11 +0200
Re: Generating a random sequence of Forth words minforth <minforth@gmx.net> - 2025-10-01 20:42 +0200
Re: Generating a random sequence of Forth words dxf <dxforth@gmail.com> - 2025-10-02 19:49 +1000
Re: Generating a random sequence of Forth words albert@spenarnc.xs4all.nl - 2025-10-02 13:07 +0200
Re: Generating a random sequence of Forth words dxf <dxforth@gmail.com> - 2025-10-03 18:22 +1000
3dup again (was: Generating a random sequence of Forth words) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2025-10-02 20:44 +0000
Re: 3dup again (was: Generating a random sequence of Forth words) albert@spenarnc.xs4all.nl - 2025-10-03 11:02 +0200
Re: 3dup again minforth <minforth@gmx.net> - 2025-10-03 11:09 +0200
Re: 3dup again anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2025-10-04 08:04 +0000
Re: 3dup again Hans Bezemer <the.beez.speaks@gmail.com> - 2025-10-05 11:29 +0200
Re: Generating a random sequence of Forth words antispam@fricas.org (Waldek Hebisch) - 2025-10-15 19:19 +0000
Re: Generating a random sequence of Forth words anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2025-10-24 15:55 +0000
csiph-web