name for 3 PICK finally?
  Home FAQ Contact Sign in
comp.lang.forth only
 
Advanced search
POPULAR GROUPS

more...

comp.lang.forth Profile…
 Up
name for 3 PICK finally?         


Author: m_l_g3
Date: Mar 5, 2008 11:11

Some years passed since I have stopped using Forth... But today I
found that I miss a good name for 3 pick.

: DUP 0 PICK ;
: OVER 1 PICK ;
: PLUCK 2 PICK ;
: ??? 3 PICK ;

I thought about 3rd and 4th (or third and forth), and even defined
them,
but could not make myself use them and finally (yes!)
refactored the code instead, so that it uses only PLUCK and no 3 PICK.
(But if there was a name, the 3pick version would be better.)

Has anyone finally invented a good name for 3 PICK ?
85 Comments
Re: name for 3 PICK finally?         


Author: Elizabeth D Rather
Date: Mar 5, 2008 12:23

m_l_g3@yahoo.com wrote:
> Some years passed since I have stopped using Forth... But today I
> found that I miss a good name for 3 pick.
>
> : DUP 0 PICK ;
> : OVER 1 PICK ;
> : PLUCK 2 PICK ;
> : ??? 3 PICK ;
>
> I thought about 3rd and 4th (or third and forth), and even defined
> them,
> but could not make myself use them and finally (yes!)
> refactored the code instead, so that it uses only PLUCK and no 3 PICK.
> (But if there was a name, the 3pick version would be better.)
>
>
> Has anyone finally invented a good name for 3 PICK ?

Unless it's used a lot, it doesn't need a name. And if it *is* used a
lot, you need to re-polish your Forth skills.
Show full article (1.07Kb)
no comments
Re: name for 3 PICK finally?         


Author: Bruce McFarling
Date: Mar 5, 2008 12:45

On Mar 5, 2:11 pm, m_l...@yahoo.com wrote:
> Some years passed since I have stopped using Forth... But today I
> found that I miss a good name for 3 pick.
> : DUP 0 PICK ;
> : OVER 1 PICK ;
> : PLUCK 2 PICK ;
> : ??? 3 PICK ;
> I thought about 3rd and 4th (or third and forth), and even defined
> them,
> but could not make myself use them and finally (yes!)
> refactored the code instead, so that it uses only PLUCK and no 3 PICK.
> (But if there was a name, the 3pick version would be better.)
> Has anyone finally invented a good name for 3 PICK ?

I like calling it ``2OVER DROP'', since its main use would be getting
to the bottom part of the second of a composite stack item, like

( ca1 u2 ca2 u2 -- ca1 u2 ca2 u2 ca1 )
Show full article (1.05Kb)
no comments
Re: name for 3 PICK finally?         


Author: m_l_g3
Date: Mar 6, 2008 04:08

On Mar 5, 11:23 pm, Elizabeth D Rather forth.com> wrote:
> m_l...@yahoo.com wrote:
>> Some years passed since I have stopped using Forth... But today I
>> found that I miss a good name for 3 pick.
>
>> : DUP 0 PICK ;
>> : OVER 1 PICK ;
>> : PLUCK 2 PICK ;
>> : ??? 3 PICK ;
>
>> I thought about 3rd and 4th (or third and forth), and even defined
>> them,
>> but could not make myself use them and finally (yes!)
>> refactored the code instead, so that it uses only PLUCK and no 3 PICK.
>> (But if there was a name, the 3pick version would be better.)
>
>> Has anyone finally invented a good name for 3 PICK ?
>
> Unless it's used a lot, it doesn't need a name. And if it *is* used a
> lot, you need to re-polish your Forth skills. ...
Show full article (0.83Kb)
no comments
Re: name for 3 PICK finally?         


Author: Andrew Haley
Date: Mar 6, 2008 04:51

m_l_g3@yahoo.com wrote:
> On Mar 5, 11:23 pm, Elizabeth D Rather forth.com> wrote:
>> m_l...@yahoo.com wrote:
>>> Some years passed since I have stopped using Forth... But today I
>>> found that I miss a good name for 3 pick.
>>
>>> : DUP 0 PICK ;
>>> : OVER 1 PICK ;
>>> : PLUCK 2 PICK ;
>>> : ??? 3 PICK ;
>>
>>> I thought about 3rd and 4th (or third and forth), and even defined
>>> them,
>>> but could not make myself use them and finally (yes!)
>>> refactored the code instead, so that it uses only PLUCK and no 3 PICK.
>>> (But if there was a name, the 3pick version would be better.)
>>
>>> Has anyone finally invented a good name for 3 PICK ?
>>
>> Unless it's used a lot, it doesn't need a name. And if it *is* used a ...
Show full article (1.33Kb)
no comments
Re: name for 3 PICK finally?         


Author: Alex McDonald
Date: Mar 6, 2008 07:01

On Mar 6, 12:08 pm, m_l...@yahoo.com wrote:
> On Mar 5, 11:23 pm, Elizabeth D Rather forth.com> wrote:
>
>
>
>> m_l...@yahoo.com wrote:
>>> Some years passed since I have stopped using Forth... But today I
>>> found that I miss a good name for 3 pick.
>
>>> : DUP 0 PICK ;
>>> : OVER 1 PICK ;
>>> : PLUCK 2 PICK ;
>>> : ??? 3 PICK ;
>
>>> I thought about 3rd and 4th (or third and forth), and even defined
>>> them,
>>> but could not make myself use them and finally (yes!)
>>> refactored the code instead, so that it uses only PLUCK and no 3 PICK.
>>> (But if there was a name, the 3pick version would be better.)
> ...
Show full article (1.15Kb)
2 Comments
Re: name for 3 PICK finally?         


Author: Jerry Avins
Date: Mar 6, 2008 07:12

Andrew Haley wrote:
> m_l_g3@yahoo.com wrote:
>> On Mar 5, 11:23 pm, Elizabeth D Rather forth.com> wrote:
>>> m_l...@yahoo.com wrote:
>>>> Some years passed since I have stopped using Forth... But today I
>>>> found that I miss a good name for 3 pick.
>>>> : DUP 0 PICK ;
>>>> : OVER 1 PICK ;
>>>> : PLUCK 2 PICK ;
>>>> : ??? 3 PICK ;
>>>> I thought about 3rd and 4th (or third and forth), and even defined
>>>> them,
>>>> but could not make myself use them and finally (yes!)
>>>> refactored the code instead, so that it uses only PLUCK and no 3 PICK.
>>>> (But if there was a name, the 3pick version would be better.)
>>>> Has anyone finally invented a good name for 3 PICK ?
>>> Unless it's used a lot, it doesn't need a name. And if it *is* used a
>>> lot, you need to re-polish your Forth skills.
>
>> IMO, a separate idea deserves a name, regardless of how often it is ...
Show full article (1.71Kb)
no comments
Re: name for 3 PICK finally?         


Author: Albert van der Horst
Date: Mar 6, 2008 07:39

In article <8e18046b-9970-4748-af73-b301d7f4aec9@u10g2000prn.googlegroups.com>,
yahoo.com> wrote:
>On Mar 5, 11:23 pm, Elizabeth D Rather forth.com> wrote:
>> m_l...@yahoo.com wrote:
>>
>>> Has anyone finally invented a good name for 3 PICK ?
>>
>> Unless it's used a lot, it doesn't need a name. And if it *is* used a
>> lot, you need to re-polish your Forth skills.
>
>IMO, a separate idea deserves a name, regardless of how often it is
>used.

A separate idea, yes. If in a certain context it means
GET-FP-ACCURACY then give it that name, *within an application*.
(Even then this is dubious Forth skill, as Elizabeth said.)

Trying to come up with a name across all applications is tantamount
to destroying Forth as a practical language.

Groetjes Albert
Show full article (0.97Kb)
no comments
Re: name for 3 PICK finally?         


Author: Bruce McFarling
Date: Mar 6, 2008 08:22

On Mar 6, 7:51 am, Andrew Haley
wrote:
> Firstly, 3 PICK isn't a separate idea from 2 PICK: in both cases it's
> a red flag to the reader that you're using the stack as an array.

Quite so ... the place where it is not using the stack as an array is
when pulling out the char address of the second of two string
descriptors, or similarly the second part of the second of some other
paired data item or the LSCell of the second of a pair of doubles on
the stack.

And of course in all those cases, which would not be uncommon when
synthesizing a dyadic operation involving tuples, in pulling out the
second part of a tuple in synthesizing a dyadic operations on cell-
pair items, 2OVER DROP is more descriptive. Indeed, its not unusual
when factoring for the DROP to hide inside the factor so that the
factor just takes the type of cell-pair being worked with as its
argument.
> Secondly, every reader is instantly going to know what 3 PICK does,
> and giving it a name makes the code harder to read, not easier.
Show full article (1.22Kb)
no comments
Re: name for 3 PICK finally?         


Author: Marcel Hendrix
Date: Mar 6, 2008 11:04

Alex McDonald rivadpm.com> writes Re: name for 3 PICK finally?
[..]
> I can count the number of times
> I've used 2 PICK on one finger, and 3 PICK on none.

And that proves ... what?

13,984 *.frt files

Searching for: 2 PICK
Found 285 occurrence(s)

Searching for: 3 PICK
Found 177 occurrence(s)

-marcel
no comments
1 2 3 4 5 6 7 8 9