[ in>> length ] [ out>> length ] [ terminated?>> ] tri
pick 0 = [ [ 1 + ] dip ] [ [ 1 - ] 2dip ] if
[ [ "x" <array> ] bi@ ] dip <terminated-effect> ;
+
+ERROR: bad-stack-effect word expected got ;
+
+: check-stack-effect ( word effect -- )
+ [ dup stack-effect ] dip
+ 2dup effect=
+ [ 3drop ] [ bad-stack-effect ] if ;
classes.algebra.private classes.builtin classes.intersection
classes.maybe classes.mixin classes.parser classes.predicate
classes.singleton classes.tuple classes.tuple.parser
-classes.union combinators compiler.units definitions
+classes.union combinators compiler.units definitions effects
effects.parser generic generic.hook generic.math generic.parser
generic.standard hash-sets hashtables io.pathnames kernel lexer
math namespaces parser quotations sbufs sequences slots
-source-files splitting strings strings.parser vectors
+source-files splitting strings strings.parser vectors vocabs
vocabs.parser words words.alias words.constant words.symbol ;
IN: bootstrap.syntax
"MAIN:" [
scan-word
+ dup ( -- ) check-stack-effect
[ current-vocab main<< ]
[ file get [ main<< ] [ drop ] if* ] bi
] define-core-syntax
! Copyright (C) 2007, 2009 Eduardo Cavazos, Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
-USING: accessors assocs definitions kernel namespaces sequences
-sorting splitting strings ;
+USING: accessors assocs definitions kernel namespaces
+sequences sorting splitting strings ;
IN: vocabs
SYMBOL: dictionary