#% if ( cond, branch1:Block ) {
# exec_if( cond, branch1 )
#}
-#
+
#% ifelse ( cond, branch1:Block, branch2:Block ) {
# exec_if( cond, branch1, branch2 )
#}
-#
+
#% foreach ( lst, fn:Block ) {
# for_each(fn, lst)
#}
#------------------------------------------------------------------------------
# Collection Access and Iteration Tests
#------------------------------------------------------------------------------
-# Accessing elements of lists, vectors, and strings
+## Accessing elements of lists, vectors, and strings
#lst1 = `(4,5,6)
#print(lst1[0], " Hello, World!")
#
#------------------------------------------------------------------------------
# Delayed Evaluation
#------------------------------------------------------------------------------
-% delay ( exp ) {
- make_promise({ exp })
-}
-
-% force ( prom ) {
- force( prom )
-}
+#% delay ( exp ) {
+# make_promise({ exp })
+#}
+#
+#% force ( prom ) {
+# force( prom )
+#}
-foo = delay nonexistent_var + 1
-nonexistent_var = 19
-assert( typeof(foo) == Block )
-assert( typeof( force foo ) == Num )
-print( force( foo ), " Hello, World!" )
+#foo = delay nonexistent_var + 1
+#nonexistent_var = 19
+#assert( typeof(foo) == Block )
+#assert( typeof( force foo ) == Num )
+#print( force( foo ), " Hello, World!" )
#------------------------------------------------------------------------------
# Type Checking Tests
match(ASSIGN);
ret = _new AST( ASSIGN, 2, id_node, Expression());
}
- else if( (lookaheadType(1) == MACRO) && (lookaheadType(2) == ID))
- {
- ret = MacroDefinition();
- }
- else if( isMacro( lookaheadToken(1) ) )
- {
- ret = MacroExpansion();
- }
+ //else if( (lookaheadType(1) == MACRO) && (lookaheadType(2) == ID))
+ //{
+ // ret = MacroDefinition();
+ //}
+ //else if( isMacro( lookaheadToken(1) ) )
+ //{
+ // ret = MacroExpansion();
+ //}
else
{
ret = LogicalExpr();