Re: Jesus, how the heck to do anything?
I think you should take a look at clojure box again. You could split the windows and have both code/repl open at the same times. After you feel comfortable with that, try leiningen and build some project. On Mar 23, 2:50 pm, ultranewb wrote: > Short version: How do I just open an editor, type in some Clojure > code, save it in a file, and then run it? > > Long version: Okay, I'm very new to Clojure. But I'm not a Java > programmer (don't want to be). I'm not used to all this complexity > just to do something simple. What I want to do is the "normal > programming" that I do with every other environment and language I > work with, i.e. I edit some source code on screen, save it in a file, > and either compile/run, or interpret it or whatever. But I haven't > figured out how to do that yet, and don't know if it's possible. > > I downloaded Netbeans and Enclojure. It runs fine. I can get a REPL, > blah blah. But have no idea how to do anything "real" i.e. execute a > program saved in a file. Again, I want to edit some code with the > very nice editor, save it, and hit some button that says "execute" or > perhaps "compile and execute" or perhaps "build and execute" or > whatever. But apparently there is a heck of a lot more to it than > that. I understand that you have to build a "project" or whatever. > Fine - I did that. Still, I have no idea which directory out of that > huge structure I'm supposed to put code in, I have no idea how to set > up all these "dependencies" or whatever. I did try some random stuff, > i.e. saving a file in various directories and hitting "build" but that > didn't work. I also tried editing various files that were already > there, hoping one of them was the "main" file I was supposed to be > dumping source code into, but that didn't work either. > > So I downloaded Clojure Box. It installs and runs fine. Again, I get > a REPL no problem. But there's only so much coding I can do in a > REPL. Again, I'd like to do more. > > I spent a long time trying to find some help online (googling, etc), > but everything I've found assumes I know too much, i.e. how to set up > all these projects and dependencies. > > Actually, I'm not interested in fooling with all the boilerplate and > crap AT ALL. So if I HAVE to do that, I'm outta here. But something > tells me I may not have to, i.e. there may be some automated tool > somewhere, or some "template" files I can just use over and over, or > some "trick" to use like "just name your program 'main' and stick it > in such-and-such directory." > > Any help? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: ANN: Emacs auto-complete plugin for slime users
Excellent, I still wonder why hook doesn't work but your solution work perfectly here, thanks. On Oct 21, 8:55 am, Paul Mooser wrote: > I was having this problem, and what solved it for me was to customize > the ac-modes variable (using M-x customize-variable RET ac-modes RET) > and adding slime-repl-mode to the list. Once I added this, auto- > complete gets automatically enabled on my repl buffers as well. Give > it a try! > > On Oct 17, 10:00 am, Preecha P wrote: > > > Same here. It seems like auto-complete-mode doesn't fire up > > correctly. I tried to hook it using (add-hook 'slime-repl-mode-hook > > (lambda () (auto-complete-mode t) but it doesn't seems to do anything. > > I have to open the mode manually. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: ANN: Emacs auto-complete plugin for slime users
Same here. It seems like auto-complete-mode doesn't fire up correctly. I tried to hook it using (add-hook 'slime-repl-mode-hook (lambda () (auto-complete-mode t) but it doesn't seems to do anything. I have to open the mode manually. On Oct 16, 11:27 am, Jarl Haggerty wrote: > Should autocomplete work in the swankrepl? It works perfectly in a > clj buffer but nothing happens in therepl. > > On Aug 19, 7:46 am, Phil Hagelberg wrote: > > > On Thu, Aug 19, 2010 at 6:21 AM, Steve Purcell wrote: > > > I guess Phil's very busy, but if he can apply this patch, then the > > > regular swank-clojure 1.3.0-SNAPSHOT on clojars should end up containing > > > the fix. > > > Just applied this patch and pushed to github and clojars. Thanks! > > > -Phil -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Does emacs suppress output from thread ?
Thanks for the explanation. I think I'll look at swank-clojure later since emacs went haywire last time I touched it.. On May 18, 2:33 pm, alux wrote: > I should add, that a new thread runs in the default environment again. > > You may set the *out* variable in your thread with "binding": > > (let [dummy *out*] ; to have a name for the current *out* > (.start (Thread. (fn [] (binding [*out* dummy] (prn x)) > > Regards, alux > > On 18 Mai, 09:26, alux wrote: > > > > > Hi Preecha, > > > output in Clojure is sent to *out* (a variable that refers to > > System.out by default). If you use emacs / slime this variable will be > > set differently. You should find your threads output in the swank- > > REPL, if you can find it somewhere. > > > Regards, alux > > > On 18 Mai, 03:26, Preecha P wrote: > > > > I tried to play around with thread with these lines of code. It should > > > print the value of variable but it doesn't.. > > > > In emacs. > > > user> (def x 5) > > > #'user/x > > > user> x > > > 5 > > > user> (import [java.lang Thread]) > > > java.lang.Thread > > > user> (.start (Thread. (fn [] (print x > > > nil > > > > or with agent > > > user> (def foo (agent 0)) > > > #'user/foo > > > user> foo > > > # > > > user> (send foo (fn[num] (do (println num) (inc num > > > # > > > > I ran the exact same code in command-line and the thread could print > > > the output fine. > > > > Clojure 1.1.0-master-SNAPSHOT > > > user=> (def foo (agent 0)) > > > #'user/foo > > > user=> foo > > > # > > > user=> (send foo (fn[num] (do (println num) (inc num) ))) > > > 0 > > > # > > > > I installed everything from elpa, so I guess some of the component > > > might gone wrong. Any idea ? > > > > thanks. > > > > -- > > > You received this message because you are subscribed to the Google > > > Groups "Clojure" group. > > > To post to this group, send email to clojure@googlegroups.com > > > Note that posts from new members are moderated - please be patient with > > > your first post. > > > To unsubscribe from this group, send email to > > > clojure+unsubscr...@googlegroups.com > > > For more options, visit this group > > > athttp://groups.google.com/group/clojure?hl=en > > > -- > > You received this message because you are subscribed to the Google > > Groups "Clojure" group. > > To post to this group, send email to clojure@googlegroups.com > > Note that posts from new members are moderated - please be patient with > > your first post. > > To unsubscribe from this group, send email to > > clojure+unsubscr...@googlegroups.com > > For more options, visit this group > > athttp://groups.google.com/group/clojure?hl=en > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group > athttp://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Does emacs suppress output from thread ?
I tried to play around with thread with these lines of code. It should print the value of variable but it doesn't.. In emacs. user> (def x 5) #'user/x user> x 5 user> (import [java.lang Thread]) java.lang.Thread user> (.start (Thread. (fn [] (print x nil or with agent user> (def foo (agent 0)) #'user/foo user> foo # user> (send foo (fn[num] (do (println num) (inc num # I ran the exact same code in command-line and the thread could print the output fine. Clojure 1.1.0-master-SNAPSHOT user=> (def foo (agent 0)) #'user/foo user=> foo # user=> (send foo (fn[num] (do (println num) (inc num) ))) 0 # I installed everything from elpa, so I guess some of the component might gone wrong. Any idea ? thanks. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Error when tried to compile with C-c C-k in emacs.
Thanks for the answer. It's pretty clear for me now. Little off topic here, I just installed everything using elpa, where does clojure.jar go ? and how to add some classpath to it ? I assume that it could be add by specifying folder swank-clojure-classpath, but this variable only appear after I call slime so I couldn't use add-to- list in .emacs. -Preecha -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en To unsubscribe, reply using "remove me" as the subject.
Error when tried to compile with C-c C-k in emacs.
Hi, I setup my emacs/swank-clojure/clojure without using elpa. I could run slime/swank-clojure and evaluate an expression just fine, but when I try to compile with C-c C-k, it give me this error. Wrong number of args passed to: basic$eval--2073$compile-file-for- emacs [Thrown class java.lang.IllegalArgumentException] Restarts: 0: [ABORT] Return to SLIME's top level. Backtrace: 0: clojure.lang.AFn.throwArity(AFn.java:441) 1: clojure.lang.AFn.invoke(AFn.java:61) 2: clojure.lang.Var.invoke(Var.java:385) 3: user$eval__3020.invoke(NO_SOURCE_FILE) 4: clojure.lang.Compiler.eval(Compiler.java:5358) 5: clojure.lang.Compiler.eval(Compiler.java:5326) 6: clojure.core$eval__4174.invoke(core.clj:2139) --more-- = I have no clue where should I look into. Any suggestion would be really appreciate. Preecha -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Problem with installation of swank-clojure without elpa...
Well, as I said in previous post, I got stringp error with advice on slime-read-interative-args. My guess is that there is something wrong in (aput 'slime-lisp-implementations 'clojure (list (swank-clojure-cmd) :init 'swank-clojure-init))) in swank- clojure.el I think I might try to look at it again later. Thanks for comment. On Apr 6, 1:13 pm, ubolonton wrote: > advice on `slime-read-interactive-arg' is used to add clojure to > `slime-lisp-implementations', and set up classpath each time slime > starts. > This advice is not loaded by default. Other .emacs files use ELPA, > which loads the advice for them. > Without ELPA it's necessary to load the advice using `ad-activate' > after (require 'swank-clojure) > > On Apr 6, 2:23 am, Preecha P wrote: > > > Tried that, not working. It gave me "Wrong type argument: stringp, > > 126" error in mini buffer. I don't think that's the problem, most > > '.emacs" I saw on internet doesn't use that. > > > On Apr 5, 9:43 pm, ubolonton wrote: > > > > Maybe you forgot this > > > > (ad-activate 'slime-read-interactive-args) > > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en To unsubscribe, reply using "remove me" as the subject.
Re: Problem with installation of swank-clojure without elpa...
Tried that, not working. It gave me "Wrong type argument: stringp, 126" error in mini buffer. I don't think that's the problem, most '.emacs" I saw on internet doesn't use that. On Apr 5, 9:43 pm, ubolonton wrote: > Maybe you forgot this > > (ad-activate 'slime-read-interactive-args) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en To unsubscribe, reply using "remove me" as the subject.
Problem with installation of swank-clojure without elpa...
Hi, I have some problem with swank-clojure installation. Since I already had SLIME/SBCL setup on my box so I followed some guide (http:// tentclube.blogspot.com/2010/01/manual-installation-not-using-elpa- of.html). The problem is the "clojure" didn't appear in "slime-lisp- implementations" variable as described in swank-clojure's documentation, thus I can't run clojure from -M-x slime. I checked in emacs with C-h v, and nothing there but only sbcl. ===C-h v slime-lisp-implementations == slime-lisp-implementations is a variable defined in `slime.el'. Its value is ((sbcl ("/usr/bin/sbcl"))) = Also, this is my .emacs === (add-to-list 'load-path "~/opt/emacs") ;;configuration (setq default-directory "~/Documents/") (setq ess-directory "~/Documents/") (transient-mark-mode t) (global-font-lock-mode 1) ;;slime (add-to-list 'load-path "~/opt/slime") (setq slime-lisp-implementations '((sbcl ("/usr/bin/sbcl" (require 'slime) (slime-setup) ;;Clojure coniguration ;; ;;clojure-mode (add-to-list 'load-path "~/clj/clojure-mode/") (require 'clojure-mode) ;;swank-clojure (add-to-list 'load-path "~/clj/swank-clojure/") (setq swank-clojure-jar-home "~/clj/runtime/lib/") (setq swank-clojure-classpath "~/clj/runtime/lib/") ;;;clojure.jar/swank.jar/contrib.jar are in ~/clj/runtime/lib. (require 'swank-clojure) == Any idea ? I'm pretty new to emacs so I hope my question isn't stupid. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en To unsubscribe, reply using "remove me" as the subject.