core: working on fry/locals
parent
f5c75922ec
commit
9c7c8cd9dd
|
@ -169,7 +169,13 @@ IN: bootstrap.syntax
|
|||
"}}"
|
||||
":::"
|
||||
"q[["
|
||||
"{{"
|
||||
"'{{"
|
||||
"q[["
|
||||
"q{{"
|
||||
"{{"
|
||||
"'{{"
|
||||
"H{{"
|
||||
"'H{{"
|
||||
"'[["
|
||||
} [ "syntax" create-word drop ] each
|
||||
] with-compilation-unit
|
||||
|
|
|
@ -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 <lambda> [ call ] curry ;
|
||||
]]
|
||||
]]
|
||||
|
|
|
@ -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: :>
|
||||
|
|
|
@ -56,8 +56,14 @@ M: callable rewrite-closures*
|
|||
[ length \ curry <repetition> % ]
|
||||
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>> [
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -472,9 +472,10 @@ IN: bootstrap.syntax
|
|||
|
||||
|
||||
"q{{" [
|
||||
! \ }} parse-until >quotation [ output>array ] curry
|
||||
! <fryable> suffix!
|
||||
\ }} parse-until >array <fryable> suffix!
|
||||
\ }} parse-until
|
||||
>quotation [ output>array ] curry
|
||||
<fryable> 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
|
||||
<fryable> suffix!
|
||||
] define-core-syntax
|
||||
|
||||
"'{{" [
|
||||
\ }} parse-until
|
||||
>quotation [ { } output>sequence ] curry
|
||||
<fryable> suffix!
|
||||
] define-core-syntax
|
||||
|
||||
"'H{{" [
|
||||
\ }} parse-until
|
||||
>quotation [ H{ } output>assoc ] curry
|
||||
<fryable> suffix!
|
||||
] define-core-syntax
|
||||
|
||||
] with-compilation-unit
|
||||
|
|
Loading…
Reference in New Issue