简体   繁体   中英

How use repl with emacs and leiningen

I'm beginning my learning in clojure and a hard part of this has been work with libraries and dependencies...I've worked with javascript and ruby and they have rubygems and npm..really simple...now I'm trying use leiningen..I've installed this, I use emacs and install elein too...I can create a project, handle the libraries and dependencies and work fine..but I can't use the repl and my slime "evaluate expression and evaluate region" don't work...I'm really newbie with slime and clojure mode..and more newbie with leiningen and I don't know how is the workflow...

I set my libraries inside project, my main namespace and invoke "elein-deps" or "elein-install"

I wrote my code and run it using "elein-run"...it run fine

but how can I use the repl..are there a automated way for load the leiningen repl or do I need import my files and namespace inside my repl (sorry but I'm newbie with clojure and I'm not used to the way load files and namespaces with it...I must use "load-file" and the full path to my file...or must I use "use"??)

please if can explain me how is the workflow with leiningen inside clojure I would appreciate it..many thanks!!

You need to use 'require' or 'use' to load your code into environment. Leiningen has support for evaluation of code during REPL initialization, the file with code is specified using ':repl-init-script' option. This file will also evaluated during swank's load...

PS you can also look onto ':repl-init' option - it will load given namespace and switch to it...

PPS you can also use Mx clojure-jack-in from fresh clojure mode, to bootstrap swank, run 'lein swank' & connect to swank's REPL

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM