|
From: Slava P. <sl...@fa...> - 2011-10-01 00:16:32
|
Hi Michele,
On Fri, Sep 30, 2011 at 2:53 PM, Michele Pes <mp...@ra...> 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 locals:
: when-drop ( obj question-quot: ( obj -- ? ) true-quot: ( obj -- ) -- )
[ dup ] 2dip [ drop ] if ; inline
Slava
|