We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Clojure function related to the error is the following:
(defn valid-cards-ids "Returns a list of all the valid cards ids." [deck-id & [uuid]] (->> (full-deck deck-id true uuid) (map :id) set))
The error is actually due to the :id as a function in (map :id)
:id
(map :id)
Calling the function from Unity:
Clojure.GetVar("clojure.core", "map") .invoke(RT.keyword(null, "id"), fullDeck) // => {ChunkedCons}[nil nil nil nil nil nil ...]
In fact, looking at the valAt C# code:
valAt
public object valAt(object _param1, object _param2) { object o = _param1; switch (Util.hash(o) & 3) { case 0: if (o == (object) Keyword.intern((string) null, "id")) return this.id; break; case 1: if (o == (object) Keyword.intern((string) null, "num")) return this.num; break; case 2: if (o == (object) Keyword.intern((string) null, "suit")) return this.suit; break; case 3: if (o == (object) Keyword.intern((string) null, "deck-id")) return this.deck\u002Did; break; } return RT.get(this.__extmap, _param1, _param2); }
When :id is called, the hash is 1 not 0 as shown above.
1
0
So the hash of the keyword :id is different between compiling the valAt of PokerCard and the rumtime calculation.
I directly copied Clojure.dll and Magic.Runtime from my Nostrand to unity assets and got the same results.
Clojure.dll
Magic.Runtime
So the difference is caused by the different dotnet runtimes.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Problem
The Clojure function related to the error is the following:
The error is actually due to the
:id
as a function in(map :id)
Calling the function from Unity:
In fact, looking at the
valAt
C# code:When
:id
is called, the hash is1
not0
as shown above.So the hash of the keyword
:id
is different between compiling the valAt of PokerCard and the rumtime calculation.I directly copied
Clojure.dll
andMagic.Runtime
from my Nostrand to unity assets and got the same results.So the difference is caused by the different dotnet runtimes.
The text was updated successfully, but these errors were encountered: