--* Subject: [5] Undetected syntax error gives bad run time output -- Command line: axiomxl -V -DBUG1 -Ginterp youssef-1.as #include "axllib" #pile S ==> SingleInteger -- -- Compiler bug: -- This is a fine function -- #if BUG1 foo: (a:S)->(b:S)->(c:S) == (a:S)(b:S):(c:S) +-> a+b #elseif BUG2 foo: S -> (S -> S) == (a:S):S -> S ((b:S):S +-> a+b) #else foo(a:S): S -> S == (b:S):S +-> a + b #endif import from S print << "foo(1)(1) = 2" << foo(1)(1) << newline #if BUG1 bar: (a:S)->(b:S)->(c:S) == (a:S)(b:S):(c:S) +-> a+b+c #elseif BUG2 bar: S -> (S -> S) == (a:S):S -> S ((b:S):S +-> a + b + c) #else bar(a:S): S -> S == (b:S):S +-> a + b + c #endif -- I would think that bar is a function with bad syntax. -- However, it compiles and bar(1)(1) prints as "1513"! print << bar(1)(1) << newline #endpile