Paste: pivot/dummy dispatch

Author: rien
Mode: factor
Date: Fri, 4 Nov 2011 06:17:59
Plain Text |
; dummy dispatching
( scratchpad ) TUPLE: dummy ;
( scratchpad ) C: <o> dummy
( scratchpad ) GENERIC# testpivot 1 ( str/n pivot str/n -- n+n )

( scratchpad ) M: dummy testpivot [ drop ] dip dup string? [ string>number + ] [ swap string>number + ] if ;

( scratchpad ) "3" <o> 4 testpivot

--- Data stack:
7
( scratchpad ) 3 <o> "4" testpivot

--- Data stack:
7
7

New Annotation

Summary:
Author:
Mode:
Body: