skydread1 / Arcadia

Clojure in Unity
http://arcadia-unity.github.io/
Apache License 2.0
0 stars 0 forks source link

There is no way to compile the last version of magic with Arcadia #1

Open skydread1 opened 3 years ago

skydread1 commented 3 years ago

Problem

From the wiki of Arcadia, regarding using magic, it is mentioned that only the branch timsgardner/magic/unity is working. It also says that only 2 methods are provided in this fork to compile with magic in magic.api : defn and faster. However, this fork is not necessary anymore as the issue that leads to the fork was solved.

That said, it means we should be able to use magic.Unity in Arcadia.

Suggestion

skydread1 commented 3 years ago

Update

Replacing the dlls from Arcadia/infrastructure with Magic.Unity/infrastructure causes error.

InvalidOperationException: No such var: clojure.core/gen-interface
clojure.lang.Compiler.ResolveIn (clojure.lang.Namespace n, clojure.lang.Symbol symbol, System.Boolean allowPrivate) (at <fb1204dbf0b848beaab1559f81f1b22c>:0)
clojure.lang.Compiler.Resolve (clojure.lang.Symbol symbol) (at <fb1204dbf0b848beaab1559f81f1b22c>:0)
clojure.lang.Compiler.AnalyzeSymbol (clojure.lang.Symbol symbol) (at <fb1204dbf0b848beaab1559f81f1b22c>:0)
clojure.lang.Compiler.Analyze (clojure.lang.CljCompiler.Ast.ParserContext pcontext, System.Object form, System.String name) (at <fb1204dbf0b848beaab1559f81f1b22c>:0)
Rethrow as CompilerException: System.InvalidOperationException: No such var: clojure.core/gen-interface
clojure.lang.Compiler.ResolveIn (clojure.lang.Namespace n, clojure.lang.Symbol symbol, System.Boolean allowPrivate) (at <fb1204dbf0b848beaab1559f81f1b22c>:0)
clojure.lang.Compiler.Resolve (clojure.lang.Symbol symbol) (at <fb1204dbf0b848beaab1559f81f1b22c>:0)
clojure.lang.Compiler.AnalyzeSymbol (clojure.lang.Symbol symbol) (at <fb1204dbf0b848beaab1559f81f1b22c>:0)
clojure.lang.Compiler.Analyze (clojure.lang.CljCompiler.Ast.ParserContext pcontext, System.Object form, System.String name) (at <fb1204dbf0b848beaab1559f81f1b22c>:0 , compiling: (Assets/Arcadia/Source/arcadia/internal/protocols.clj:3:2))
<magic>clojure_core$load-lib__0.invokeTyped (System.Object prefix, System.Object lib, clojure.lang.ISeq options) (at <bdcc818227a246b5b90c8569ad610c1e>:0)
<magic>clojure_core$load-lib__0.doInvoke (System.Object prefix, System.Object lib, System.Object options) (at <bdcc818227a246b5b90c8569ad610c1e>:0)
clojure.lang.RestFn.applyTo (clojure.lang.ISeq arglist) (at <fb1204dbf0b848beaab1559f81f1b22c>:0)
clojure.lang.AFunction+MetaWrapper.doInvoke (System.Object args) (at <fb1204dbf0b848beaab1559f81f1b22c>:0)
clojure.lang.RestFn.applyTo (clojure.lang.ISeq arglist) (at <fb1204dbf0b848beaab1559f81f1b22c>:0)
<magic>clojure_core$apply__0.invokeTyped (clojure.lang.IFn f, System.Object x, System.Object args) (at <bdcc818227a246b5b90c8569ad610c1e>:0)
<magic>clojure_core$apply__0.invoke (System.Object f, System.Object x, System.Object args) (at <bdcc818227a246b5b90c8569ad610c1e>:0)
<magic>clojure_core$load-libs__0.invokeTyped (clojure.lang.ISeq args) (at <bdcc818227a246b5b90c8569ad610c1e>:0)
<magic>clojure_core$load-libs__0.doInvoke (System.Object args) (at <bdcc818227a246b5b90c8569ad610c1e>:0)
clojure.lang.RestFn.applyTo (clojure.lang.ISeq arglist) (at <fb1204dbf0b848beaab1559f81f1b22c>:0)
<magic>clojure_core$apply__0.invokeTyped (clojure.lang.IFn f, System.Object x, System.Object args) (at <bdcc818227a246b5b90c8569ad610c1e>:0)
<magic>clojure_core$apply__0.invoke (System.Object f, System.Object x, System.Object args) (at <bdcc818227a246b5b90c8569ad610c1e>:0)
<magic>clojure_core$require__0.invokeTyped (clojure.lang.ISeq args) (at <bdcc818227a246b5b90c8569ad610c1e>:0)
<magic>clojure_core$require__0.doInvoke (System.Object args) (at <bdcc818227a246b5b90c8569ad610c1e>:0)
clojure.lang.RestFn.invoke (System.Object arg1, System.Object arg2, System.Object arg3, System.Object arg4) (at <fb1204dbf0b848beaab1559f81f1b22c>:0)
Scripts$core$eval__7171loading__17689__auto____7176__7179.invoke () (at <18be498b3239434a961c734adc493a3d>:0)
Scripts$core$eval__7171__7182.invokeStatic () (at <18be498b3239434a961c734adc493a3d>:0)
Scripts$core$eval__7171__7182.invoke () (at <18be498b3239434a961c734adc493a3d>:0)
clojure.lang.Compiler.eval (System.Object form) (at <fb1204dbf0b848beaab1559f81f1b22c>:0)
clojure.lang.Compiler.eval (System.Object form) (at <fb1204dbf0b848beaab1559f81f1b22c>:0)
clojure.lang.Compiler.eval (System.Object form) (at <fb1204dbf0b848beaab1559f81f1b22c>:0)
<magic>clojure_core$eval__0.invoke (System.Object form) (at <bdcc818227a246b5b90c8569ad610c1e>:0)
clojure.lang.Var.invoke (System.Object arg1) (at <fb1204dbf0b848beaab1559f81f1b22c>:0)
Arcadia.NRepl+EvalFn.invoke () (at Assets/Arcadia/Editor/NRepl.cs:299)
arcadia$internal$callbacks$run_callbacks__4658__4661.invokeStatic (System.Object , System.Object ) (at <18be498b3239434a961c734adc493a3d>:0)
arcadia$internal$callbacks$run_callbacks__4658__4661.invoke (System.Object , System.Object ) (at <18be498b3239434a961c734adc493a3d>:0)
arcadia$internal$editor_callbacks$run_callbacks__4752__4755.invokeStatic () (at <18be498b3239434a961c734adc493a3d>:0)
arcadia$internal$editor_callbacks$run_callbacks__4752__4755.invoke () (at <18be498b3239434a961c734adc493a3d>:0)
clojure.lang.Var.invoke () (at <fb1204dbf0b848beaab1559f81f1b22c>:0)
Arcadia.EditorCallbacks.RunCallbacks () (at Assets/Arcadia/Editor/EditorCallbacks.cs:24)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at /Users/bokken/buildslave/unity/build/Editor/Mono/EditorApplication.cs:327)

clojure.core/gen-interface is indeed not present in Arcadia/Source/clojure/clojure.core

I am guessing it is due to the clojure files in Arcadia/Source/clojure being outdated.

Suggestion

Add the nasser/magic clj files but remove the custom dynamic that are still not working.

skydread1 commented 3 years ago

Update

I cannot make it work as I don't really know where the problem is

Workaround

This should allow you to run the magic.api/eval function in the Arcadia nREPL