Skip to content

Conversation

@susam
Copy link
Contributor

@susam susam commented Nov 18, 2019

In Clojure 1.5.0 and later versions, the constructor for
clojure.lang.Compiler$CompilerException requires an additional
argument that specifies column number. This change updates Swank Clojure
to check the current Clojure version and then instantiate this class
with the correct number of arguments.

This change is based on commit 12e96d0 of technomancy/swank-clojure.
Visit technomancy/swank-clojure@12e96d0 to see that commit.

In Clojure 1.5.0 and later versions, the constructor for
`clojure.lang.Compiler$CompilerException` requires an additional
argument that specifies column number. This change updates Swank Clojure
to check the current Clojure version and then instantiate this class
with the correct number of arguments.

This change is based on commit 12e96d0 of technomancy/swank-clojure.
Visit technomancy/swank-clojure@12e96d0 to see
that commit.
@susam
Copy link
Contributor Author

susam commented Nov 18, 2019

Here are the steps to test this pull request:

  1. Install Maven.

    # On Debian, Ubuntu, etc.
    apt-get update
    apt-get install maven
    
    # On macOS
    brew install openjdk maven
    export JAVA_HOME=/usr/local/opt/openjdk
    export PATH="$JAVA_HOME/bin:$PATH"
  2. Install Clojure.

    git clone https://github.com/clojure/clojure.git ~/clojure
    git -C ~/clojure checkout clojure-1.10.1
    mvn -f ~/clojure/pom.xml -Plocal -Dmaven.test.skip=true package
    java -jar ~/clojure/clojure.jar -e '(clojure-version)'
  3. Install Slimv.

    git clone https://github.com/kovisoft/slimv.git ~/.vim/bundle/slimv
    echo 'set runtimepath^=~/.vim/bundle/slimv' >> ~/.vimrc
    vim +'helptags ~/.vim/bundle/slimv/doc' +q
  4. Run Swank.

    SWANK_PATH=~/.vim/bundle/slimv/swank-clojure
    java -cp "$HOME/clojure/clojure.jar:$SWANK_PATH" clojure.main -i "$SWANK_PATH/swank/swank.clj" -e '(swank.swank/start-repl)' -r

    Without the change in this pull request, the following error occurs:

    Syntax error (IllegalArgumentException) compiling new at (swank/commands/basic.clj:174:24).
    No matching ctor found for class clojure.lang.Compiler$CompilerException
    user=> 
    
  5. Apply this change and run Swank again.

    cd ~/.vim/bundle/slimv
    git checkout -b clojure-exception-macro
    git pull https://github.com/susam/slimv clojure-exception-macro
    
    SWANK_PATH=~/.vim/bundle/slimv/swank-clojure
    java -cp "$HOME/clojure/clojure.jar:$SWANK_PATH" clojure.main -i "$SWANK_PATH/swank/swank.clj" -e '(swank.swank/start-repl)' -r

    With the change in this pull request, Swank starts successfully:

    user=> Connection opened on local port  4005
    #object[java.net.ServerSocket 0x66813e6e "ServerSocket[addr=localhost/127.0.0.1,localport=4005]"]
    user=>
    

Please let me know if you face any issues in testing this pull request.

@kovisoft kovisoft merged commit 49c21ad into kovisoft:master Nov 18, 2019
@susam susam deleted the clojure-exception-macro branch November 18, 2019 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants