! Copyright (C) 2015 Jordan Lewis.
! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays assocs combinators continuations fry
-grouping hashtables io kernel locals lib.env lib.printer
-lib.reader lib.types math namespaces quotations readline
-sequences ;
+USING: accessors arrays assocs combinators combinators.short-circuit
+continuations fry grouping hashtables io kernel locals lib.env lib.printer
+lib.reader lib.types math namespaces quotations readline sequences ;
IN: step3_env
CONSTANT: repl-bindings H{
: READ ( str -- maltype ) read-str ;
:: EVAL ( maltype env -- maltype )
- maltype dup array? [
+ maltype dup { [ array? ] [ empty? not ] } 1&& [
unclip dup dup malsymbol? [ name>> ] when {
{ "def!" [ drop first2 env eval-def! ] }
{ "let*" [ drop first2 env eval-let* ] }
! Copyright (C) 2015 Jordan Lewis.
! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays assocs combinators continuations fry
-grouping hashtables io kernel lists locals lib.core lib.env
-lib.printer lib.reader lib.types math namespaces quotations
-readline sequences splitting ;
+USING: accessors arrays assocs combinators combinators.short-circuit
+continuations fry grouping hashtables io kernel lists locals lib.core lib.env
+lib.printer lib.reader lib.types math namespaces quotations readline sequences
+splitting ;
IN: step4_if_fn_do
SYMBOL: repl-env
: READ ( str -- maltype ) read-str ;
:: EVAL ( maltype env -- maltype )
- maltype dup array? [
+ maltype dup { [ array? ] [ empty? not ] } 1&& [
dup first dup malsymbol? [ name>> ] when {
{ "def!" [ rest first2 env eval-def! ] }
{ "let*" [ rest first2 env eval-let* ] }
! Copyright (C) 2015 Jordan Lewis.
! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays assocs combinators continuations fry
-grouping hashtables io kernel lists locals lib.core lib.env
-lib.printer lib.reader lib.types math namespaces quotations
-readline sequences splitting ;
+USING: accessors arrays assocs combinators combinators.short-circuit
+continuations fry grouping hashtables io kernel lists locals lib.core lib.env
+lib.printer lib.reader lib.types math namespaces quotations readline sequences
+splitting ;
IN: step5_tco
SYMBOL: repl-env
: READ ( str -- maltype ) read-str ;
: EVAL ( maltype env -- maltype )
- over array? [
+ over { [ array? ] [ empty? not ] } 1&& [
over first dup malsymbol? [ name>> ] when {
{ "def!" [ [ rest first2 ] dip eval-def! f ] }
{ "let*" [ [ rest first2 ] dip eval-let* ] }
! Copyright (C) 2015 Jordan Lewis.
! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays assocs combinators command-line
-continuations fry grouping hashtables io kernel lists locals
-lib.core lib.env lib.printer lib.reader lib.types math
-namespaces quotations readline sequences splitting ;
+USING: accessors arrays assocs combinators combinators.short-circuit
+command-line continuations fry grouping hashtables io kernel lists locals
+lib.core lib.env lib.printer lib.reader lib.types math namespaces quotations
+readline sequences splitting ;
IN: step6_file
SYMBOL: repl-env
: READ ( str -- maltype ) read-str ;
: EVAL ( maltype env -- maltype )
- over array? [
+ over { [ array? ] [ empty? not ] } 1&& [
over first dup malsymbol? [ name>> ] when {
{ "def!" [ [ rest first2 ] dip eval-def! f ] }
{ "let*" [ [ rest first2 ] dip eval-let* ] }
: READ ( str -- maltype ) read-str ;
: EVAL ( maltype env -- maltype )
- over array? [
+ over { [ array? ] [ empty? not ] } 1&& [
over first dup malsymbol? [ name>> ] when {
{ "def!" [ [ rest first2 ] dip eval-def! f ] }
{ "let*" [ [ first2 ] dip eval-let* ] }
: READ ( str -- maltype ) read-str ;
: EVAL ( maltype env -- maltype )
- over array? [
+ over { [ array? ] [ empty? not ] } 1&& [
[ macro-expand ] keep over array? [
over first dup malsymbol? [ name>> ] when {
{ "def!" [ [ rest first2 ] dip eval-def! f ] }
: READ ( str -- maltype ) read-str ;
: EVAL ( maltype env -- maltype )
- over array? [
+ over { [ array? ] [ empty? not ] } 1&& [
[ macro-expand ] keep over array? [
over first dup malsymbol? [ name>> ] when {
{ "def!" [ [ rest first2 ] dip eval-def! f ] }
: READ ( str -- maltype ) read-str ;
: EVAL ( maltype env -- maltype )
- over array? [
+ over { [ array? ] [ empty? not ] } 1&& [
[ macro-expand ] keep over array? [
over first dup malsymbol? [ name>> ] when {
{ "def!" [ [ rest first2 ] dip eval-def! f ] }