Fork me on GitHub

(this is the IllegalArgumentException one)


cheers Colin, this appears to be working fine now


Thanks Colin!


So I'm curious, what's the difference between send form to repl and load file in repl? I've been using cursive with arcadia, which granted is a bit outside the norm and send form to repl seems to work perfectly, but load file in repl seems to not do anything? Is that calling some internal nrepl function? Knowing this would be useful as it might lead to fixing cursive functionality in terms of REPL workflow 馃槂...


send form sends a single form: either the one you have selected or the one before the caret


load file loads the entire file


i.e. all the forms in the file


Right, and if your REPL is using nREPL, that will use the load-file op:


Perhaps the Arcadia nREPL impl doesn鈥檛 implement that? Would seem weird though.


I'll take a peek into the source, give me a sec


Sure, I just was initially under the impression that load file was just sending multiple repl forms


Hmm, it just seems to proxy the messages across, so I have no idea why it's failing...


It might be a nrepl version thing...


Going to try and update the nrepl version and see if that helps 馃槂


Hmm, it does say Error initialising locals clearing


Ok, this is just weird, calling (ns-publics 'game) gives the functions in question, but using send form to repl within the namespace does not work at all... It's like send form to repl is still invoking the function in the user namespace even though I'm in the game namespace... Even fully qualifying the name doesn't work


Ok, I've created a mock function that just prints out the name in the user ns and it now returns that instead. Looking at the nrepl messages, the :ns key is not being set when I call send form to repl. Hmm, let's see if that's not being set at all or if the nrepl bridge is making a mistake 馃槂


Ok, passing the :ns key in the transport layer seems to make fully qualified names work, but not just calling the function and sending it's form across


Sorry if this is out of scope, but so far it sends the: :id :op :ns :code as well as the :file :file-name :file-path when those are available Not sure if some other data is required? No idea why the non-fully qualified name is causing this issue where send form to repl for the function call calls the function inside the current namespace instead of within the ns of the file it's in... This doesn't even work if I change namespaces away from user...


brb grabbing lunch


Ok, still not figured much about how to fix the non-fully qualified names from just calling user namespace instead of their own namespace...


Just so that it's clear: This is the "game" code:

;; game.core.clj
(ns game.core
  (:require [arcadia.core :as arc])
  (:import (UnityEngine GameObject)))

(defn log-name [obj role-key]
  (arc/log (.name obj)))

(def mainObject (atom nil))

(defn create-main []
  (swap! mainObject (fn [n] (new UnityEngine.GameObject "Main"))))

(defn hook-main []
      ;; in log-name `obj` will be the `the-object`, `role-key` will be `:log-name`

;; user.clj
(defn hook-main []
  (println "THIS IS THE WRONG ONE!"))
This is what happens =)...:
=> System.InvalidOperationException unable to resolve symbol: create-main in this context
  clojure.lang.Compiler.ResolveIn (clojure.lang.Namespace, clojure.lang.Symbol, System.Boolean)
  clojure.lang.Compiler.Resolve (clojure.lang.Symbol)
  clojure.lang.Compiler.AnalyzeSymbol (clojure.lang.Symbol)
  clojure.lang.Compiler.Analyze (clojure.lang.CljCompiler.Ast.ParserContext, object, System.string)
=> #<Main (UnityEngine.GameObject)>
=> nil
=> #'game.core/log-name
(in-ns 'game.core)
=> #object[Namespace 0xa0757000 "game.core"]
=> nil
Calling the unqualified function just calls the hook-main within the user namespace, even though the nrepl call is going to the correct namespace... Even switching namespaces doesn't appear to help I've made one minor edit to tools.cursive-arcadia-repl, which I've forked here:


Not sure if this is a cursive problem or an nrepl one?


It's an nrepl server implementation problem it turns out, got a PR here: I'm trying to figure out what else needs to be done to get cursive compatibility in a good place 馃槂... Advice appreciated!


That鈥檚 good timing, I was just at this very minute reading through your thread 馃檪


Things like the locals clearing might not work though, I don鈥檛 know if ClojureCLR (or MAGIC? not sure what Arcadia is using these days) supports that.


It's pretty late where I am, but I'd really like this to work better, I get the impression that a fair few people who want to use arcadia also are wanting to use cursive, it seems to work fairly well barring a few issues 馃槂...


They're working on MAGIC from what I understand, with clojureCLR being what's used


What would be helpful is having a clear idea exactly what the behaviour should be, I'm not sure how the nrepl implementation they've got working was written (did they just rewrite an old version of nrepl?), but it's only somewhat adherent to nrepl's protocol, so working with cursive exposes some holes. I've put in the PR that I linked things I'm a little unsure of with regards to how it should work as I don't know the exact order stuff should evaluate in 馃槂...


I suspect there's subtle gotchas in this space, if there's any obvious issues I'd be grateful if you can point them out so the PR can be worked on / improved 馃槂...


is it safe to update to IDEA 2021.1.3?


I used that for a while before upgrading to 2021.2 and had no issues with it. However, when trying to upgrade to .2, I ran into some conflicts and had to reinstall idea. Details are at The tl;dr; is something like 2021.1.3 having been rebuilt and republished to fix an issue I would consider 2021.1.3 safe now


any idea what this mean (shadow-cljs project):


Do you know where those files are coming from? Are they in your project or in libraries?


Hey all, is it sort of normal at present for a great many symbols to not resolve in cljs land?


npm-related things yes, otherwise not so much. depends on the kinds of macros you use I guess.


hm I might have a bigger problem then because it cant resolve defn or let


I mean, the code is running, my code is just littered with yellow squiggly underlines 馃檪


how did you load the project? usually this happens when the project wasn't created properly


So I used the re-frame template project for leiningen, and I guess that process does not actually create a leiningen project file nor a deps.edn file for the project, or maybe I deleted it in haste?


either way, I've created a deps.edn file, deleted and re-added the module (it was a web module so.. all sorts of things were wrong!)


I think that just creates a shadow-cljs.edn? then you can follow


Yeah, it was very odd to me that a leiningen generator did not create a project manifest for itself, but I'm still trying to understand all the tooling.


creating a deps.edn is fine too, just don't have to if you don't intend to use it


the pom way seems better 馃檪


Does that periodically need to be re-ran? like if I were to.. say.. change the nrepl port? not that I'd ever need to


only if you change :dependencies or :source-paths


don't hardcode a nrepl port. not needed, cursive has an option to use the created nrepl port file


sure, I just grabbed the first keyword out of the map 馃檪 I guess that leiningen template did that, I haven't touched this file yet!


Thanks for all the help, this is such a nicer setup than the last project I worked on (angular 6鈥11, webpack etc etc)

馃憤 3