@@ -588,7 +588,7 @@ function analyze_sequence(stmts) {
588588 a ( env ,
589589 ( a_value , fail2 ) => {
590590 if ( is_return_value ( a_value ) ) {
591- return succeed ( return_value_content ( a_value ) , fail2 ) ;
591+ return succeed ( a_value , fail2 ) ;
592592 } else {
593593 return b ( env , succeed , fail2 ) ;
594594 }
@@ -613,8 +613,7 @@ function analyze_sequence(stmts) {
613613function analyze_block ( stmts ) {
614614 const body = block_body ( stmts ) ;
615615 const locals = local_names ( body ) ;
616- const temp_values = map ( x => no_value_yet ,
617- locals ) ;
616+ const temp_values = map ( x => no_value_yet , locals ) ;
618617 return ( env , succeed , fail ) => analyze ( body ) ( extend_environment ( locals , temp_values , env ) , succeed , fail ) ;
619618}
620619
@@ -732,7 +731,6 @@ function execute_application(fun, args, succeed, fail) {
732731 function_environment ( fun ) ) ,
733732 ( return_value , fail2 ) => {
734733 if ( is_return_value ( return_value ) ) {
735-
736734 return succeed ( return_value_content ( return_value ) , fail2 ) ;
737735 } else {
738736 return succeed ( undefined , fail2 ) ;
@@ -844,32 +842,36 @@ function parse_and_run(str) {
844842// 'factorial(4);');
845843
846844// parse_and_run('function x() {\n' +
847- // ' const a = 1;\n' +
845+ // ' let a = 1;\n' +
848846// ' return a;\n' +
849847// ' a = 2;\n' +
850848// '}\n' +
851849// 'x();');
852850
853- parse_and_run ( " \
854- function multiple_dwelling() { \
855- const baker = amb(1, 2, 3, 4, 5); \
856- const cooper = amb(1, 2, 3, 4, 5); \
857- const fletcher = amb(1, 2, 3, 4, 5); \
858- const miller = amb(1, 2, 3, 4, 5); \
859- const smith = amb(1, 2, 3, 4, 5); \
860- require(distinct(list(baker, cooper, fletcher, miller, smith))); \
861- require(! (baker === 5)); \
862- require(! (cooper === 1)); \
863- require(! (fletcher === 5)); \
864- require(! (fletcher === 1)); \
865- require(! (miller > cooper)); \
866- require(! ((math_abs(smith - fletcher)) === 1)); \
867- require(! ((math_abs(fletcher - cooper)) === 1)); \
868- return list(list('baker', baker), \
869- list('cooper', cooper), \
870- list('fletcher', fletcher), \
871- list('miller', miller), \
872- list('smith', smith)); \
873- } \
874- multiple_dwelling(); \
875- " ) ;
851+ // parse_and_run("function foo() {\
852+ // return 5;\
853+ // }\
854+ // foo();");
855+ // parse_and_run(" \
856+ // function multiple_dwelling() { \
857+ // const baker = amb(1, 2, 3, 4, 5); \
858+ // const cooper = amb(1, 2, 3, 4, 5); \
859+ // const fletcher = amb(1, 2, 3, 4, 5); \
860+ // const miller = amb(1, 2, 3, 4, 5); \
861+ // const smith = amb(1, 2, 3, 4, 5); \
862+ // require(distinct(list(baker, cooper, fletcher, miller, smith))); \
863+ // require(! (baker === 5)); \
864+ // require(! (cooper === 1)); \
865+ // require(! (fletcher === 5)); \
866+ // require(! (fletcher === 1)); \
867+ // require(! (miller > cooper)); \
868+ // require(! ((math_abs(smith - fletcher)) === 1)); \
869+ // require(! ((math_abs(fletcher - cooper)) === 1)); \
870+ // return list(list('baker', baker), \
871+ // list('cooper', cooper), \
872+ // list('fletcher', fletcher), \
873+ // list('miller', miller), \
874+ // list('smith', smith)); \
875+ // } \
876+ // multiple_dwelling(); \
877+ // ");
0 commit comments