Diff
Not logged in

Differences From Artifact [c9a55d8e7b3293ae]:

To Artifact [ed44c7901d3c5853]:


3 3 else { if( _isstr(x) ) { "str" } 4 4 else { if( _isfun(x) ) { x } 5 5 else { if( _isundefined(x) ) { "undefined" } 6 6 else { "any" }}}} 7 7 }; 8 8 9 9 def binop(a,b,c) { 10 - fun(x,y){@v( 10 + fun(x,y){@value( 11 11 if( @type(x)=="undefined" || @type(y)=="undefined" ) { "undefined" } else { 12 12 if( @type(x)==a && @type(y)==b ) { c } else { "error" } 13 13 } 14 14 )} 15 15 }; 16 16 17 17 @type "+" = binop("int", "int", "int"); ................................................................................ 19 19 @type "<" = binop("int", "int", "int"); 20 20 @type ">" = binop("int", "int", "int"); 21 21 22 22 def mergeType(a,b) { 23 23 if( a == "undefined" ) { if(b=="undefined"){"error"}else{b} } else { a } 24 24 }; 25 25 26 -@type "if" = fun(c,t,e) {@v( 26 +@type "if" = fun(c,t,e) {@value( 27 27 if(@type(c)=="int" ) { mergeType(@type(t()), @type(e())) } else { "error" } 28 28 )};