lux icon indicating copy to clipboard operation
lux copied to clipboard

Exception when trying to launch repl

Open ghost opened this issue 7 years ago • 5 comments

Hello, I get an exception when trying to execute lein lux repl in the shell, I have leiningen 2.7.1 java 1.8.0 and lein lux build and lein lux test seem to work fine, here's my project.clj file:

(defproject lux_tests "0.1.0-SNAPSHOT" :plugins [[com.github.luxlang/lein-luxc "0.5.0"]] :dependencies [] :lux {:program "main"} :source-paths ["source"] )

and the error code: lein lux repl clojure.lang.ArityException: Wrong number of args (2) passed to: utils/repl-path at clojure.lang.AFn.throwArity (AFn.java:429) clojure.lang.AFn.invoke (AFn.java:36) leiningen.lux.repl$repl.invokeStatic (repl.clj:9) leiningen.lux.repl$repl.invoke (repl.clj:8) leiningen.lux$lux.invokeStatic (lux.clj:14) leiningen.lux$lux.doInvoke (lux.clj:10) clojure.lang.RestFn.invoke (RestFn.java:423) clojure.lang.Var.invoke (Var.java:383) clojure.lang.AFn.applyToHelper (AFn.java:156) clojure.lang.Var.applyTo (Var.java:700) clojure.core$apply.invokeStatic (core.clj:648) clojure.core$apply.invoke (core.clj:641) leiningen.core.main$partial_task$fn__5932.doInvoke (main.clj:272) clojure.lang.RestFn.applyTo (RestFn.java:139) clojure.lang.AFunction$1.doInvoke (AFunction.java:29) clojure.lang.RestFn.applyTo (RestFn.java:137) clojure.core$apply.invokeStatic (core.clj:648) clojure.core$apply.invoke (core.clj:641) leiningen.core.main$apply_task.invokeStatic (main.clj:322) leiningen.core.main$apply_task.invoke (main.clj:308) leiningen.core.main$resolve_and_apply.invokeStatic (main.clj:328) leiningen.core.main$resolve_and_apply.invoke (main.clj:324) leiningen.core.main$_main$fn__5998.invoke (main.clj:401) leiningen.core.main$_main.invokeStatic (main.clj:394) leiningen.core.main$_main.doInvoke (main.clj:391) clojure.lang.RestFn.invoke (RestFn.java:421) clojure.lang.Var.invoke (Var.java:383) clojure.lang.AFn.applyToHelper (AFn.java:156) clojure.lang.Var.applyTo (Var.java:700) clojure.core$apply.invokeStatic (core.clj:646) clojure.main$main_opt.invokeStatic (main.clj:314) clojure.main$main_opt.invoke (main.clj:310) clojure.main$main.invokeStatic (main.clj:421) clojure.main$main.doInvoke (main.clj:384) clojure.lang.RestFn.invoke (RestFn.java:457) clojure.lang.Var.invoke (Var.java:394) clojure.lang.AFn.applyToHelper (AFn.java:165) clojure.lang.Var.applyTo (Var.java:700) clojure.main.main (main.java:37)

I've tried running eval "$(lein lux repl)" as advised by the lux book which outputs: bash: syntax error near unexpected token (' `

please excuse me for the bad markdown.

ghost avatar Jan 15 '18 18:01 ghost

Yeah. The v0.5 REPL is currently broken (a bug that slipped prior to release).

I've tried running eval "$(lein lux repl)" as advised by the lux book which outputs: bash: syntax error near unexpected token(' `

Are you running Linux by any chance? I ask because that was mostly a Linux-based trick (I'd imagine it doesn't work on Windows, and I don't have an OSX machine nearby to test on Mac).

LuxLang avatar Jan 16 '18 01:01 LuxLang

Yes I am running linux, the command eval "lein lux repl" doesn't throw a bash error but the same error as lein lux repl

I'd say that the arity error comes from this in the leiningen/lux/repl.clj file if that helps:

(defn repl [project] (println (&utils/repl-path project (:source-paths project)))

ghost avatar Jan 16 '18 06:01 ghost

Hi. I had the same problem, and built lein-luxc-0.5.0.jar from souce. jar works well. I have lost log, but like this.

  1. do git clone and navigate to lux directory
  2. go back to ver. 0.5.0 (git checkout -b somename and git reset --hard 0.5.0 or so)
  3. navigate to lux-lein
  4. lein jar
  5. replace jar in maven local repository with target's one (maybe I did by hand and confirmed)

And on Windows10, I can use REPL by PowerShell (built in ver. 5.1.16299.98).

(prompt)$ lein lux repl > repl.txt  # I mean cache
(prompt)$ $replcmd,$replopt = (Get-Content repl.txt) -split " " # Destructuring assignment
(prompt)$ & $replcmd $replopt  # invocation operator
# not work with substring, like & "java" "$((Get-Content repl.txt).substring(4))"

I expect that this runs on PowerShell Core 6.0 (supporting Ubuntu, Red Hat, etc.). Input-history works well, but if you are on Linux and bash, it may require rlwrap.

This may be improved, but I do not know now. Thanks.

PrsPrsBK avatar Jan 24 '18 13:01 PrsPrsBK

Has there been any update to this situation?

If not, could someone expand on where this maven repo is? I'm not a java person but want to get the repl running so I can start learning!

opto-files avatar Jun 14 '18 10:06 opto-files

Somebody e-mailed me with regards to the state of the Lux REPL. I thought it might be worthwhile to paste my reply here, in case anybody else has the same concerns:

Most of it is implemented, but I never got around to finishing it because I don't do REPL-based development (I just auto build and auto test on every save and I find that to be a better experience). Even as a Clojure programmer I never used the REPL, except indirectly when I wanted to do in-editor macro-expansion on Emacs. Since I don't have any personal need for a REPL and I haven't had people pressuring me on that, I have just postponed it until higher priority issues get taken care of.

eduardoejp avatar Apr 16 '22 19:04 eduardoejp