         ] bi
     ] if-empty ;
 
-SYNTAX: '[ parse-quotation fry append! ;
+SYNTAX: '[ t in-fry? [ parse-quotation ] with-variable fry append! ;

! Copyright (C) 2009 Slava Pestov, Eduardo Cavazos, Joe Groff.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors combinators kernel locals.backend math parser
quotations sequences sets splitting words ;
IN: fry

: _ ( -- * ) "Only valid inside a fry" throw ;
: @ ( -- * ) "Only valid inside a fry" throw ;

ERROR: >r/r>-in-fry-error ;


    [ >quotation 1quotation prefix ] if-empty ;

: mark-composes ( quot -- quot' )
    [ dup \ @ = [ drop [ POSTPONE: _ POSTPONE: @ ] ] [ 1quotation ] if ] map concat ; inline

: shallow-fry ( quot -- quot' )
    check-fry mark-composes
    { POSTPONE: _ } split convert-curries
    [ [ [ ] ] [ [ ] (make-curry) but-last ] if-zero ]
    [ shallow-spread>quot swap [ [ ] (make-curry) compose ] unless-zero ] if-empty ;

