2011/10/1 Slava Pestov sl...@factorcode.org
Hi Michele,
On Fri, Sep 30, 2011 at 2:53 PM, Michele Pes mp8...@rambler.ru wrote:
To achieve this, I wrote this word:
: when-drop ( obj question-quot: ( obj -- ? ) true-quot: ( obj -- ) -- )
-rot dupd call swapd [ call ] [ 2drop ] if ;
Hi to all!
While writing my little factor programs, I often find a situation in
which I have an object,
I test it and if test is ok then some action is performed on it, else it
is simply dropped.
Ex.: (obj on top of stack)
dup test-condition [ do something with obj ] [ drop ] if
I think this
On Sep 30, 2011, at 2:53 PM, Michele Pes wrote:
Hi to all!
While writing my little factor programs, I often find a situation in
which I have an object,
I test it and if test is ok then some action is performed on it, else it
is simply dropped.
Ex.: (obj on top of stack)
dup
Hi Michele,
On Fri, Sep 30, 2011 at 2:53 PM, Michele Pes mp8...@rambler.ru wrote:
To achieve this, I wrote this word:
: when-drop ( obj question-quot: ( obj -- ? ) true-quot: ( obj -- ) -- )
-rot dupd call swapd [ call ] [ 2drop ] if ; inline
Here is a simpler version that doesn't use