Any "standard" names for..
  Home FAQ Contact Sign in
comp.lang.forth only
 
Advanced search
POPULAR GROUPS

more...

comp.lang.forth Profile…
 Up
Any "standard" names for..         


Author: The Beez'
Date: Jan 7, 2008 04:52

I have three questions:

1) Is http://forth.sourceforge.net still in use?

2) Is there a "convention", Comus name for a word which produces the
stack effects:
a b -- a a b
Philip Koopman calls it "UNDER".

3) Is there a "convention", Comus name for a word which produces the
stack effects:
a n -- a+1 n-1
Effectively removing the first character from a addr/count string.
This is really getting confusing..!

Any feedback appreciated!

Hans
26 Comments
Re: Any "standard" names for..         


Author: Anton Ertl
Date: Jan 7, 2008 06:20

"The Beez'" bigfoot.com> writes:
>3) Is there a "convention", Comus name for a word which produces the
>stack effects:
> a n -- a+1 n-1
> Effectively removing the first character from a addr/count string.

1 /string

That's standard, BTW. The Xchars proposal also has a name for
removing the front xchar from a string:

`+x/string' xc-addr1 u1 - xc-addr2 u2 xchar "plus-x-slash-string"
Step forward by one xchar in the buffer defined by address XC-ADDR1,
size U1 pchars. XC-ADDR2 is the address and u2 the size in pchars of
the remaining buffer after stepping over the first xchar in the buffer.

- anton
no comments
Re: Any "standard" names for..         


Author: Mark W. Humphries
Date: Jan 7, 2008 06:48

I use LIFT for the first, and CLIP for the second. Don't know if
that's common usage though.
no comments
Re: Any "standard" names for..         


Author: Alex McDonald
Date: Jan 8, 2008 09:07

On Jan 8, 2:12 pm, Brad Eckert tinyboot.com> wrote:
> On Jan 8, 6:24 am, Alex McDonald rivadpm.com> wrote:
>
>> I could only find 2 occurences of OVER SWAP (the equivalent of UNDER)
>> in the Win32Forth V6 sources; one was in Stephen Pelc's benchmark. Is
>> it useful? Win32Forth V6 has UNDER+ ( a b c -- a+c b ) which is used
>> exactly four times; zero in the STC version.
>
> Could you also search for ">R DUP R>" which is the same as "OVER
> SWAP"?
>
> Brad

2 occurences in V6 (all excluding apps btw, just the core system).

Interestingly, one was in this set of strangely named words;

: -dup ( n1 n2 - n1 n1 n2 ) >r dup r> ;
: -over ( n1 n2 n3 - n1 n2 n1 n3 ) >r over r> ;
: -swap ( n1 n2 n3 - n2 n1 n3 ) >r swap r> ;

which led me to this truly horrible concoction;

nip r> -dup - r> swap -
Show full article (0.97Kb)
no comments
Re: Any "standard" names for..         


Author: George Hubert
Date: Jan 8, 2008 11:40

On Jan 8, 5:07 pm, Alex McDonald rivadpm.com> wrote:
> On Jan 8, 2:12 pm, Brad Eckert tinyboot.com> wrote:
>
>> On Jan 8, 6:24 am, Alex McDonald rivadpm.com> wrote:
>
>>> I could only find 2 occurences of OVER SWAP (the equivalent of UNDER)
>>> in the Win32Forth V6 sources; one was in Stephen Pelc's benchmark. Is
>>> it useful? Win32Forth V6 has UNDER+ ( a b c -- a+c b ) which is used
>>> exactly four times; zero in the STC version.
>
>> Could you also search for ">R DUP R>" which is the same as "OVER
>> SWAP"?
>
>> Brad
>
> 2 occurences in V6 (all excluding apps btw, just the core system).
>
> Interestingly, one was in this set of strangely named words;
>
> : -dup  ( n1 n2    - n1 n1 n2 )    >r dup r>  ; ...
Show full article (1.25Kb)
no comments
Re: Any "standard" names for..         


Author: Ian Osgood
Date: Jan 8, 2008 14:53

On Jan 8, 11:40 am, George Hubert yahoo.co.uk> wrote:
> On Jan 8, 5:07 pm, Alex McDonald rivadpm.com> wrote:
>
>> which led me to this truly horrible concoction;
>
>> nip r> -dup - r> swap -
>
>  surely
>
> nip dup r> - r> swap -
>
> would be better

Or follow the Elements of Style (no double negatives) with:

nip dup negate r> + r> +

Ian
no comments
Re: Any "standard" names for..         


Author: Jonah Thomas
Date: Feb 25, 2008 23:30

A long time ago, "The Beez'" bigfoot.com> wrote:
> Is there a "convention", Comus name for a word which produces the
> stack effects:
> a b -- a a b
> Philip Koopman calls it "UNDER".

The author of TIMBRE called it NUP .

When I made it a fast primitive I found pretty many uses for it. But I
could get by just fine without it.
no comments
Re: Any "standard" names for..         


Author: Henry
Date: Feb 26, 2008 06:01

On Feb 26, 2:30 am, Jonah Thomas gmail.com> wrote:
> A long time ago, "The Beez'" bigfoot.com> wrote:
>
>> Is there a "convention", Comus name for a word which produces the
>> stack effects:
>>     a b -- a a b
>>     Philip Koopman calls it "UNDER".
>
> The author of TIMBRE called it NUP .
>
> When I made it a fast primitive I found pretty many uses for it. But I
> could get by just fine without it.

MacForth refers to a b
-- a a b as UNDERDUP
It also has a word UNDER+ which gives a b c -- a+c b

Henry
no comments
Re: Any "standard" names for..         


Author: Bruce McFarling
Date: Feb 26, 2008 07:27

On Feb 26, 9:01 am, Henry wrote:
> MacForth refers to a b -- a a b as UNDERDUP
> It also has a word UNDER+ which gives a b c -- a+c b

The last time this arose, there was some support for DUP-UNDER
as being more expressive.
no comments
Re: Any "standard" names for..         


Author: Albert van der Horst
Date: Feb 26, 2008 16:20

In article <8f25b5d2-4ce8-4cfd-a539-6d2413083f8e@o77g2000hsf.googlegroups.com>,
Bruce McFarling netscape.net> wrote:
>On Feb 26, 9:01 am, Henry wrote:
>> MacForth refers to a b -- a a b as UNDERDUP
>> It also has a word UNDER+ which gives a b c -- a+c b
>
>The last time this arose, there was some support for DUP-UNDER
>as being more expressive.

Impressive. It saves one letter compared to OVER SWAP which is arguably
even more expressive. 1]

Groetjes Albert

1] Oops. It doesn't. My wrong. Now what?

--
--
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- like all pyramid schemes -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst
no comments
1 2 3