4 ms·
this example shows how "elegant" closure treats syntax errors, almost looks like a bad joke. => (+ 2 2 + 3) "4function Cg(a){switch(arguments.length){case 0:r
by camelspotter 2y ago
this example shows how "elegant" closure treats syntax errors, almost looks like a bad joke.
=> (+ 2 2 + 3)
"4function Cg(a){switch(arguments.length){case 0:return Cg.s();case 1:return Cg.g(arguments[0]);case 2:return Cg.h(arguments[0],arguments[1]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return Cg.j(arguments[0],arguments[1],new gc(c.slice(2),0,null))}}3"
- zakkor1 2y agoThat's a bug in the JS interpreter they're running, not anything related to Clojure. Also, that's not a syntax error
- silcoon 2y agoNot a syntax error. TryClojure is running on SCI which is a interpreter that uses a Babashka version for Clojurescript compiler, not Clojure JVM. Babashka cli returns this, telling you clearly what the error is: user=> (+ 2 2 + 3) java.lang.ClassCastException: clojure.core$_PLUS_ cannot be cast to java.lang.Number [at <repl>:1:1]