     { [ drop ] [ ] [ first2 ] [ first3 ] [ first4 ] } nth ;
 
 : #in ( word -- n )
-    stack-effect effect-in length ;
+    stack-effect in>> length ;
 
 : #out ( word -- n )
-    stack-effect effect-out length ;
+    stack-effect out>> length ;
 
 : pack/unpack ( quot word -- newquot )
     [ dup #in unpacker % swap % #out packer % ] [ ] make ;

        #out unpacker %
    ] [ ] make ;

: check-memoized ( word -- )
    dup #in 4 > swap #out 4 > or [
        "There must be no more than 4 input and 4 output arguments" throw
    ] when ;

: define-memoized ( word quot -- )
    over check-memoized

! Copyright (C) 2007 Slava Pestov, Daniel Ehrenberg.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel hashtables sequences arrays words namespaces
parser math assocs effects definitions quotations summary
accessors ;
IN: memoize

: packer ( n -- quot )
