2008-12-06 05:57:38 -05:00
|
|
|
! Copyright (C) 2007, 2008 Slava Pestov, Eduardo Cavazos.
|
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
|
|
|
USING: accessors fry fry.private generalizations kernel
|
2009-11-07 14:03:46 -05:00
|
|
|
locals.types sequences ;
|
2008-12-06 05:57:38 -05:00
|
|
|
IN: locals.fry
|
|
|
|
|
|
|
|
! Support for mixing locals with fry
|
|
|
|
|
2009-10-27 15:19:05 -04:00
|
|
|
M: let count-inputs body>> count-inputs ;
|
2008-12-06 05:57:38 -05:00
|
|
|
M: lambda count-inputs body>> count-inputs ;
|
|
|
|
|
2009-11-07 14:03:46 -05:00
|
|
|
M: lambda fry
|
|
|
|
clone [ [ count-inputs ] [ fry ] bi ] change-body
|
|
|
|
[ [ vars>> length ] keep '[ _ _ mnswap _ call ] ]
|
2009-11-07 15:38:06 -05:00
|
|
|
[ drop [ncurry] curry [ call ] compose ] 2bi ;
|
2009-11-07 14:03:46 -05:00
|
|
|
|
|
|
|
M: let fry
|
|
|
|
clone [ fry ] change-body ;
|
2008-12-06 05:57:38 -05:00
|
|
|
|
2009-11-07 14:03:46 -05:00
|
|
|
INSTANCE: lambda fried
|
|
|
|
INSTANCE: let fried
|