Re: Question about lein swank and emacs

2010-10-25 Thread David Jagoe
On 26 October 2010 04:36, Mark Engelberg wrote: > When I do restart-inferior-lisp, it says, "no inferior lisp process". Yeah, that'll only work if you originally started swank from emacs as the inferior lisp process. If you're doing 'lein swank' on the command line it won't work - looks like elei

Re: Getting this error regarding duck-streams/spit ...

2010-10-25 Thread Btsai
I don't think it's a mistake or accident that spit exists in clojure.core. In 1.2, duck-streams became deprecated and functions such as spit were incorporated into clojure.core: http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/spit http://clojure.github.com/clojure-contrib/duc

Re: Getting this error regarding duck-streams/spit ...

2010-10-25 Thread Victor Olteanu
Thank you. The following statement worked for me: (:require [clojure.contrib.duck-streams :as d]) As I was using slurp and slurp*, I then had to do the following: use the form "d/slurp*" instead (prefixed with d/) use "slurp" without a change This brings up a related point - I can see that ther

Re: Question about lein swank and emacs

2010-10-25 Thread Mark Engelberg
When I do restart-inferior-lisp, it says, "no inferior lisp process". On Mon, Oct 25, 2010 at 1:31 PM, Drew Raines wrote: > Mark Engelberg wrote: > >> When you start a swank server with lein swank, and then connect to >> it via slime-connect in emacs, is there any way from within emacs >> to rest

Re: Getting this error regarding duck-streams/spit ...

2010-10-25 Thread Michael Ossareh
On Mon, Oct 25, 2010 at 19:09, Victor Olteanu wrote: > > java.lang.IllegalStateException: spit already refers to: > #'clojure.contrib.duck-streams/spit in namespace: datatool.api (api.clj:1) > Hi Victor, I solved this issue by using (require) instead of (use). i.e. (ns myapp (require [other-ns

Getting this error regarding duck-streams/spit ...

2010-10-25 Thread Victor Olteanu
Hi friends, I am getting the following error and was hoping somebody may be able to assist: java.lang.IllegalStateException: spit already refers to: #'clojure.contrib.duck-streams/spit in namespace: datatool.api (api.clj:1) I realized it's because clojure.contrib.duck-streams/spit is overriding

Images in autodoc?

2010-10-25 Thread Chris
Is it possible to add images to autodoc-generated pages like javadoc can? I'm interested in adding explanatory diagrams to function documentation as opposed to adding things like logos to the HTML pages. Thanks, Chris -- You received this message because you are subscribed to the Google Groups

Re: post your feedback on the conj

2010-10-25 Thread lprefontaine
Hi Stu, I came back from the Conj with 12 pages of notes in a 2 inches by 3 inches notebook. That represented 3 months of work at least. On the return flight, I added another 3 pages of notes. I made some connections between ideas exposed at the Conj in relation with our work here. Now I have ab

Re: Wildcards on multimethod matching

2010-10-25 Thread Tim Daly
Common lisp allows you to call DEFINE-METHOD-COMBINATION. (Steele p830) There is a default generic method combination defined which can be modified by this call. If Clojure used a function to do the method resolution then it would be possible to replace this with a user defined function. This wo

Re: Wildcards on multimethod matching

2010-10-25 Thread Mark Nutter
> So in this particular case I wouldn't care, but in general I'd expect > the prefer-method stuff to kick in. :) Oops, forgot about prefer-method. My noobishness is showing again. Well, in for a dime in for a dollar. Here's something I whipped up just for the general amusement of the list. It's no

Re: Test-driven development in Clojure

2010-10-25 Thread Felix H. Dahlke
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ah, I get it. This works really well! (defn mock-page-fixture [f] (binding [load-page (fn [name] ...)] (f))) This approach feels very functional indeed, I'm going to use it. It's not really the same as my original TDD inspired design, because t

Re: Question about lein swank and emacs

2010-10-25 Thread Drew Raines
Mark Engelberg wrote: > When you start a swank server with lein swank, and then connect to > it via slime-connect in emacs, is there any way from within emacs > to restart the swank server and/or delete all definitions to start > from a clean slate? In the *slime-repl ...* buffer enter: , rest

Re: understanding laziness

2010-10-25 Thread Tim Webster
Thanks, Jürgen. I think you are saying that there is no difference with respect to laziness between my approach and Ken's literal, so I can remove that from consideration as the cause of my problem. I have looked at my repl session pretty closely and do not think that I clobbered any of the variabl

Review Request: Validation in contrib.command-line

2010-10-25 Thread Andrew Gwozdziewycz
Hey All, I'd have posted this to clojure-dev if I wasn't still pending access (I'm sure the queue is large, so no worries), but, the fine folks in IRC said here would be appropriate as well. This morning I was looking to do some command line parsing and went with clojure.contrib.command_line that

Clojure 1.3 Alpha 2

2010-10-25 Thread Stuart Halloway
Clojure 1.3 Alpha 2 is now available at http://clojure.org/downloads = CHANGES = 0 Changes from 1.3 Alpha 1 to 1.3 Alpha 2 1 Changes from 1.2 to 1.3 Alpha 1 2 About Alpha Releases = 0 Changes from 1.3 Alpha 1 to 1.3 Alpha 2 * code path for using vars is now *much* faster for the c

Re: understanding laziness

2010-10-25 Thread Jürgen Hötzel
2010/10/25 Tim Webster : > I thought that the issue might be that the concrete data still was not > populated in my list-of-lists, unlike your literal, so I started with > a clean environment and re-ran my repl session line by line from the > jline history file. I could not reproduce the error. (Wh

Re: Creating Java array of specific type

2010-10-25 Thread Kyle R. Burton
> If I have a seq of NameValuePair (a class in Apache HttpClient), how > do I get an array of that type (NameValuePair[])? I've tried a few > things but always got Object[]. Two quick ways are make-array and into-array: (make-array String 10) (into-array String ["this" "that"]) These both

Re: understanding laziness

2010-10-25 Thread Alan
#(nth % 1) is the same as clojure.core/second. You can also use (.split data "\n") instead if you like; it's nice to have the function first. On Oct 25, 9:04 am, Tim Webster wrote: > I thought that the issue might be that the concrete data still was not > populated in my list-of-lists, unlike you

Creating Java array of specific type

2010-10-25 Thread Hong Jiang
Hi, I have been able to find answer to this on Google, so here it is: If I have a seq of NameValuePair (a class in Apache HttpClient), how do I get an array of that type (NameValuePair[])? I've tried a few things but always got Object[]. Thanks. --Hong -- You received this message because you

Re: understanding laziness

2010-10-25 Thread Tim Webster
I thought that the issue might be that the concrete data still was not populated in my list-of-lists, unlike your literal, so I started with a clean environment and re-ran my repl session line by line from the jline history file. I could not reproduce the error. (Which troubles me even more...the e

Re: Setting Clojure “constants” at runtime (cros sposted to Stackoverflow)

2010-10-25 Thread Aaron Cohen
On Sat, Oct 23, 2010 at 8:53 AM, Ralph wrote: > Won't work. The "def" gets executed at compile time, before the JAR > file exists. > I'm very confused by what you mean by this. If I do the following, I get a new random value every time I run it, which does not seem to match what you are saying:

Re: Test-driven development in Clojure

2010-10-25 Thread Brian Marick
On Oct 24, 2010, at 2:03 PM, Felix H. Dahlke wrote: > I just read through this thread again and noticed that I didn't notice > you mentioning that I can stub functions within tests. I had a look at > the clojure.test documentation, but I didn't find an example of that. In Midje

Re: understanding laziness

2010-10-25 Thread Ken Wesson
On Oct 24, 11:46 pm, Tim Webster wrote: > I have an issue that I think is related to laziness, but I am not sure > I understand where the problem lies. > > Let's say I have tabular data in a sequence of sequences. I get the > second column of the table like this: > > (map #(nth % 1) my-table) > >

Re: Wildcards on multimethod matching

2010-10-25 Thread Tim Daly
The issue of "what to call" and "when to call it" has been debated in the common lisp world a long time ago. There are solutions to these questions in the discussions around the CLOS facility (Steele, "Common Lisp: The Language", chapter 28) Prior to that there was a discussion of the same issue

Re: Setting Clojure “constants” at runtime (cros sposted to Stackoverflow)

2010-10-25 Thread Ralph
That's interesting... Hadn't thought of using delay. A user on Stackoverflow (kotarak) suggested using alter-var-root. This method will also support setting values for command line arguments. On Oct 24, 3:33 pm, Stuart Sierra wrote: > Here's one way: > >     (def version (delay (... read the JAR

Re: Question about lein swank and emacs

2010-10-25 Thread rb
Check out this Emacs package: http://github.com/remvee/elein The command you need is called `elein-reswank' there. cheers, rb On Oct 25, 7:13 am, Mark Engelberg wrote: > When you start a swank server with lein swank, and then connect to it > via slime-connect in emacs, is there any way from wi

understanding laziness

2010-10-25 Thread Tim Webster
I have an issue that I think is related to laziness, but I am not sure I understand where the problem lies. Let's say I have tabular data in a sequence of sequences. I get the second column of the table like this: (map #(nth % 1) my-table) I can do some sequence things directly to the list retur

Re: Wildcards on multimethod matching

2010-10-25 Thread Paul Richards
So in this particular case I wouldn't care, but in general I'd expect the prefer-method stuff to kick in. :) On 25 October 2010 10:54, Mark Nutter wrote: > I tried to have a go at this, but then I realized it's a bit difficult > to specify. For example, if you have > > (defmethod bar [42 _] ..)

Re: Wildcards on multimethod matching

2010-10-25 Thread Mark Nutter
I tried to have a go at this, but then I realized it's a bit difficult to specify. For example, if you have (defmethod bar [42 _] ..) ; and (defmethod bar [_ 16] ..) which one should be called when you give it (bar 42 16)? Mark On Sat, Oct 23, 2010 at 5:16 PM, Paul Richards wrote: > Hi, > I ha

Re: ANN: Emacs auto-complete plugin for slime users

2010-10-25 Thread Preecha P
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

Re: Wildcards on multimethod matching

2010-10-25 Thread Sunil S Nandihalli
and defn-match from the matchure library might be able to solve some of your problems .. Just a wild guess .. to solve the wild-cards problem ... :) Just look at http://github.com/dcolthorp/matchure On Mon, Oct 25, 2010 at 1:59 PM, Sunil S Nandihalli < sunil.nandiha...@gmail.com> wrote: > Hello

Re: Wildcards on multimethod matching

2010-10-25 Thread Sunil S Nandihalli
Hello .. Just my two cents.. I think the ability to specify an equality function when creating the multi-method would solve the problem. for example (defmulti foo dispatch-fn equality-fn) would be very nice. one can use arbitrary functions to match ... which may be reimplemented at users wish t