|
|
Up |
|
|
  |
Author: m_l_g3m_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 |
|
  |
Author: Elizabeth D RatherElizabeth D Rather Date: Mar 5, 2008 12:23
> 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 |
|
  |
Author: Bruce McFarlingBruce McFarling Date: Mar 5, 2008 12:45
> 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 |
|
  |
Author: m_l_g3m_l_g3 Date: Mar 6, 2008 04:08
On Mar 5, 11:23 pm, Elizabeth D Rather forth.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 |
|
  |
Author: Andrew HaleyAndrew Haley Date: Mar 6, 2008 04:51
> On Mar 5, 11:23 pm, Elizabeth D Rather forth.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 |
|
  |
Author: Alex McDonaldAlex McDonald Date: Mar 6, 2008 07:01
> On Mar 5, 11:23 pm, Elizabeth D Rather forth.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 |
|
  |
Author: Jerry AvinsJerry Avins Date: Mar 6, 2008 07:12
Andrew Haley wrote:
>> On Mar 5, 11:23 pm, Elizabeth D Rather forth.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 |
|
  |
Author: Albert van der HorstAlbert van der Horst Date: Mar 6, 2008 07:39
>On Mar 5, 11:23 pm, Elizabeth D Rather forth.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 |
|
  |
Author: Bruce McFarlingBruce 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 |
|
  |
|
|
  |
Author: Marcel HendrixMarcel 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 |
|
|
|
|