Re: A syntax feature request: splitting literal strings

2009-04-04 Thread samppi
Great! The code that uses it would be kind of bulkier than I wanted, but it's okay. I can at least make my code much more readable without hurting its runtime performance. Thanks a lot. On Apr 4, 4:16 pm, Stuart Sierra wrote: > This can be macro-ized: > > (defmacro bigstr [& strings] >   "Concat

Re: Nested loops

2009-04-04 Thread David Sletten
On Apr 4, 2009, at 6:18 PM, Mark Triggs wrote: > > Hi David, > > Quite a few times when I've felt the need for this sort of thing I've > found that laziness comes to the rescue. Would something like this > sort of approach work for you? > > (defn possibilities [word pos] > "All variations of

Re: Nested loops

2009-04-04 Thread jim
I didn't take time to read your post in detail because I'm on my way to bed and my brain has already checked out. However, as I've gotten better at Clojure and functional programming, I find I use loops less and less. I just got done putting the finishing touches on a package to analyse stock ch

Re: Nested loops

2009-04-04 Thread Mark Triggs
Hi David, Quite a few times when I've felt the need for this sort of thing I've found that laziness comes to the rescue. Would something like this sort of approach work for you? (defn possibilities [word pos] "All variations of `word' with letters from 'a' to 'z' inserted at `pos'" (let [[b

Re: retrieving argument :tag metadata

2009-04-04 Thread Stuart Sierra
Maybe this is what you're looking for: user> (meta (resolve 'slurp)) {:ns #, :name slurp, :file "core.clj", :line 3004, :arglists ([f]), :doc "Reads the file named by f into a string and returns it."} user> (:arglists (meta (resolve 'slurp))) ([f]) user> (first (first (:arglists (meta (resolve 's

Re: retrieving argument :tag metadata

2009-04-04 Thread Carsten Saager
Perhaps I am too stupid, but I can't get it too work to define a function/macro that returns me the arglists of a function I pass to it. The ^#' seems to work only on the symbol in the script - how do I wrap this? Concrete problem: I have some functions that users provide and they are supposed t

Nested loops

2009-04-04 Thread David Sletten
I'm working on a spell checker that attempts to suggest corrections from a given dictionary. One of the heuristics is to see if inserting a character at each point in the given string results in a recognized word. So I have an outer loop that moves across each position in the string and an

Re: proposed new contrib: java-utils

2009-04-04 Thread Stuart Sierra
On Apr 3, 10:17 am, Stuart Halloway wrote: > (3) coercions for Java's irritating types: File/String, ... clojure.contrib.duck-streams has "file" but not the others -the other Stuart --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: A syntax feature request: splitting literal strings

2009-04-04 Thread Stuart Sierra
This can be macro-ized: (defmacro bigstr [& strings] "Concatenates strings at compile time." (apply str strings)) user> (macroexpand-1 '(bigstr "This is a really long string " "that I just felt like using " "in my program.")) "This

Re: Java interoperability and Clojure

2009-04-04 Thread kyle smith
I wrote some functions to streamline reflection here. http://groups.google.com/group/clojure/browse_thread/thread/ea23cd11b7bd8999/f32795d9a79eeeb9?lnk=gst&q=accessing+private#f32795d9a79eeeb9 --~--~-~--~~~---~--~~ You received this message because you are subscribe

[ANN] clojuredev 0.0.30 released

2009-04-04 Thread Laurent PETIT
New release, with a lot of changes! I would particularly like to thank Stephan Mühlstrasser for his contributions ! The clojure symbols omni-completion feature was also quickly made available thanks to Meikel Brandmeyer's help and code :-) IMPORTANT NOTE: the layouts of the plugins that host cloj

Re: A clojure server

2009-04-04 Thread Meikel Brandmeyer
Hi, Am 04.04.2009 um 23:41 schrieb bOR_: Has anyone tried to combine clojure-server and vimclojure yet? I'm still hopping IDEs to see which system I like best, and vim was next on the list :). I'm haven't tried, yet. But the gensymed namespace certainly will get in the way, since VimClojure r

Re: A clojure server

2009-04-04 Thread bOR_
Has anyone tried to combine clojure-server and vimclojure yet? I'm still hopping IDEs to see which system I like best, and vim was next on the list :). On Apr 4, 9:56 pm, Konrad Hinsen wrote: > On 04.04.2009, at 19:45, christ...@mvonessen.de wrote: > > > I'm not sure I undestand what you want to

Re: A clojure server

2009-04-04 Thread Konrad Hinsen
On 04.04.2009, at 19:45, christ...@mvonessen.de wrote: > I'm not sure I undestand what you want to do, but couldn't you just do > > (in-ns 'clojure.core) > (def #^{:private true} > global-hierarchy (make-hierarchy)) > > and be happy? That should indeed work... I'll try! I tried to install

Re: Every function is a thread in Clojure?

2009-04-04 Thread Curran Kelleher
Indeed! this is a perfect discussion - great clarifications to a worthy question On Apr 4, 9:14 am, Rayne wrote: > Never be sorry about being curious. > > On Apr 3, 10:06 am, Berlin Brown wrote: > > > On Apr 3, 10:09 am, Stuart Halloway wrote: > > > > No threads: > > > > (ancestors (class (fn[

Re: A syntax feature request: splitting literal strings

2009-04-04 Thread samppi
Of course–it's good that Clojure does that. :) Along with the fact that it's intuitive, docstrings are in a standardized style to print nicely with (doc): (defn foo "First line is wrapping around and is indented by two spaces. But this is only because (doc) allows for this, indenting the

Re: A clojure server

2009-04-04 Thread christ...@mvonessen.de
> > I wonder if it is possible somehow to reload clojure.core. The main   > reason would be to reset the global hierarchy for multimethods. > I'm not sure I undestand what you want to do, but couldn't you just do (in-ns 'clojure.core) (def #^{:private true} global-hierarchy (make-hierarchy)

Re: Bloggin' 'bout Dataflow

2009-04-04 Thread Jeffrey Straszheim
Yes! I did forget to provide a link. http://jstraszheim.livejournal.com/ On Apr 4, 1:23 pm, Jeffrey Straszheim wrote: > I've started a series of blog posts about the use and implementation of my > "Cells like" Dataflow library that currently lives in contrib.  I'd love to > get some traffic to

Bloggin' 'bout Dataflow

2009-04-04 Thread Jeffrey Straszheim
I've started a series of blog posts about the use and implementation of my "Cells like" Dataflow library that currently lives in contrib. I'd love to get some traffic to it. Even more, since I'm looking for a job now, I wouldn't mind some links to it so maybe it will show up when potential employ

Re: A syntax feature request: splitting literal strings

2009-04-04 Thread Joshua Fox
Of course, Clojure's treatment of simple multiline literal strings already handles them intuitively user=> "a multiline string" "a multiline\nstring" user=> Java and many other popular languages don't do this. But I understand that you'd like to have the literal newline ignored. Joshua --~--~-

Re: A clojure server

2009-04-04 Thread Konrad Hinsen
On 04.04.2009, at 14:39, christ...@mvonessen.de wrote: >> Temporary namespaces are working now. Yay! >> (in-ns 'user) doesn't work, as for every connection a new namespace >> name is gensym'ed. After the connection is closed, the namespace >> is deleted. > > Oh yeah, I forgot: Classes aren't relo

Re: A syntax feature request: splitting literal strings

2009-04-04 Thread samppi
I see—perhaps using (str) would indeed be the best answer. I'll be doing that for now, but I wonder what Rich Hickey thinks of this. Indeed, this is a big headache in just about every programming language I've encountered. I'd rather not have to do this: (...lots of inde

Programming Clojure Beta 9 Is Out

2009-04-04 Thread Stuart Halloway
http://blog.thinkrelevance.com/2009/4/4/programming-clojure-beta-9-is-out --~--~-~--~~~---~--~~ 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 To unsubscribe

Re: A syntax feature request: splitting literal strings

2009-04-04 Thread Vincent Foley
I'm in favor of auto concatenating multiple string literals at compilation, but I am strongly opposed to doing any sort of formatting with them. If you want a new line, you stick a \n in your first string; if you want a space, you stick it in there as well. This: "hello" "world" should tra

Re: Every function is a thread in Clojure?

2009-04-04 Thread Rayne
Never be sorry about being curious. On Apr 3, 10:06 am, Berlin Brown wrote: > On Apr 3, 10:09 am, Stuart Halloway wrote: > > > > > No threads: > > > (ancestors (class (fn[]))) > > -> #{java.lang.Runnable java.io.Serializable clojure.lang.AFn > > clojure.lang.Obj java.lang.Object clojure.lang.Fn

Re: A clojure server

2009-04-04 Thread christ...@mvonessen.de
On Apr 4, 12:58 pm, "christ...@mvonessen.de" wrote: > > I haven't tried Christian's Clojure-specific server yet, but if it   > > solves that problem, I'll probably adopt it. > > Temporary namespaces are working now. Yay! > (in-ns 'user) doesn't work, as for every connection a new namespace > name

Re: A clojure server

2009-04-04 Thread christ...@mvonessen.de
> I haven't tried Christian's Clojure-specific server yet, but if it   > solves that problem, I'll probably adopt it. Temporary namespaces are working now. Yay! (in-ns 'user) doesn't work, as for every connection a new namespace name is gensym'ed. After the connection is closed, the namespace is