]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/fry/fry.factor
Updating code for make and fry changes
[factor.git] / basis / fry / fry.factor
index af7da07d27ec80211845c23108e653cd5e05d1c9..712e1528cd9c8ea50f18bd47681bf95a43dc49e0 100755 (executable)
@@ -2,10 +2,9 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: kernel sequences combinators parser splitting math
 quotations arrays make qualified words ;
-QUALIFIED: make
 IN: fry
 
-: , ( -- * ) "Only valid inside a fry" throw ;
+: _ ( -- * ) "Only valid inside a fry" throw ;
 : @ ( -- * ) "Only valid inside a fry" throw ;
 
 <PRIVATE
@@ -22,24 +21,21 @@ DEFER: shallow-fry
 : (shallow-fry) ( accum quot -- result )
     [ 1quotation ] [
         unclip {
-            { \ , [ [ curry ] ((shallow-fry)) ] }
+            { \ , [ "Oops!!" throw ] }
+            { \ _ [ [ curry ] ((shallow-fry)) ] }
             { \ @ [ [ compose ] ((shallow-fry)) ] }
-
-            ! to avoid confusion, remove if fry goes core
-            { \ make:, [ [ curry ] ((shallow-fry)) ] }
-
             [ swap >r suffix r> (shallow-fry) ]
         } case
     ] if-empty ;
 
 : shallow-fry ( quot -- quot' ) [ ] swap (shallow-fry) ;
 
-PREDICATE: fry-specifier < word { , make:, @ } memq? ;
+PREDICATE: fry-specifier < word { _ @ , } memq? ;
 
 GENERIC: count-inputs ( quot -- n )
 
 M: callable count-inputs [ count-inputs ] sigma ;
-M: fry-specifier count-inputs drop 1 ;
+M: fry-specifier count-inputs \ , eq? [ "Oops!!" throw ] when 1 ;
 M: object count-inputs drop 0 ;
 
 PRIVATE>
@@ -48,8 +44,8 @@ PRIVATE>
     [
         [
             dup callable? [
-                [ count-inputs \ , <repetition> % ] [ fry % ] bi
-            ] [ make:, ] if
+                [ count-inputs \ _ <repetition> % ] [ fry % ] bi
+            ] [ , ] if
         ] each
     ] [ ] make shallow-fry ;