diff --git a/core/bootstrap/syntax.factor b/core/bootstrap/syntax.factor index 2ec1eaebe6..83377aa4cd 100644 --- a/core/bootstrap/syntax.factor +++ b/core/bootstrap/syntax.factor @@ -169,7 +169,13 @@ IN: bootstrap.syntax "}}" ":::" "q[[" - "{{" + "'{{" + "q[[" "q{{" + "{{" + "'{{" + "H{{" + "'H{{" + "'[[" } [ "syntax" create-word drop ] each ] with-compilation-unit diff --git a/core/fry/fry.factor b/core/fry/fry.factor index 9b0746631b..5dcd08989a 100644 --- a/core/fry/fry.factor +++ b/core/fry/fry.factor @@ -1,8 +1,7 @@ ! Copyright (C) 2009 Slava Pestov, Eduardo Cavazos, Joe Groff. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors assocs combinators kernel locals.backend -locals.parser locals.types math math.parser quotations sequences -sequences.extras sequences.private sets splitting words ; +USING: accessors combinators kernel locals.backend math +math.parser quotations sequences sets splitting words ; IN: fry TUPLE: fryable quot ; @@ -186,4 +185,4 @@ M: callable fry ( quot -- quot' ) ] keep ! { _ 1 2 3 _ } [ [ \ _ eq? ] find-all keys ] keep set-nths* 1quotation [ call ] curry ; - ]] \ No newline at end of file + ]] diff --git a/core/locals/locals.factor b/core/locals/locals.factor index 4f9b0fc3c8..6a626858b5 100644 --- a/core/locals/locals.factor +++ b/core/locals/locals.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2007, 2009 Slava Pestov, Eduardo Cavazos. ! See http://factorcode.org/license.txt for BSD license. -USING: fry kernel lexer locals.errors locals.parser locals.types -macros memoize namespaces sequences vocabs vocabs.loader words ; +! USING: fry kernel lexer locals.errors locals.parser locals.types +! macros memoize namespaces sequences vocabs vocabs.loader words ; IN: locals ! SYNTAX: :> diff --git a/core/locals/rewrite/closures/closures.factor b/core/locals/rewrite/closures/closures.factor index 9ab07352fc..32b02216e5 100644 --- a/core/locals/rewrite/closures/closures.factor +++ b/core/locals/rewrite/closures/closures.factor @@ -56,8 +56,14 @@ M: callable rewrite-closures* [ length \ curry % ] tri ; +! almost good +M: fryable rewrite-closures* quot>> fry rewrite-closures* \ call , ; + +! M: fryable rewrite-closures* B quot>> fry (rewrite-closures) % ; + +! M: fryable rewrite-closures* B quot>> fry rewrite-closures* ; + ![[ -! M: fryable rewrite-closures* quot>> fry rewrite-closures* \ call , ; M: fryable rewrite-closures* B quot>> [ diff --git a/core/syntax/modern/modern.factor b/core/syntax/modern/modern.factor index 67694dfd84..3fcaf533e3 100644 --- a/core/syntax/modern/modern.factor +++ b/core/syntax/modern/modern.factor @@ -144,7 +144,7 @@ ERROR: no-paren-container-word payload word ; : strict-single-quote? ( string -- ? ) dup (strict-single-quote?) - [ "'[" sequence= not ] [ drop f ] if ; + [ { "'[" "'[[" "'{{" "'H{{" } member? not ] [ drop f ] if ; : strict-double-quote? ( string -- ? ) ?last char: \" = ; @@ -181,4 +181,3 @@ ERROR: no-paren-container-word payload word ; \ no-op "data-stack" set-lower-colon-word ! USE: urls \ >url "url" set-container-word - diff --git a/core/syntax/syntax.factor b/core/syntax/syntax.factor index feffbe651b..a018328b17 100644 --- a/core/syntax/syntax.factor +++ b/core/syntax/syntax.factor @@ -472,9 +472,10 @@ IN: bootstrap.syntax "q{{" [ - ! \ }} parse-until >quotation [ output>array ] curry - ! suffix! - \ }} parse-until >array suffix! + \ }} parse-until + >quotation [ output>array ] curry + suffix! + \ call suffix! ] define-core-syntax "{{" [ @@ -482,4 +483,27 @@ IN: bootstrap.syntax >quotation [ output>array ] curry append! ] define-core-syntax + "H{{" [ + \ }} parse-until + >quotation [ H{ } output>assoc ] curry append! + ] define-core-syntax + + "'[[" [ + \ ]] parse-until + >quotation [ [ ] output>sequence ] curry + suffix! + ] define-core-syntax + + "'{{" [ + \ }} parse-until + >quotation [ { } output>sequence ] curry + suffix! + ] define-core-syntax + + "'H{{" [ + \ }} parse-until + >quotation [ H{ } output>assoc ] curry + suffix! + ] define-core-syntax + ] with-compilation-unit