mfikes / esprit

ClojureScript on the ESP32 using Espruino
Eclipse Public License 2.0
138 stars 13 forks source link

Allow var creation for function definition #9

Closed mfikes closed 4 years ago

mfikes commented 4 years ago
cljs.user=> (defn foo [])
SyntaxError: Got ':' expected EOF
 at line 18 col 7
throw e__6755__auto__;
      ^
in function called from line 19 col 5
}})()
   ^
at line 1 col 89
...tus:"success",value:eval(d)}}catch(f){var a=f;return{status:...
                              ^
mfikes commented 4 years ago

Directly via screen:

(function (){
:cljs.user.foo = (function cljs$user$foo(){
:return null;
:}); return (
:new cljs.core.Var(function(){return cljs.user.foo;},new cljs.core.Symbol("cljs.user","foo","cljs.user/foo",(-727488832),null),cljs.core.PersistentHashMap.fromArrays([new cljs.core.Keyword(null,"ns","ns",(441598760)),new cljs.core.Keyword(null,"name","name",(1843675177)),new cljs.core.Keyword(null,"file","file",(-1269645878)),new cljs.core.Keyword(null,"end-column","end-column",(1425389514)),new cljs.core.Keyword(null,"column","column",(2078222095)),new cljs.core.Keyword(null,"line","line",(212345235)),new cljs.core.Keyword(null,"end-line","end-line",(1837326455)),new cljs.core.Keyword(null,"arglists","arglists",(1661989754)),new cljs.core.Keyword(null,"doc","doc",(1913296891)),new cljs.core.Keyword(null,"test","test",(577538877))],[new cljs.core.Symbol(null,"cljs.user","cljs.user",(877795071),null),new cljs.core.Symbol(null,"foo","foo",(-1385541733),null),null,(10),(1),(1),(1),cljs.core.list(cljs.core.PersistentVector.EMPTY),null,(cljs.core.truth_(cljs.user.foo)?cljs.user.foo.cljs$lang$test:null)])));})()
Uncaught SyntaxError: Got ':' expected EOF
 at line 1 col 65
...&0===a.i)var b=a.arr;else a:for(b=[];;)if(null!=a)b.push(clj...
                              ^
in function "cljs$core$IFn$_invoke$arity$variadic" called from line 1 col 205
...Fn$_invoke$arity$variadic(b)
                              ^
in function "list" called from line 4 col 938
...core.PersistentVector.EMPTY),null,(cljs.core.truth_(cljs.use...
                              ^
in function called from line 5 col 1020
...ljs$lang$test:null)])));})()
                              ^
>