PLUCK vs THIRD 
Author Message
 PLUCK vs THIRD

2PLUCK sounds very naturally, but 2THIRD does not.

(Wil Baden, what would you say?)



Fri, 08 Apr 2005 01:28:43 GMT  
 PLUCK vs THIRD
On Sun, 20 Oct 2002 21:28:43 +0400

Quote:

> 2PLUCK sounds very naturally, but 2THIRD does not.

> (Wil Baden, what would you say?)

2THIRD exactly explains itself, 'pluck' does not.

hp

--
   >>> pse, reply to : clf -at- lxhp -dot- in-berlin -dot- de <<<
Linux,Assembly,Forth: http://www.lxhp.in-berlin.de/index-lx.shtml en/de



Fri, 08 Apr 2005 19:26:59 GMT  
 PLUCK vs THIRD

Quote:

> 2PLUCK sounds very naturally, but 2THIRD does not.

> (Wil Baden, what would you say?)

2OVER4

In 1983 I introduced PLUCK in F83, as well as PLACE, +PLACE, and
C+PLACE.

In 1986 I generalized: wOVERd and wDROPd where w is width and d is
depth.  wDROPd could be read "drop w (elements) at the beginning
leaving d".  wOVERd is "copy w (elements) over d".

w is non-zero.  Its default is 1.  d may be 0.  Its default is w.

wDUP = wOVER0, wOVER = wOVERw, OVERd = 1OVERd, wDROP = wDROP0, DROP =
1DROP0, NIP = 1DROP1.

PLUCK = OVER2.  PLUCK satisfies the wish for a short word, but it's
artificial with no association with the depth - OVER2 is better.

Rick VanNorman Introduced THIRD and FOURTH for OVER2 and OVER3. For
single elements, DUP OVER THIRD FOURTN are better than OVER0 OVER1
OVER2 OVER3.

To answer the question, 2OVER4 is better than 2PLUCK or 2THIRD.

-------------------------------

wOVERd and wDROPd are complete. All stack movement can be done with
them.

2ROT = 2OVER4 2DROP6
3SWAP = 3OVER3 3DROP6
2NIP = 2DROP2
NIP NIP = 2DROP1

wSWAPd would still be convenient.
wSWAPd is "swap w (elements) over d".

wSWAP = wSWAPw

ROT = 1SWAP2
-ROT = 2SWAP1
d PICK = 1OVERd
d ROLL = 1SWAPd
d -ROLL = dSWAP1
2ROT = 2SWAP4
the inverse of 2ROT = 4SWAP2

The motion in ROT and ROLL and SWAP is always "over".

-------------------------------

The inverse of wOVERd should be wUNDERd.  This would be used to
avoid deleting in the stack.

-------------------------------

These should not be provided unless needed for the application.

The non-Standard stack words that I use are:


SPLIT/ and /SPLIT are also stack words.

: SPLIT/  2dup ;
: /SPLIT  2SWAP THIRD - ;

and I guess BOUNDS is as well.

I don't use -ROT.  I expect ROT ROT to be compiled as the inverse of
ROT.  If the compiler is too stupid to do that, shrug.

(As it happens, the system I'm using doesn't have -ROT.)

--



Fri, 08 Apr 2005 21:55:43 GMT  
 PLUCK vs THIRD


Quote:


> > 2PLUCK sounds very naturally, but 2THIRD does not.

> > (Wil Baden, what would you say?)

> 2OVER4

    Ambiguous.  Is that 4 singles or 4 doubles?

--

-Gary Chanson (MVP for Windows SDK)
-Software Consultant (Embedded systems and Real Time Controls)

-War is the last resort of the incompetent.



Sat, 09 Apr 2005 02:38:39 GMT  
 PLUCK vs THIRD

Quote:

> In 1986 I generalized: wOVERd and wDROPd where w is width and d is
> depth.  wDROPd could be read "drop w (elements) at the beginning
> leaving d".  wOVERd is "copy w (elements) over d".

"at the beginning" seems misleading.  How about:
   drop w (elements) preserving d


Sat, 09 Apr 2005 04:44:41 GMT  
 PLUCK vs THIRD
In article

Quote:

> > 2PLUCK sounds very naturally, but 2THIRD does not.
> 2THIRD exactly explains itself, 'pluck' does not.

Quite so.  Hence  2OVER4

--
Wil



Sat, 09 Apr 2005 05:11:39 GMT  
 PLUCK vs THIRD

Quote:

> Quite so.  Hence  2OVER4

What would be the equivalent syntax using PICK ?

Jeff



Sat, 09 Apr 2005 05:43:46 GMT  
 PLUCK vs THIRD

Quote:





>>>2PLUCK sounds very naturally, but 2THIRD does not.

>>>(Wil Baden, what would you say?)

>>2OVER4

>     Ambiguous.  Is that 4 singles or 4 doubles?

Wil's definition for the pattern made it plain that all numbers are in
stack elements ("singles").

The pattern is not defining any new type.  It is a stack transformation
pattern.

Jim



Sat, 09 Apr 2005 08:25:55 GMT  
 PLUCK vs THIRD


Quote:
> "at the beginning" seems misleading.  How about:
>    drop w (elements) preserving d

I put "at the beginning" in to tell which values were dropped.  How
about "from the beginning"?

Or stack effect?

wOVERd
    ( x1 ... xw y1 ... yd -- x1 ... xw y1 ...yd x1 ... xw )

wDROPd
    ( x1 ... xw y1 ... yd -- y1 ...yd )

wUNDERd
    ( x1 ... xw y1 ... yd z1 ... zw -- x1 ... z1 ... zw y1 ...yd  )

--
Wil



Sat, 09 Apr 2005 08:25:38 GMT  
 PLUCK vs THIRD

Quote:

> What would be the equivalent syntax using PICK ?

5 PICK 5 PICK

In general,  "w+d-1 PICK"  w times.

--
Wil



Sat, 09 Apr 2005 08:37:28 GMT  
 PLUCK vs THIRD
Wil,

"from the beginning" is better, but the stack diagrams pin it down
precisely!  After reading the messages about F>D, it's obvious that
prose descriptions are not always understood;)

Ron

Quote:



>>"at the beginning" seems misleading.  How about:
>>   drop w (elements) preserving d

> I put "at the beginning" in to tell which values were dropped.  How
> about "from the beginning"?

> Or stack effect?

> wOVERd
>     ( x1 ... xw y1 ... yd -- x1 ... xw y1 ...yd x1 ... xw )

> wDROPd
>     ( x1 ... xw y1 ... yd -- y1 ...yd )

> wUNDERd
>     ( x1 ... xw y1 ... yd z1 ... zw -- x1 ... z1 ... zw y1 ...yd  )



Sat, 09 Apr 2005 08:55:19 GMT  
 
 [ 11 post ] 

 Relevant Pages 

1. wOVERd and wUNDERd (Was: PLUCK and THIRD)

2. a name for PLUCK PLUCK

3. Pluck Specific Headers /reassemble on one line.

4. Plucking images from a stream at fixed rate.

5. stdcall vs c vs cdecl vs pascal vs whosyerdaddy

6. 68K vs CFM68K vs Tk 8.0.3 vs AppearanceLib vs System 7

7. MASM vs TASM vs VC++ vs DJGPP vs A*^ vs PCC vs DEBUG,, "Hello World!"

8. MASM vs TASM vs VC++ vs DJGPP vs A*^ vs PCC vs DEBUG,, "Hello World!"

9. ST vs Java vs ST vs ....

10. API vs Internal vs Public vs Private in Envy/QA

11. VO vs DELPHI vs FOXPRO(Windows) vs DBASE(Windows)

12. Cellular automata benchmarks: Java vs C++ vs Java vs C++

 

 
Powered by phpBB® Forum Software