In the following I will always show you an 8th word followed by it's SED (Stack Effect diagram).
Also I will add pictures to enhance the explanation visually.
=======================================================================
drop \ x --
The drop word takes an item from TOS (Top Of Stack) and "drops" it. Effectively it just removes that item from the stack.
Stack before drop: Stack after drop:
<--- item removed
In the pictures you see the same pattern. The TOS item (light blue) is removed from TOS.
=======================================================================
2drop \ x y --
The word 2drop does exactly the same as two consecutive drop words.
Stack before 2drop: Stack after 2drop:
<---
2 items removed
<---
Later on in this series I will show you how you could easily define your own words for e.g. 4drop .etc.
=======================================================================
swap \ x y -- y x
This word swaps the two topmost items on the stack.
Stack before swap: Stack after swap:
<--->
2 items swapped
<--->
<--->
=======================================================================
over \ x y -- x y x
This word copies the second item on the stack and puts the copy at TOS.
Stack before over: Stack after over:
<-------------------------
|
|
> item copied to -
=======================================================================
nip \ x y -- y
This word removes the second item from the stack. It is like drop, but then for the second item.
Stack before nip: Stack after nip:
] middle item
] removed
] removed
=======================================================================
That should be enough for today.
In the next article I hope to write about a bit more advanced 8th words.
If you follow these tutorials along, you will get a thorough knowledge of the language in the end.
For more information please visit: http://8th-dev.com/
There you can also find a very friendly forum, where the developer himself will answer your questions patiently!
There you can also download a completely free version you can play with!




