diff --git a/benchmarks/benchmark/fasta/fasta.factor b/benchmarks/benchmark/fasta/fasta.factor index f299445e55..c6a2b6bcfb 100644 --- a/benchmarks/benchmark/fasta/fasta.factor +++ b/benchmarks/benchmark/fasta/fasta.factor @@ -74,7 +74,7 @@ TYPED:: make-repeat-fasta ( k: fixnum len: fixnum alu: string -- k': fixnum ) : write-repeat-fasta ( n alu desc id -- ) write-description - [let + let[ :> alu 0 :> k! [| len | k len alu make-repeat-fasta k! ] split-lines @@ -83,7 +83,7 @@ TYPED:: make-repeat-fasta ( k: fixnum len: fixnum alu: string -- k': fixnum ) : fasta ( n out -- ) homo-sapiens make-cumulative IUB make-cumulative - [let + let[ :> ( n out IUB-chars IUB-floats homo-sapiens-chars homo-sapiens-floats ) initial-seed :> seed diff --git a/core-locals.factor b/core-locals.factor index 049087e62a..87c0aca693 100644 --- a/core-locals.factor +++ b/core-locals.factor @@ -18,7 +18,7 @@ use: delegate.private << forget: _ >> << forget: @ >> << forget: postpone\ [| >> -<< forget: postpone\ [let >> +<< forget: postpone\ let[ >> << forget: postpone\ IH{ >> << forget: postpone\ PROTOCOL: >> << forget: postpone\ CONSULT: >> @@ -47,7 +47,7 @@ SYNTAX: :> SYNTAX: [| parse-lambda append! ; -SYNTAX: [let parse-let append! ; +SYNTAX: let[ parse-let append! ; SYNTAX: MEMO[ parse-quotation dup infer memoize-quot suffix! ; diff --git a/core/bootstrap/syntax.factor b/core/bootstrap/syntax.factor index 469ed8dd24..4979f6db37 100644 --- a/core/bootstrap/syntax.factor +++ b/core/bootstrap/syntax.factor @@ -117,7 +117,7 @@ in: bootstrap.syntax "SBUF\"" "::" "M::" "MEMO:" "MEMO::" "MACRO:" "MACRO::" "IDENTITY-MEMO:" "IDENTITY-MEMO::" "TYPED:" "TYPED::" - ":>" "[|" "[let" "MEMO[" + ":>" "[|" "let[" "MEMO[" "'[" "_" "@" diff --git a/core/locals/errors/errors.factor b/core/locals/errors/errors.factor index b4441ccaaf..79122570f3 100644 --- a/core/locals/errors/errors.factor +++ b/core/locals/errors/errors.factor @@ -12,7 +12,7 @@ M: >r/r>-in-lambda-error summary ERROR: let-form-in-literal-error ; M: let-form-in-literal-error summary - drop "[let not permitted inside literals" ; + drop "let[ not permitted inside literals" ; ERROR: local-writer-in-literal-error ; @@ -22,7 +22,7 @@ M: local-writer-in-literal-error summary ERROR: :>-outside-lambda-error ; M: :>-outside-lambda-error summary - drop ":> cannot be used outside of [let, [|, or :: forms" ; + drop ":> cannot be used outside of let[, [|, or :: forms" ; ERROR: bad-local args obj ; diff --git a/core/locals/locals-docs.factor b/core/locals/locals-docs.factor index 73cd266121..bace09f1ce 100644 --- a/core/locals/locals-docs.factor +++ b/core/locals/locals-docs.factor @@ -7,14 +7,14 @@ HELP: \ [| { $description "A literal quotation with named variable bindings. When the quotation is " { $link call } "ed, it will take values off the datastack and place them into the bindings from left to right. The body may then refer to these bindings. The quotation may also bind to named variables in an enclosing scope to create a closure." } { $examples "See " { $link "locals-examples" } "." } ; -HELP: \ [let -{ $syntax "[let code :> var code :> var code... ]" } -{ $description "Establishes a new scope for lexical variable bindings. Variables bound with " { $link postpone\ :> } " within the body of the " { $snippet "[let" } " will be lexically scoped to the body of the " { $snippet "[let" } " form." } +HELP: \ let[ +{ $syntax "let[ code :> var code :> var code... ]" } +{ $description "Establishes a new scope for lexical variable bindings. Variables bound with " { $link postpone\ :> } " within the body of the " { $snippet "let[" } " will be lexically scoped to the body of the " { $snippet "let[" } " form." } { $examples "See " { $link "locals-examples" } "." } ; HELP: \ :> { $syntax ":> var" ":> var!" ":> ( var-1 var-2 ... )" } -{ $description "Binds one or more new lexical variables. In the " { $snippet ":> var" } " form, the value on the top of the datastack is bound to a new lexical variable named " { $snippet "var" } " and is scoped to the enclosing quotation, " { $link postpone\ [let } " form, or " { $link postpone\ :: } " definition." +{ $description "Binds one or more new lexical variables. In the " { $snippet ":> var" } " form, the value on the top of the datastack is bound to a new lexical variable named " { $snippet "var" } " and is scoped to the enclosing quotation, " { $link postpone\ let[ } " form, or " { $link postpone\ :: } " definition." $nl "The " { $snippet ":> ( var-1 ... )" } " form binds multiple variables to the top values of the datastack in right to left order, with the last variable bound to the top of the datastack. These two snippets have the same effect:" { $code ":> c :> b :> a" } @@ -22,10 +22,10 @@ $nl $nl "If any " { $snippet "var" } " name is followed by an exclamation point (" { $snippet "!" } "), that new variable is mutable. See " { $link "locals-mutable" } " for more information." } { $notes - "This syntax can only be used inside a lexical scope established by a " { $link postpone\ :: } " definition, " { $link postpone\ [let } " form, or " { $link postpone\ [| } " quotation. Normal quotations have their own lexical scope only if they are inside an outer scope. Definition forms such as " { $link postpone\ : } " do not establish a lexical scope by themselves unless documented otherwise, nor is there a lexical scope available at the top level of source files or in the listener. " { $link postpone\ [let } " can be used to create a lexical scope where one is not otherwise available." } + "This syntax can only be used inside a lexical scope established by a " { $link postpone\ :: } " definition, " { $link postpone\ let[ } " form, or " { $link postpone\ [| } " quotation. Normal quotations have their own lexical scope only if they are inside an outer scope. Definition forms such as " { $link postpone\ : } " do not establish a lexical scope by themselves unless documented otherwise, nor is there a lexical scope available at the top level of source files or in the listener. " { $link postpone\ let[ } " can be used to create a lexical scope where one is not otherwise available." } { $examples "See " { $link "locals-examples" } "." } ; -{ postpone\ [let postpone\ :> } related-words +{ postpone\ let[ postpone\ :> } related-words HELP: \ :: { $syntax ":: word ( vars... -- outputs... ) body... ;" } @@ -78,10 +78,10 @@ in: scratchpad "2.0 -3.0" } -"If you wanted to perform the quadratic formula interactively from the listener, you could use " { $link postpone\ [let } " to provide a scope for the variables:" +"If you wanted to perform the quadratic formula interactively from the listener, you could use " { $link postpone\ let[ } " to provide a scope for the variables:" { $example "USING: locals math math.functions kernel ; in: scratchpad -[let 1.0 :> a 1.0 :> b -6.0 :> c +let[ 1.0 :> a 1.0 :> b -6.0 :> c b sq 4 a c * * - sqrt :> disc b neg disc [ + ] [ - ] 2bi [ 2 a * / ] bi@ ] [ . ] bi@" @@ -289,7 +289,7 @@ ARTICLE: "locals" "Lexical variables" } "Lexical scoping and binding forms:" { $subsections - postpone\ [let + postpone\ let[ postpone\ :> } "Quotation literals where the inputs are bound to lexical variables:" diff --git a/core/locals/locals-tests.factor b/core/locals/locals-tests.factor index 1cae375073..28426f718f 100644 --- a/core/locals/locals-tests.factor +++ b/core/locals/locals-tests.factor @@ -27,30 +27,30 @@ in: locals.tests { { 5 6 7 } } [ { 1 2 3 } 4 map-test-2 ] unit-test :: let-test ( c -- d ) - [let 1 :> a 2 :> b a b + c + ] ; + let[ 1 :> a 2 :> b a b + c + ] ; { 7 } [ 4 let-test ] unit-test :: let-test-2 ( a -- a ) - a [let :> a [let a :> b a ] ] ; + a let[ :> a let[ a :> b a ] ] ; { 3 } [ 3 let-test-2 ] unit-test :: let-test-3 ( a -- a ) - a [let :> a [let [ a ] :> b [let 3 :> a b ] ] ] ; + a let[ :> a let[ [ a ] :> b let[ 3 :> a b ] ] ] ; :: let-test-4 ( a -- b ) - a [let 1 :> a :> b a b 2array ] ; + a let[ 1 :> a :> b a b 2array ] ; { { 1 2 } } [ 2 let-test-4 ] unit-test :: let-test-5 ( a b -- b ) - a b [let :> a :> b a b 2array ] ; + a b let[ :> a :> b a b 2array ] ; { { 2 1 } } [ 1 2 let-test-5 ] unit-test :: let-test-6 ( a -- b ) - a [let :> a 1 :> b a b 2array ] ; + a let[ :> a 1 :> b a b 2array ] ; { { 2 1 } } [ 2 let-test-6 ] unit-test @@ -72,7 +72,7 @@ in: locals.tests { 5 } [ 2 "q" get call ] unit-test :: write-test-2 ( -- q ) - [let 0 :> n! [| i | n i + dup n! ] ] ; + let[ 0 :> n! [| i | n i + dup n! ] ] ; write-test-2 "q" set @@ -93,11 +93,11 @@ write-test-2 "q" set { } [ 1 2 write-test-3 call ] unit-test -:: write-test-4 ( x! -- q ) [ [let 0 :> y! f x! ] ] ; +:: write-test-4 ( x! -- q ) [ let[ 0 :> y! f x! ] ] ; { } [ 5 write-test-4 drop ] unit-test -:: let-let-test ( n -- n ) [let n 3 + :> n n ] ; +:: let-let-test ( n -- n ) let[ n 3 + :> n n ] ; { 13 } [ 10 let-let-test ] unit-test @@ -135,9 +135,9 @@ M:: string lambda-generic ( a b -- c ) a b lambda-generic-2 ; { } [ \ lambda-generic see ] unit-test -:: unparse-test-1 ( a -- ) [let 3 :> a! 4 :> b ] ; +:: unparse-test-1 ( a -- ) let[ 3 :> a! 4 :> b ] ; -{ "[let 3 :> a! 4 :> b ]" } [ +{ "let[ 3 :> a! 4 :> b ]" } [ \ unparse-test-1 "lambda" word-prop body>> first unparse ] unit-test @@ -177,11 +177,11 @@ M:: fixnum next-method-test ( a -- b ) a call-next-method 1 + ; { 3 0 } [| a b c | ] must-infer-as -{ } [ 1 [let :> a ] ] unit-test +{ } [ 1 let[ :> a ] ] unit-test -{ 3 } [ 1 [let :> a 3 ] ] unit-test +{ 3 } [ 1 let[ :> a 3 ] ] unit-test -{ } [ 1 2 [let :> a :> b ] ] unit-test +{ } [ 1 2 let[ :> a :> b ] ] unit-test :: a-word-with-locals ( a b -- ) ; @@ -239,10 +239,10 @@ M:: sequence method-with-locals ( a -- y ) a reverse ; { t } [ 12 &&-test ] unit-test :: let-and-cond-test-1 ( -- a ) - [let 10 :> a - [let 20 :> a + let[ 10 :> a + let[ 20 :> a { - { [ t ] [ [let 30 :> c a ] ] } + { [ t ] [ let[ 30 :> c a ] ] } } cond ] ] ; @@ -252,8 +252,8 @@ M:: sequence method-with-locals ( a -- y ) a reverse ; { 20 } [ let-and-cond-test-1 ] unit-test :: let-and-cond-test-2 ( -- pair ) - [let 10 :> A - [let 20 :> B + let[ 10 :> A + let[ 20 :> B { { [ t ] [ { A B } ] } } cond ] ] ; @@ -266,7 +266,7 @@ M:: sequence method-with-locals ( a -- y ) a reverse ; { { 10 20 } } [ 10 20 [| a b | { a b } ] call ] unit-test { { 10 20 30 } } [ 10 20 30 [| a b c | { a b c } ] call ] unit-test -{ { 10 20 30 } } [ [let 10 :> a 20 :> b 30 :> c { a b c } ] ] unit-test +{ { 10 20 30 } } [ let[ 10 :> a 20 :> b 30 :> c { a b c } ] ] unit-test { V{ 10 20 30 } } [ 10 20 30 [| a b c | V{ a b c } ] call ] unit-test @@ -388,7 +388,7 @@ M:: integer lambda-method-forget-test ( a -- b ) a ; { 10 } [ 10 [| A | { [ A ] } ] call first call ] unit-test [ - "USING: locals fry math ; 1 '[ [let 10 :> A A _ + ] ]" + "USING: locals fry math ; 1 '[ let[ 10 :> A A _ + ] ]" eval( -- ) call ] [ error>> >r/r>-in-fry-error? ] must-fail-with @@ -400,7 +400,7 @@ M:: integer lambda-method-forget-test ( a -- b ) a ; { t } [ 3 funny-macro-test ] unit-test { f } [ 2 funny-macro-test ] unit-test -[ "use: locals [let" eval( -- ) ] [ error>> unexpected-eof? ] must-fail-with +[ "use: locals let[" eval( -- ) ] [ error>> unexpected-eof? ] must-fail-with [ "use: locals [|" eval( -- ) ] [ error>> unexpected-eof? ] must-fail-with { 25 } [ 5 [| a | { [ a sq ] } cond ] call ] unit-test @@ -416,9 +416,9 @@ M:: integer lambda-method-forget-test ( a -- b ) a ; { 3 } [ 3 [| a | \ a ] call ] unit-test -[ "use: locals [| | { [let 0 :> a a ] } ]" eval( -- ) ] must-fail +[ "use: locals [| | { let[ 0 :> a a ] } ]" eval( -- ) ] must-fail -[ "use: locals [| | [let 0 :> a! { a! } ] ]" eval( -- ) ] must-fail +[ "use: locals [| | let[ 0 :> a! { a! } ] ]" eval( -- ) ] must-fail [ "use: locals [| | { :> a } ]" eval( -- ) ] must-fail @@ -431,13 +431,13 @@ M:: integer lambda-method-forget-test ( a -- b ) a ; { 3 } [ 2 [| | :> a! a 1 + a! a ] call ] unit-test : fry-locals-test-1 ( -- n ) - [let 6 '[ [let 4 :> A A _ + ] ] call ] ; + let[ 6 '[ let[ 4 :> A A _ + ] ] call ] ; \ fry-locals-test-1 def>> must-infer { 10 } [ fry-locals-test-1 ] unit-test :: fry-locals-test-2 ( -- n ) - [let 6 '[ [let 4 :> A A _ + ] ] call ] ; + let[ 6 '[ let[ 4 :> A A _ + ] ] call ] ; \ fry-locals-test-2 def>> must-infer { 10 } [ fry-locals-test-2 ] unit-test @@ -455,18 +455,18 @@ M:: integer lambda-method-forget-test ( a -- b ) a ; ] unit-test { 10 } [ - [| | 0 '[ [let 10 :> A A _ + ] ] call ] call + [| | 0 '[ let[ 10 :> A A _ + ] ] call ] call ] unit-test ! littledan found this problem -{ "bar" } [ [let [let "bar" :> foo foo ] :> a a ] ] unit-test -{ 10 } [ [let 10 :> a [let a :> b b ] ] ] unit-test +{ "bar" } [ let[ let[ "bar" :> foo foo ] :> a a ] ] unit-test +{ 10 } [ let[ 10 :> a let[ a :> b b ] ] ] unit-test -{ { \ + } } [ [let \ + :> x { \ x } ] ] unit-test +{ { \ + } } [ let[ \ + :> x { \ x } ] ] unit-test -{ { \ + 3 } } [ [let 3 :> a { \ + a } ] ] unit-test +{ { \ + 3 } } [ let[ 3 :> a { \ + a } ] ] unit-test -{ 3 } [ [let \ + :> a 1 2 [ \ a execute ] ] call ] unit-test +{ 3 } [ let[ \ + :> a 1 2 [ \ a execute ] ] call ] unit-test ! erg found this problem :: erg's-:>-bug ( n ? -- n ) ? [ n :> n n ] [ n :> b b ] if ; @@ -493,7 +493,7 @@ M: integer ed's-bug neg ; { t } [ \ ed's-test-case word-optimized? ] unit-test ! multiple bind -{ 3 1 2 } [ [let 1 2 3 :> ( a b c ) c a b ] ] unit-test +{ 3 1 2 } [ let[ 1 2 3 :> ( a b c ) c a b ] ] unit-test ! Test smart combinators and locals interaction :: smart-combinator-locals ( a b c -- seq ) [ a b c ] output>array ; diff --git a/core/modern/out/out-tests.factor b/core/modern/out/out-tests.factor index 9fb14cf93c..4f1080a392 100644 --- a/core/modern/out/out-tests.factor +++ b/core/modern/out/out-tests.factor @@ -56,4 +56,4 @@ in: modern.out.tests ! lexable-paths [ transform-single-line-comment>hash-comment ] rewrite-paths { t } -[ "( a: ( quot: ( b -- c ) -- d ) -- e )" [ [ ] rewrite-string ] keep sequence= ] unit-test \ No newline at end of file +[ "( a: ( quot: ( b -- c ) -- d ) -- e )" [ [ ] rewrite-string ] keep sequence= ] unit-test diff --git a/core/syntax/syntax.factor b/core/syntax/syntax.factor index 1e0f2054bf..8e442c0a22 100644 --- a/core/syntax/syntax.factor +++ b/core/syntax/syntax.factor @@ -379,7 +379,7 @@ in: bootstrap.syntax ] define-core-syntax "[|" [ parse-lambda append! ] define-core-syntax - "[let" [ parse-let append! ] define-core-syntax + "let[" [ parse-let append! ] define-core-syntax "MEMO[" [ parse-quotation dup infer memoize-quot suffix! ] define-core-syntax "'[" [ parse-quotation fry append! ] define-core-syntax "IH{" [ \ } [ >identity-hashtable ] parse-literal ] define-core-syntax diff --git a/demos/rosetta-code/n-queens/n-queens.factor b/demos/rosetta-code/n-queens/n-queens.factor index e94bb3c5b5..8a000022bc 100644 --- a/demos/rosetta-code/n-queens/n-queens.factor +++ b/demos/rosetta-code/n-queens/n-queens.factor @@ -9,7 +9,7 @@ in: rosetta-code.n-queens ! solve the puzzle with a board of side NxN. :: safe? ( board q -- ? ) - [let q board nth :> x + let[ q board nth :> x q iota [ x swap [ board nth ] keep diff --git a/demos/talks/galois-talk/galois-talk.factor b/demos/talks/galois-talk/galois-talk.factor index 4596de887a..66a598e370 100644 --- a/demos/talks/galois-talk/galois-talk.factor +++ b/demos/talks/galois-talk/galois-talk.factor @@ -189,7 +189,7 @@ CONSTANT: galois-slides } { $slide "Locals and lexical scope" { "Define lambda words with " { $link postpone\ :: } } - { "Establish bindings with " { $link postpone\ [let } " and " { $snippet "[let*" } } + { "Establish bindings with " { $link postpone\ let[ } " and " { $snippet "let[*" } } "Mutable bindings with correct semantics" { "Named inputs for quotations with " { $link postpone\ [| } } "Full closures" diff --git a/demos/talks/google-tech-talk/google-tech-talk.factor b/demos/talks/google-tech-talk/google-tech-talk.factor index b4a138487a..b0f8d427be 100644 --- a/demos/talks/google-tech-talk/google-tech-talk.factor +++ b/demos/talks/google-tech-talk/google-tech-talk.factor @@ -272,7 +272,7 @@ CONSTANT: google-slides } { $slide "Locals and lexical scope" { "Define lambda words with " { $link postpone\ :: } } - { "Establish bindings with " { $link postpone\ [let } " and " { $snippet "[let*" } } + { "Establish bindings with " { $link postpone\ let[ } " and " { $snippet "let[*" } } "Mutable bindings with correct semantics" { "Named inputs for quotations with " { $link postpone\ [| } } "Full closures" diff --git a/demos/talks/vpri-talk/vpri-talk.factor b/demos/talks/vpri-talk/vpri-talk.factor index 81ae132d12..6619f7ed02 100644 --- a/demos/talks/vpri-talk/vpri-talk.factor +++ b/demos/talks/vpri-talk/vpri-talk.factor @@ -209,7 +209,7 @@ CONSTANT: vpri-slides } { $slide "Locals and lexical scope" { "Define lambda words with " { $link postpone\ :: } } - { "Establish bindings with " { $link postpone\ [let } " and " { $snippet "[let*" } } + { "Establish bindings with " { $link postpone\ let[ } " and " { $snippet "let[*" } } "Mutable bindings with correct semantics" { "Named inputs for quotations with " { $link postpone\ [| } } "Full closures" diff --git a/ffi/mongodb/driver/driver.factor b/ffi/mongodb/driver/driver.factor index 5f24c0f777..26bd444378 100644 --- a/ffi/mongodb/driver/driver.factor +++ b/ffi/mongodb/driver/driver.factor @@ -163,7 +163,7 @@ M: mdb-collection create-collection ( collection -- ) [ "$cmd" = ] [ "system" head? ] bi or ; : check-collection ( collection -- fq-collection ) - [let + let[ mdb-instance :> instance instance name>> :> instance-name dup mdb-collection? [ name>> ] when diff --git a/language/interpolate/interpolate-tests.factor b/language/interpolate/interpolate-tests.factor index 67b76b7390..f023ec366b 100644 --- a/language/interpolate/interpolate-tests.factor +++ b/language/interpolate/interpolate-tests.factor @@ -38,7 +38,7 @@ in: interpolate.tests ] unit-test { "Oops, I accidentally the whole economy..." } [ - [let + let[ "economy" :> noun "accidentally" [ [I Oops, I ${0} the whole ${noun}...I] ] with-string-writer ] diff --git a/language/io/encodings/gb18030/gb18030.factor b/language/io/encodings/gb18030/gb18030.factor index 5fe0ddbc41..5388b5a7f9 100644 --- a/language/io/encodings/gb18030/gb18030.factor +++ b/language/io/encodings/gb18030/gb18030.factor @@ -48,7 +48,7 @@ TUPLE: range ufirst ulast bfirst blast ; ] dip set-at ; : xml>gb-data ( stream -- mapping ranges ) - [let + let[ H{ } clone :> mapping V{ } clone :> ranges [ dup contained? [ diff --git a/language/io/launcher/unix/unix-tests.factor b/language/io/launcher/unix/unix-tests.factor index d330335d0d..43317cf37d 100644 --- a/language/io/launcher/unix/unix-tests.factor +++ b/language/io/launcher/unix/unix-tests.factor @@ -133,7 +133,7 @@ in: io.launcher.unix.tests ! Killed processes were exiting with code 0 on FreeBSD { f } [ - [let + let[ :> p :> s diff --git a/language/locals/prettyprint/prettyprint.factor b/language/locals/prettyprint/prettyprint.factor index 385184417c..6fc74801ff 100644 --- a/language/locals/prettyprint/prettyprint.factor +++ b/language/locals/prettyprint/prettyprint.factor @@ -28,7 +28,7 @@ M: lambda pprint* > pprint-elements block> \ ] pprint-word ; -M: let pprint* \ [let pprint-let ; +M: let pprint* \ let[ pprint-let ; M: def pprint* dup local>> word? diff --git a/language/models/product/product-tests.factor b/language/models/product/product-tests.factor index 2227d6dc23..e185b74361 100644 --- a/language/models/product/product-tests.factor +++ b/language/models/product/product-tests.factor @@ -27,7 +27,7 @@ TUPLE: an-observer { i integer } ; M: an-observer model-changed nip [ 1 + ] change-i drop ; { 1 0 } [ - [let + let[ 1 :> m1 2 :> m2 { m1 m2 } :> c diff --git a/language/peg/ebnf/ebnf.factor b/language/peg/ebnf/ebnf.factor index 2549370162..6feea536ab 100644 --- a/language/peg/ebnf/ebnf.factor +++ b/language/peg/ebnf/ebnf.factor @@ -429,7 +429,7 @@ M: ebnf-sequence build-locals ( code ast -- code ) drop ] [ [ - "[let " % + "let[ " % [ over ebnf-var? [ " " % # " over nth :> " % @@ -447,7 +447,7 @@ M: ebnf-sequence build-locals ( code ast -- code ) M: ebnf-var build-locals ( code ast -- code ) [ - "[let dup :> " % name>> % + "let[ dup :> " % name>> % " " % % " nip ]" % @@ -473,7 +473,7 @@ ERROR: bad-effect quot effect ; ! so we don't pollute the manifest qualified-vocabs ! and also so restarts don't add multiple times qualified-vocabs length - "syntax" { "[let" ":>" } add-words-from + "syntax" { "let[" ":>" } add-words-from "kernel" { "dup" "nip" "over" } add-words-from "sequences" { "nth" } add-words-from [ string-lines parse-lines ] dip diff --git a/language/peg/peg.factor b/language/peg/peg.factor index 20b386dc9a..2edce73a75 100644 --- a/language/peg/peg.factor +++ b/language/peg/peg.factor @@ -608,7 +608,7 @@ PRIVATE> ERROR: parse-failed input word ; SYNTAX: \ PEG: - [let + let[ (:) :> ( word def effect ) [ [ diff --git a/libs/calendar/holidays/holidays.factor b/libs/calendar/holidays/holidays.factor index 9d7fd87947..8a3f9ab521 100644 --- a/libs/calendar/holidays/holidays.factor +++ b/libs/calendar/holidays/holidays.factor @@ -15,7 +15,7 @@ SYNTAX: HOLIDAY: parse-definition ( timestamp/n -- timestamp ) define-declared ; SYNTAX: HOLIDAY-NAME: - [let scan-word "holiday" word-prop :> holidays scan-word :> name scan-object :> value + let[ scan-word "holiday" word-prop :> holidays scan-word :> name scan-object :> value value name holidays set-at ] ; >> diff --git a/libs/colors/lab/lab.factor b/libs/colors/lab/lab.factor index 6807ff8b6f..a2d7610d2a 100644 --- a/libs/colors/lab/lab.factor +++ b/libs/colors/lab/lab.factor @@ -14,7 +14,7 @@ M: laba >rgba >xyza >rgba ; M: laba >xyza [ - [let + let[ [ l>> ] [ a>> ] [ b>> ] tri :> ( l a b ) l 16 + 116 / :> fy a 500 / fy + :> fx @@ -53,7 +53,7 @@ M: rgba >laba >xyza >laba ; M: xyza >laba [ - [let + let[ [ x>> wp_x / ] [ y>> wp_y / ] [ z>> wp_z / ] tri [ dup xyz_epsilon > diff --git a/libs/colors/lch/lch.factor b/libs/colors/lch/lch.factor index 6644aaff1f..724fb5d126 100644 --- a/libs/colors/lch/lch.factor +++ b/libs/colors/lch/lch.factor @@ -26,7 +26,7 @@ M: LCHuv >xyza >luva >xyza ; M: LCHuv >luva [ - [let + let[ [ l>> ] [ c>> ] [ h>> ] tri :> ( l c h ) h deg>rad :> hr @@ -44,7 +44,7 @@ M: LCHuv >LCHuv ; inline M: luva >LCHuv [ - [let + let[ [ l>> ] [ u>> ] [ v>> ] tri :> ( l u v ) v u fatan2 rad>deg [ dup 360 > ] [ 360 - ] while @@ -64,7 +64,7 @@ M: LCHab >rgba >laba >rgba ; M: LCHab >laba [ - [let + let[ [ l>> ] [ c>> ] [ h>> ] tri :> ( l c h ) h deg>rad :> hr @@ -82,7 +82,7 @@ M: LCHab >LCHab ; inline M: laba >LCHab [ - [let + let[ [ l>> ] [ a>> ] [ b>> ] tri :> ( l a b ) b a fatan2 rad>deg [ dup 360 > ] [ 360 - ] while diff --git a/libs/colors/luv/luv.factor b/libs/colors/luv/luv.factor index 44e0ac3035..bf364da1e7 100644 --- a/libs/colors/luv/luv.factor +++ b/libs/colors/luv/luv.factor @@ -23,7 +23,7 @@ M: luva >rgba >xyza >rgba ; M: luva >xyza [ - [let + let[ wp_x wp_y wp_z xyz-to-uv :> ( u_wp v_wp ) [ l>> ] [ u>> ] [ v>> ] tri :> ( l u v ) @@ -52,7 +52,7 @@ M: luva >luva ; inline M: xyza >luva [ - [let + let[ wp_x wp_y wp_z xyz-to-uv :> ( u_wp v_wp ) [ x>> ] [ y>> ] [ z>> ] tri :> ( x_ y_ z_ ) x_ y_ z_ xyz-to-uv :> ( u_ v_ ) diff --git a/libs/colors/xyy/xyy.factor b/libs/colors/xyy/xyy.factor index 5de7ca7592..aea20ea1cf 100644 --- a/libs/colors/xyy/xyy.factor +++ b/libs/colors/xyy/xyy.factor @@ -14,7 +14,7 @@ M: xyYa >rgba M: xyYa >xyza [ - [let + let[ [ x>> ] [ y>> ] [ Y>> ] tri :> ( x y Y ) x y / Y * Y @@ -30,7 +30,7 @@ M: xyYa >xyYa ; inline M: xyza >xyYa [ - [let + let[ [ x>> ] [ y>> ] [ z>> ] tri :> ( x y z ) x y z + + [ x swap / ] diff --git a/libs/colors/xyz/xyz.factor b/libs/colors/xyz/xyz.factor index dc303ac4e3..1a3678b785 100644 --- a/libs/colors/xyz/xyz.factor +++ b/libs/colors/xyz/xyz.factor @@ -26,7 +26,7 @@ PRIVATE> M: xyza >rgba [ - [let + let[ [ x>> ] [ y>> ] [ z>> ] tri :> ( x y z ) x 3.2404542 * y -1.5371385 * z -0.4985314 * + + x -0.9692660 * y 1.8760108 * z 0.0415560 * + + @@ -50,7 +50,7 @@ PRIVATE> M: rgba >xyza [ - [let + let[ [ red>> ] [ green>> ] [ blue>> ] tri [ invert-rgb-compand ] tri@ :> ( r g b ) r 0.4124564 * g 0.3575761 * b 0.1804375 * + + diff --git a/libs/gml/macros/macros.factor b/libs/gml/macros/macros.factor index b254563062..e0584b297b 100644 --- a/libs/gml/macros/macros.factor +++ b/libs/gml/macros/macros.factor @@ -28,7 +28,7 @@ MACRO:: log-euler-op ( class def inputs -- quot ) class inputs def inputs '[ [ current-macro get [ _ boa save-euler-op ] [ _ ndrop ] if ] _ _ nbi ] ; SYNTAX: LOG-GML: - [let + let[ (GML:) :> ( word name effect def ) name "-record" append create-word-in :> record-class diff --git a/libs/gml/runtime/runtime.factor b/libs/gml/runtime/runtime.factor index 30efc690df..3f71093576 100644 --- a/libs/gml/runtime/runtime.factor +++ b/libs/gml/runtime/runtime.factor @@ -189,7 +189,7 @@ SYNTAX: GML: (GML:) define-gml-primitive ; SYNTAX: GML:: - [let + let[ scan-gml-name :> ( word name ) word [ parse-definition ] parse-locals-definition :> ( word def effect ) word name effect def define-gml-primitive diff --git a/libs/images/loader/gtk/gtk.factor b/libs/images/loader/gtk/gtk.factor index 915abc2a02..b175385f55 100644 --- a/libs/images/loader/gtk/gtk.factor +++ b/libs/images/loader/gtk/gtk.factor @@ -27,7 +27,7 @@ os linux? [ [ gdk_pixbuf_get_n_channels ] [ gdk_pixbuf_get_bits_per_sample ] } cleave - [let :> ( pixels w h rowstride channels bps ) + let[ :> ( pixels w h rowstride channels bps ) bps channels * 7 + 8 /i w * :> bytes-per-row bytes-per-row rowstride = diff --git a/libs/infix/infix-docs.factor b/libs/infix/infix-docs.factor index 8eabcf254c..d7c6ba20e8 100644 --- a/libs/infix/infix-docs.factor +++ b/libs/infix/infix-docs.factor @@ -63,26 +63,26 @@ $nl "You can access " { $vocab-link "sequences" } " inside infix expressions with the familiar " { $snippet "seq[index]" } " notation." { $example "USING: arrays locals infix ;" - "[let { 1 2 3 4 } :> myarr [infix myarr[4/2]*3 infix] ] ." + "let[ { 1 2 3 4 } :> myarr [infix myarr[4/2]*3 infix] ] ." "9" } $nl "You can create sub-" { $vocab-link "sequences" } " inside infix expressions using " { $snippet "seq[from:to]" } " notation." { $example "USING: arrays locals infix ;" - "[let \"foobar\" :> s [infix s[0:3] infix] ] ." + "let[ \"foobar\" :> s [infix s[0:3] infix] ] ." "\"foo\"" } $nl "Additionally, you can step through " { $vocab-link "sequences" } " with " { $snippet "seq[from:to:step]" } " notation." { $example "USING: arrays locals infix ;" - "[let \"reverse\" :> s [infix s[::-1] infix] ] ." + "let[ \"reverse\" :> s [infix s[::-1] infix] ] ." "\"esrever\"" } { $example "USING: arrays locals infix ;" - "[let \"0123456789\" :> s [infix s[::2] infix] ] ." + "let[ \"0123456789\" :> s [infix s[::2] infix] ] ." "\"02468\"" } ; diff --git a/libs/infix/infix-tests.factor b/libs/infix/infix-tests.factor index 30a5264fcb..33189829b2 100644 --- a/libs/infix/infix-tests.factor +++ b/libs/infix/infix-tests.factor @@ -32,24 +32,24 @@ in: infix.tests { t } [ 5 \ stupid_function check-word ] unit-test { 10 } [ [infix stupid_function (0, 1, 2, 3, 4) infix] ] unit-test -{ -1 } [ [let 1 :> a [infix -a infix] ] ] unit-test +{ -1 } [ let[ 1 :> a [infix -a infix] ] ] unit-test -{ char: f } [ [let "foo" :> s [infix s[0] infix] ] ] unit-test -{ char: r } [ [let "bar" :> s [infix s[-1] infix] ] ] unit-test -{ "foo" } [ [let "foobar" :> s [infix s[0:3] infix] ] ] unit-test -{ "foo" } [ [let "foobar" :> s [infix s[:3] infix] ] ] unit-test -{ "bar" } [ [let "foobar" :> s [infix s[-3:] infix] ] ] unit-test -{ "boof" } [ [let "foobar" :> s [infix s[-3::-1] infix] ] ] unit-test -{ "foobar" } [ [let "foobar" :> s [infix s[:] infix] ] ] unit-test -{ "foa" } [ [let "foobar" :> s [infix s[::2] infix] ] ] unit-test -{ "bar" } [ [let "foobar" :> s [infix s[-3:100] infix] ] ] unit-test -{ "foobar" } [ [let "foobar" :> s [infix s[-100:100] infix] ] ] unit-test -{ "olh" } [ [let "hello" :> s [infix s[4::-2] infix] ] ] unit-test -{ "rb" } [ [let "foobar" :> s [infix s[:1:-2] infix] ] ] unit-test -{ "foa" } [ [let "foobar" :> s [infix s[:-1:2] infix] ] ] unit-test -{ "rbo" } [ [let "foobar" :> s [infix s[::-2] infix] ] ] unit-test -{ "rbo" } [ [let "foobar" :> s [infix s[:0:-2] infix] ] ] unit-test -{ "rb" } [ [let "foobar" :> s [infix s[:-5:-2] infix] ] ] unit-test +{ char: f } [ let[ "foo" :> s [infix s[0] infix] ] ] unit-test +{ char: r } [ let[ "bar" :> s [infix s[-1] infix] ] ] unit-test +{ "foo" } [ let[ "foobar" :> s [infix s[0:3] infix] ] ] unit-test +{ "foo" } [ let[ "foobar" :> s [infix s[:3] infix] ] ] unit-test +{ "bar" } [ let[ "foobar" :> s [infix s[-3:] infix] ] ] unit-test +{ "boof" } [ let[ "foobar" :> s [infix s[-3::-1] infix] ] ] unit-test +{ "foobar" } [ let[ "foobar" :> s [infix s[:] infix] ] ] unit-test +{ "foa" } [ let[ "foobar" :> s [infix s[::2] infix] ] ] unit-test +{ "bar" } [ let[ "foobar" :> s [infix s[-3:100] infix] ] ] unit-test +{ "foobar" } [ let[ "foobar" :> s [infix s[-100:100] infix] ] ] unit-test +{ "olh" } [ let[ "hello" :> s [infix s[4::-2] infix] ] ] unit-test +{ "rb" } [ let[ "foobar" :> s [infix s[:1:-2] infix] ] ] unit-test +{ "foa" } [ let[ "foobar" :> s [infix s[:-1:2] infix] ] ] unit-test +{ "rbo" } [ let[ "foobar" :> s [infix s[::-2] infix] ] ] unit-test +{ "rbo" } [ let[ "foobar" :> s [infix s[:0:-2] infix] ] ] unit-test +{ "rb" } [ let[ "foobar" :> s [infix s[:-5:-2] infix] ] ] unit-test INFIX:: foo ( x y -- z ) x**2-abs(y) ; diff --git a/libs/xml/syntax/syntax-docs.factor b/libs/xml/syntax/syntax-docs.factor index 62831d3dcb..55299877c1 100644 --- a/libs/xml/syntax/syntax-docs.factor +++ b/libs/xml/syntax/syntax-docs.factor @@ -74,7 +74,7 @@ $nl "Here is an example of the locals version:" { $example "USING: locals urls xml.syntax xml.writer ; -[let +let[ 3 :> number f :> false URL\" http://factorcode.org/\" :> url diff --git a/libs/xml/syntax/syntax-tests.factor b/libs/xml/syntax/syntax-tests.factor index 320ff69e8f..c4fbbe232d 100644 --- a/libs/xml/syntax/syntax-tests.factor +++ b/libs/xml/syntax/syntax-tests.factor @@ -55,7 +55,7 @@ XML-NS: foo http://blah.com y " } [ - [let "one" :> a "two" :> c "y" :> x XML[[ <-x-> XML]] :> d + let[ "one" :> a "two" :> c "y" :> x XML[[ <-x-> XML]] :> d <-a-> /> <-d-> XML> pprint-xml>string diff --git a/tools/pdf/layout/layout.factor b/tools/pdf/layout/layout.factor index 43f907f983..9bd29602d0 100644 --- a/tools/pdf/layout/layout.factor +++ b/tools/pdf/layout/layout.factor @@ -214,7 +214,7 @@ M: table-row pdf-render { [ drop ?line-break ] [ - [let + let[ over y>> :> start-y over y>> :> max-y! [ diff --git a/unmaintained/L-system/L-system.factor b/unmaintained/L-system/L-system.factor index fb7e9f442f..fe5e0612b6 100644 --- a/unmaintained/L-system/L-system.factor +++ b/unmaintained/L-system/L-system.factor @@ -38,9 +38,9 @@ DEFER: default-L-parser-values :: Rx ( ANGLE -- Rx ) - [let | ANGLE [ ANGLE deg>rad ] | + let[ | ANGLE [ ANGLE deg>rad ] | - [let | A [ ANGLE cos ] + let[ | A [ ANGLE cos ] B [ ANGLE sin neg ] C [ ANGLE sin ] D [ ANGLE cos ] | @@ -53,9 +53,9 @@ DEFER: default-L-parser-values :: Ry ( ANGLE -- Ry ) - [let | ANGLE [ ANGLE deg>rad ] | + let[ | ANGLE [ ANGLE deg>rad ] | - [let | A [ ANGLE cos ] + let[ | A [ ANGLE cos ] B [ ANGLE sin ] C [ ANGLE sin neg ] D [ ANGLE cos ] | @@ -68,9 +68,9 @@ DEFER: default-L-parser-values :: Rz ( ANGLE -- Rz ) - [let | ANGLE [ ANGLE deg>rad ] | + let[ | ANGLE [ ANGLE deg>rad ] | - [let | A [ ANGLE cos ] + let[ | A [ ANGLE cos ] B [ ANGLE sin neg ] C [ ANGLE sin ] D [ ANGLE cos ] | @@ -304,7 +304,7 @@ TUPLE: < gadget [ STRING read-instruction - [let | REST [ ] NEXT [ ] | + let[ | REST [ ] NEXT [ ] | NEXT 1 head RULES at NEXT or ACCUM push-all @@ -316,7 +316,7 @@ TUPLE: < gadget :: iterate-string ( STRING RULES -- string ) - [let | ACCUM [ STRING length 10 * ] | + let[ | ACCUM [ STRING length 10 * ] | STRING RULES ACCUM iterate-string-loop @@ -330,9 +330,9 @@ TUPLE: < gadget [ STRING read-instruction - [let | REST [ ] NEXT [ ] | + let[ | REST [ ] NEXT [ ] | - [let | COMMAND [ NEXT 1 head COMMANDS at ] | + let[ | COMMAND [ NEXT 1 head COMMANDS at ] | COMMAND [ @@ -363,7 +363,7 @@ TUPLE: < gadget :: do-camera-look-at ( CAMERA -- ) - [let | EYE [ CAMERA pos>> ] + let[ | EYE [ CAMERA pos>> ] FOCUS [ CAMERA clone 1 step-turtle pos>> ] UP [ CAMERA clone 90 pitch-up 1 step-turtle pos>> CAMERA pos>> v- ] | diff --git a/unmaintained/bubble-chamber/bubble-chamber.factor b/unmaintained/bubble-chamber/bubble-chamber.factor index e5636df015..e306c3f43b 100644 --- a/unmaintained/bubble-chamber/bubble-chamber.factor +++ b/unmaintained/bubble-chamber/bubble-chamber.factor @@ -104,12 +104,12 @@ DEFER: collision-theta ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! :: out-of-bounds? ( PARTICLE -- ? ) - [let | X [ PARTICLE pos>> first ] + let[ | X [ PARTICLE pos>> first ] Y [ PARTICLE pos>> second ] WIDTH [ PARTICLE bubble-chamber>> size>> first ] HEIGHT [ PARTICLE bubble-chamber>> size>> second ] | - [let | LEFT [ WIDTH neg ] + let[ | LEFT [ WIDTH neg ] RIGHT [ WIDTH 2 * ] BOTTOM [ HEIGHT neg ] TOP [ HEIGHT 2 * ] | @@ -313,9 +313,9 @@ METHOD: collide ( -- ) METHOD: move ( -- ) - [let | MUON [ ] | + let[ | MUON [ ] | - [let | WIDTH [ MUON bubble-chamber>> size>> first ] | + let[ | WIDTH [ MUON bubble-chamber>> size>> first ] | MUON @@ -363,9 +363,9 @@ METHOD: collide ( -- ) METHOD: move ( -- ) - [let | QUARK [ ] | + let[ | QUARK [ ] | - [let | WIDTH [ QUARK bubble-chamber>> size>> first ] | + let[ | WIDTH [ QUARK bubble-chamber>> size>> first ] | QUARK diff --git a/unmaintained/dns/cache/nx/nx.factor b/unmaintained/dns/cache/nx/nx.factor index 34d312536a..755b3098ef 100644 --- a/unmaintained/dns/cache/nx/nx.factor +++ b/unmaintained/dns/cache/nx/nx.factor @@ -17,7 +17,7 @@ in: dns.cache.nx : now ( -- seconds ) millis 1000.0 / round >integer ; :: non-existent-name? ( NAME -- ? ) - [let | TIME [ NAME nx-cache-at ] | + let[ | TIME [ NAME nx-cache-at ] | { { [ TIME f = ] [ f ] } { [ TIME now <= ] [ NAME nx-cache-delete-at f ] } @@ -29,7 +29,7 @@ in: dns.cache.nx ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! :: cache-non-existent-name ( NAME TTL -- ) - [let | TIME [ TTL now + ] | TIME NAME nx-cache-set-at ] ; + let[ | TIME [ TTL now + ] | TIME NAME nx-cache-set-at ] ; ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/unmaintained/dns/cache/rr/rr.factor b/unmaintained/dns/cache/rr/rr.factor index bfe458fbfe..84ab6450cf 100644 --- a/unmaintained/dns/cache/rr/rr.factor +++ b/unmaintained/dns/cache/rr/rr.factor @@ -29,14 +29,14 @@ TUPLE: time data ; ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! :: cache-get ( OBJ -- rrs/f ) - [let | ENT [ OBJ cache-at ] | + let[ | ENT [ OBJ cache-at ] | { { [ ENT f = ] [ f ] } { [ ENT expired? ] [ OBJ cache-delete f ] } { [ t ] [ - [let | NAME [ OBJ name>> ] + let[ | NAME [ OBJ name>> ] TYPE [ OBJ type>> ] CLASS [ OBJ class>> ] TTL [ ENT time>> now - ] | @@ -53,7 +53,7 @@ TUPLE: time data ; ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! :: cache-add ( RR -- ) - [let | ENT [ RR cache-at ] + let[ | ENT [ RR cache-at ] TIME [ RR ttl>> now + ] RDATA [ RR rdata>> ] | { diff --git a/unmaintained/dns/forwarding/forwarding.factor b/unmaintained/dns/forwarding/forwarding.factor index 163d711f93..9cc50b7f60 100644 --- a/unmaintained/dns/forwarding/forwarding.factor +++ b/unmaintained/dns/forwarding/forwarding.factor @@ -10,24 +10,24 @@ in: dns.forwarding ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! :: query->rrs ( QUERY -- rrs/f ) - [let | RRS [ QUERY cache-get ] | + let[ | RRS [ QUERY cache-get ] | RRS [ RRS ] [ - [let | NAME [ QUERY name>> ] + let[ | NAME [ QUERY name>> ] TYPE [ QUERY type>> ] CLASS [ QUERY class>> ] | - [let | RRS/CNAME [ T{ query f NAME CNAME CLASS } cache-get ] | + let[ | RRS/CNAME [ T{ query f NAME CNAME CLASS } cache-get ] | RRS/CNAME f = [ f ] [ - [let | RR/CNAME [ RRS/CNAME first ] | + let[ | RR/CNAME [ RRS/CNAME first ] | - [let | REAL-NAME [ RR/CNAME rdata>> ] | + let[ | REAL-NAME [ RR/CNAME rdata>> ] | - [let | RRS [ + let[ | RRS [ T{ query f REAL-NAME TYPE CLASS } query->rrs ] | @@ -44,9 +44,9 @@ in: dns.forwarding ] ; :: answer-from-cache ( MSG -- msg/f ) - [let | QUERY [ MSG message-query ] | + let[ | QUERY [ MSG message-query ] | - [let | NX [ QUERY name>> non-existent-name? ] + let[ | NX [ QUERY name>> non-existent-name? ] RRS [ QUERY query->rrs ] | { @@ -66,7 +66,7 @@ in: dns.forwarding ! :: cache-message ( MSG -- msg ) ! MSG rcode>> NAME-ERROR = ! [ -! [let | NAME [ MSG message-query name>> ] +! let[ | NAME [ MSG message-query name>> ] ! TTL [ MSG message-soa ttl>> ] | ! NAME TTL cache-non-existent-name ! ] @@ -80,13 +80,13 @@ in: dns.forwarding :: cache-message ( MSG -- msg ) MSG rcode>> NAME-ERROR = [ - [let | RR/SOA [ MSG + let[ | RR/SOA [ MSG authority-section>> [ type>> SOA = ] filter dup empty? [ drop f ] [ first ] if ] | RR/SOA [ - [let | NAME [ MSG message-query name>> ] + let[ | NAME [ MSG message-query name>> ] TTL [ MSG message-soa ttl>> ] | NAME TTL cache-non-existent-name ] @@ -111,7 +111,7 @@ in: dns.forwarding :: start-server ( ADDR-SPEC SERVERS -- ) - [let | SOCKET [ ADDR-SPEC ] | + let[ | SOCKET [ ADDR-SPEC ] | [ SOCKET receive-packet diff --git a/unmaintained/dns/resolver/resolver.factor b/unmaintained/dns/resolver/resolver.factor index c8a641cb6b..f19fdcb2b9 100644 --- a/unmaintained/dns/resolver/resolver.factor +++ b/unmaintained/dns/resolver/resolver.factor @@ -15,7 +15,7 @@ in: dns.resolver with-disposal ; :: send-receive-tcp ( BA SERVER -- ba ) - [let | BA [ BA length 2 >be BA append ] | + let[ | BA [ BA length 2 >be BA append ] | SERVER binary [ T{ duration { second 3 } } input-stream get set-timeout @@ -24,7 +24,7 @@ in: dns.resolver with-client ] ; :: send-receive-server ( BA SERVER -- msg ) - [let | RESULT [ BA SERVER send-receive-udp parse-message ] | + let[ | RESULT [ BA SERVER send-receive-udp parse-message ] | RESULT tc>> 1 = [ BA SERVER send-receive-tcp parse-message ] [ RESULT ] @@ -34,7 +34,7 @@ in: dns.resolver :: send-receive-servers ( BA SERVERS -- msg ) SERVERS empty? [ "send-receive-servers: servers list empty" throw ] when - [let | SERVER [ SERVERS random >dns-inet4 ] | + let[ | SERVER [ SERVERS random >dns-inet4 ] | ! if this throws an error ... [ BA SERVER send-receive-server ] ! we try with the other servers... @@ -62,7 +62,7 @@ in: dns.resolver : dns-ip4 ( name -- ips ) fully-qualified - [let | MSG [ A IN query boa query->message dns-servers ask-servers ] | + let[ | MSG [ A IN query boa query->message dns-servers ask-servers ] | MSG rcode>> NO-ERROR = [ MSG answer-section>> [ type>> A = ] filter [ rdata>> ] map ] [ "dns-ip: rcode = " MSG rcode>> unparse append throw ] diff --git a/unmaintained/easy-help/expand-markup/expand-markup.factor b/unmaintained/easy-help/expand-markup/expand-markup.factor index f6afc4c5f3..ad1649040a 100644 --- a/unmaintained/easy-help/expand-markup/expand-markup.factor +++ b/unmaintained/easy-help/expand-markup/expand-markup.factor @@ -30,7 +30,7 @@ in: easy-help.expand-markup LINE contains-markup? [ - [let | N [ "{ $" LINE start ] | + let[ | N [ "{ $" LINE start ] | LINE N head diff --git a/unmaintained/frame-buffer/frame-buffer.factor b/unmaintained/frame-buffer/frame-buffer.factor index b750f0699a..2134354a75 100644 --- a/unmaintained/frame-buffer/frame-buffer.factor +++ b/unmaintained/frame-buffer/frame-buffer.factor @@ -51,7 +51,7 @@ GENERIC: update-frame-buffer ( -- ) :: copy-row ( OLD NEW -- ) - [let | LEN [ OLD NEW min-length ] | + let[ | LEN [ OLD NEW min-length ] | OLD LEN head-slice 0 NEW copy ] ; @@ -76,14 +76,14 @@ M:: layout* ( FRAME-BUFFER -- ) { [ FRAME-BUFFER [ rect-dim ] [ last-dim>> ] bi = not ] [ - [let | OLD-PIXELS [ FRAME-BUFFER pixels>> ] + let[ | OLD-PIXELS [ FRAME-BUFFER pixels>> ] OLD-WIDTH [ FRAME-BUFFER last-dim>> first ] | FRAME-BUFFER init-frame-buffer-pixels FRAME-BUFFER update-last-dim - [let | NEW-PIXELS [ FRAME-BUFFER pixels>> ] + let[ | NEW-PIXELS [ FRAME-BUFFER pixels>> ] NEW-WIDTH [ FRAME-BUFFER last-dim>> first ] | OLD-PIXELS OLD-WIDTH NEW-PIXELS NEW-WIDTH copy-pixels ] ] diff --git a/unmaintained/opengl-gadgets/gadgets.factor b/unmaintained/opengl-gadgets/gadgets.factor index e6d7ebed9f..716a86195d 100644 --- a/unmaintained/opengl-gadgets/gadgets.factor +++ b/unmaintained/opengl-gadgets/gadgets.factor @@ -88,7 +88,7 @@ M: texture-gadget ungraft* ( gadget -- ) pick [ render-bytes ] dip ; :: four-corners ( dim -- ) - [let* | w [ dim first ] + let[* | w [ dim first ] h [ dim second ] dim' [ dim dup 2^-bounds [ /f ] 2map ] w' [ dim' first ] diff --git a/unmaintained/peg-lexer/peg-lexer.factor b/unmaintained/peg-lexer/peg-lexer.factor index c226743667..edef829bc3 100644 --- a/unmaintained/peg-lexer/peg-lexer.factor +++ b/unmaintained/peg-lexer/peg-lexer.factor @@ -10,7 +10,7 @@ CONSULT: assoc-protocol lex-hash hash>> ; : pos-or-0 ( neg? -- pos/0 ) dup 0 < [ drop 0 ] when ; :: prepare-pos ( v i -- c l ) - [let | n [ i v head-slice ] | + let[ | n [ i v head-slice ] | v CHAR: \n n last-index -1 or 1 + - n [ CHAR: \n = ] count 1 + ] ; diff --git a/unmaintained/size-of/size-of.factor b/unmaintained/size-of/size-of.factor index e202075ef3..f8ae51a74d 100644 --- a/unmaintained/size-of/size-of.factor +++ b/unmaintained/size-of/size-of.factor @@ -41,7 +41,7 @@ Example: :: size-of ( HEADERS TYPE -- n ) - [let | C-FILE [ "size-of.c" temp-file ] + let[ | C-FILE [ "size-of.c" temp-file ] EXE-FILE [ "size-of" temp-file ] INCLUDES [ HEADERS [| FILE | { "#include <" FILE ">" } concat ] map ] |