Re: evalOnlyDefs

2009-01-23 Thread Konrad Hinsen
On 23.01.2009, at 22:47, Stephen C. Gilardi wrote: > Are you pointing out that closures as well as macros may require > same-world compilation? Yes. > When compiling that to bytecode, one could implement (effectively): > > (declare-private _my-factor-311) > (defn foo [x] (* _my-fa

Re: (clojure.contrib.lazy-seqs/combinations) should return [[]], not nil?

2009-01-23 Thread jawolfe
> On Fri, Jan 23, 2009 at 8:49 PM, Chouser wrote: >> This is the best version? > > Depends on your definition of "best". > > I just posted a version at http://paste.lisp.org/display/74134 which > is many times faster. I haven't had a chance to look at that in detail yet, but I'm 100% in favor of

Newbie: sync vs. dosync

2009-01-23 Thread samppi
sync and dosync's documentation seems to be virtually the same, except for the unimplemented flags-ignored-for-now parameter of sync. What is the difference in their functions? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Not nil and 'true' with conditional functions

2009-01-23 Thread Vincent Foley
The return value of a function is the return value of its last expression. On Jan 23, 3:17 pm, wubbie wrote: > Is every function supposed to return something? > Of course, except for pure side-effects. > > -sun > > On Jan 23, 3:02 pm, Vincent Foley wrote: > > > The only two false values in Cloj

merge, not just for maps?

2009-01-23 Thread rzeze...@gmail.com
user=> (doc merge) - clojure.core/merge ([& maps]) Returns a map that consists of the rest of the maps conj-ed onto the first. If a key occurs in more than one map, the mapping from the latter (left-to-right) will be the mapping in the result. nil According to merg

Re: (clojure.contrib.lazy-seqs/combinations) should return [[]], not nil?

2009-01-23 Thread Mark Engelberg
On Fri, Jan 23, 2009 at 8:49 PM, Chouser wrote: > This is the best version? Depends on your definition of "best". I just posted a version at http://paste.lisp.org/display/74134 which is many times faster. Also, I have to say that calling this function "combinations" is fairly nonstandard. Usu

Re: Regarding (.keySet {:a :map})

2009-01-23 Thread Chouser
On Sat, Jan 24, 2009 at 12:15 AM, e wrote: > > I wonder though if you can call instanceof from clojure to test Java types. user=> (instance? String "foo") true --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gro

Re: Regarding (.keySet {:a :map})

2009-01-23 Thread e
> > > > > Why? keySet is specified to return a java.util.Set, and that is what > > it does. set? tests for IPersistentSet. > > I assumed the persistent properties caried over, and that > IPersistentSet was a java.util.Set. I also assumed that IPersistentSet > extended IFn. > > Looks like I got the

Re: namespace concept

2009-01-23 Thread e
thanks. That sounds like a great answer, too. I thought about the precedent Java started, but they also put the parentheses in the wrong place, right :) ? And pretty it may be, but think about the free metaphor you get by making it slashes. You are inviting beginners into the language ("This is

Re: namespace concept

2009-01-23 Thread e
thank you for that nice explanation. It gets to the motivation ... the problem . . . the solution. So (to test my understanding), "use" makes symbols in another namespace part of your namespace (adding them to your map). Then when others 'deal' (require or use) your namespace, that stuff you 'us

Re: (clojure.contrib.lazy-seqs/combinations) should return [[]], not nil?

2009-01-23 Thread Chouser
On Fri, Jan 23, 2009 at 1:11 PM, Stephen C. Gilardi wrote: > > Please do enter it as an issue. I'd be interested in hearing from Chouser > before making the change. He added combinations to lazy-seqs. I did what now? My memory must be going. Here are some other implementations I apparently wen

Tail calls in OpenJDK

2009-01-23 Thread hughw
A fellow named Arnold Schwaighofer is hacking in TCO as a thesis project: http://mail.openjdk.java.net/pipermail/mlvm-dev/2009-January/000331.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. T

Re: namespace concept

2009-01-23 Thread Stephen C. Gilardi
On Jan 23, 2009, at 8:21 PM, e wrote: Ah hah! I finally understand something. See this is what would really help in the explanation. Something like, "In Java, each file defines only a single outer class, which must have the same name as the file. This simple approach means that there i

Re: Proposal: "smarter" set operations that take size into account for speed

2009-01-23 Thread Stephen C. Gilardi
On Jan 23, 2009, at 7:56 PM, e wrote: (ns my-ns (:use [clojure.set :exclude (difference)] [clojure.contrib.set :only (difference)])) Did you have to say ":exclude" or does the last thing override? I had to say :exclude. :use makes a call to refer whic

Re: namespace concept

2009-01-23 Thread Stephen C. Gilardi
On Jan 23, 2009, at 7:12 PM, e wrote: first explicit question: after the example lib and the bullets, I don't see why there are two different keywords, "use" and "require". Just look at the start of the sentences. They are identical. Why not just pick one of the two keywords and let "on

Re: namespace concept

2009-01-23 Thread e
> > Ah hah! I finally understand something. See this is what would really > help in the explanation. Something like, "In Java, each file defines only a > single outer class, which must have the same name as the file. This simple > approach means that there is never any confusion that the last s

Re: A nil puzzle

2009-01-23 Thread e
> sented with the empty set, which doesn't seem right. > > For sequences in general, Rich has said there is no such thing as an > empty seq: > > > http://groups.google.com/group/clojure/browse_thread/thread/966bd0d4bb18a4a2/b56470cbc8b4123e?lnk=raot&fwc=1 > so the answer is you don't convert the i

Re: Proposal: "smarter" set operations that take size into account for speed

2009-01-23 Thread e
> > (ns my-ns >(:use [clojure.set :exclude (difference)] > [clojure.contrib.set :only (difference)])) > Did you have to say ":exclude" or does the last thing override? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: namespace concept

2009-01-23 Thread e
On Fri, Jan 23, 2009 at 7:33 PM, Matt Moriarity wrote: > > 1) "use" and "require" differ in that use does what require does, > loads a library, but it also refers to the symbols in that lib in the > current namespace. So essentially if you want to use > clojure.contrib.def/defvar, if you (require

Re: namespace concept

2009-01-23 Thread Matt Moriarity
1) "use" and "require" differ in that use does what require does, loads a library, but it also refers to the symbols in that lib in the current namespace. So essentially if you want to use clojure.contrib.def/defvar, if you (require 'clojure.contrib.def), you would have to say (clojure.contrib.def

Re: [DISCUSS] Use an Issue tracker?

2009-01-23 Thread e
top right of page sort of points to it. I have problems finding stuff, too. I just realized only now that the stuff in the top right has two columns. There's also the problem that there's google's wiki in code.google, and there's wikibooks wiki. I'll have to check out JIRA. I personally LOVE e

Re: namespace concept

2009-01-23 Thread e
third: are there nested namespaces? I still don't really understand how to organize a project . . .best practices (and why they are the best practices) . . . whether or not there is actually any hard in having each lib just be one file. Thanks. On Fri, Jan 23, 2009 at 7:17 PM, e wrote: > seco

Re: More SLIME woes

2009-01-23 Thread Phil Hagelberg
Tom Emerson writes: > I updated my entire Clojure environment today to the latest in source > control: slime, swank-clojure, clojure, clojure-contrib, clojure-mode. > Now SLIME is unhappy. It appears that the swank-clojure code has been > patched appropriately. I think the best way to banish th

Re: namespace concept

2009-01-23 Thread e
second: since the namespace is used in code with slashes, why was it decided that it should have dots in the declaration/introduction? That's just confusing as far as I can tell. It's probably way too late to debate something like that, but maybe there's an "ah hah" reason. On Fri, Jan 23, 2009

Re: Binding values in a list of symbols and evaluating as code

2009-01-23 Thread Nathan Kitchen
On Jan 23, 1:47 pm, Zak Wilson wrote: > And it's now working perfectly, producing a new generation every > second. Now I actually have to tweak it to produce good results. It's great that this is working for you. I tried the same approach in a genetic programming project of my own, and I eventu

Re: namespace concept

2009-01-23 Thread e
first explicit question: after the example lib and the bullets, I don't see why there are two different keywords, "use" and "require". Just look at the start of the sentences. They are identical. Why not just pick one of the two keywords and let "only" be a modifier when you want only certain th

Re: namespace concept

2009-01-23 Thread e
sure. Thanks for the reference. On Fri, Jan 23, 2009 at 5:41 PM, Stephen C. Gilardi wrote: > > On Jan 23, 2009, at 4:54 PM, e wrote: > > [lots of stuff] > > > Would you please take a look at the text and example at > http://clojure.org/libs and ask questions about anything you don't > understand

Re: Proposal: "smarter" set operations that take size into account for speed

2009-01-23 Thread Jason Wolfe
> Hi Jason, > > Thanks very much for all your recent thought, work, and postings. > > I think it makes sense for clojure-contrib to be much more agile in   > accepting new, experimental, and incrementally improved code than   > Clojure proper. Things in contrib are always optional for end users s

Re: [DISCUSS] Use an Issue tracker?

2009-01-23 Thread Howard Lewis Ship
Well, its no JIRA :-) ... didn't see it, should be a link from the clojure.org page to it! On Fri, Jan 23, 2009 at 2:33 PM, Paul Barry wrote: > What's wrong with google code? > http://code.google.com/p/clojure/issues/list > > On Fri, Jan 23, 2009 at 5:29 PM, Howard Lewis Ship wrote: >> >> I'm a

Re: Regarding (.keySet {:a :map})

2009-01-23 Thread Christian Vest Hansen
On Fri, Jan 23, 2009 at 11:06 PM, Rich Hickey wrote: > > > > On Jan 23, 1:47 pm, Christian Vest Hansen > wrote: >> I type this expression in the REPL (trunk 1228): >> >> user=> (let [s (.keySet {:a 1})] [(set? s) (ifn? s)]) >> [false false] >> >> But I expected it to return [true true]. >> > > W

Re: More SLIME woes

2009-01-23 Thread Andrew Baine
On Jan 23, 1:53 pm, Tom Emerson wrote: > Hi all, > > I updated my entire Clojure environment today to the latest in source > control: slime, swank-clojure, clojure, clojure-contrib, clojure-mode. > Now SLIME is unhappy. It appears that the swank-clojure code has been > patched appropriately. I

Re: reader macros

2009-01-23 Thread Paul Barry
Mark, Yes, I think so. My understanding of a reader marco is a character or set of characters that is a shortcut for some other special form/macro that you could use if the reader macro didn't exist. By that definition, I think [...] and {...} are also reader macros. I think \ just part of the l

Re: reader macros

2009-01-23 Thread Matt Revelle
On Jan 23, 2009, at 4:18 PM, Mark Volkmann wrote: > > On Fri, Jan 23, 2009 at 3:00 PM, Chouser wrote: >> >> On Fri, Jan 23, 2009 at 2:17 PM, Mark Volkmann >> wrote: >>> >>> Are all of these considered "reader macros"? >> [snip] >>> Is it correct that these are not considered "reader macros"?

Re: Proposal: "smarter" set operations that take size into account for speed

2009-01-23 Thread Jason Wolfe
> I appreciate your desire to contribute, but Clojure is not just about > your needs. You have flooded the group with every idea you have, some > are bugs (important), some are good ideas, some not, but there are > simply too many to address at the rate you are producing them. OK, I am sorry. I

Re: namespace concept

2009-01-23 Thread Stephen C. Gilardi
On Jan 23, 2009, at 4:54 PM, e wrote: [lots of stuff] Would you please take a look at the text and example at http://clojure.org/libs and ask questions about anything you don't understand in it? Once you understand libs (through reading and asking questions here), I think it will make l

Re: [DISCUSS] Use an Issue tracker?

2009-01-23 Thread Paul Barry
What's wrong with google code? http://code.google.com/p/clojure/issues/list On Fri, Jan 23, 2009 at 5:29 PM, Howard Lewis Ship wrote: > > I'm always a fan of using a real issue tracking system; I'd love to > see Clojure using JIRA to track what's going on, and what's coming up, > in a public and

[DISCUSS] Use an Issue tracker?

2009-01-23 Thread Howard Lewis Ship
I'm always a fan of using a real issue tracking system; I'd love to see Clojure using JIRA to track what's going on, and what's coming up, in a public and visible way. It'll make it feel more like a community project, less like a one-man show (I deal with that perception all the time on Tapestry).

Re: Proposal: "smarter" set operations that take size into account for speed

2009-01-23 Thread Stephen C. Gilardi
On Jan 23, 2009, at 3:23 PM, Jason Wolfe wrote: OK, if these are not wanted in core right now, will anyone sign off for adding them to clojure.contrib? I can't say I like the idea of having two sets of functions that do exactly the same thing, but ... sometimes you just don't want things to ru

Re: Regarding (.keySet {:a :map})

2009-01-23 Thread Rich Hickey
On Jan 23, 1:47 pm, Christian Vest Hansen wrote: > I type this expression in the REPL (trunk 1228): > > user=> (let [s (.keySet {:a 1})] [(set? s) (ifn? s)]) > [false false] > > But I expected it to return [true true]. > Why? keySet is specified to return a java.util.Set, and that is what it d

Re: contains

2009-01-23 Thread wubbie
(some (set "aeiou") "e") is equiv to (some #{\a \e \i \o \u} "e") -> \e Finally, I can answer, instead of keep asking... -sun On Jan 23, 4:04 pm, Mark Volkmann wrote: > On Fri, Jan 23, 2009 at 2:51 PM, Chouser wrote: > > > On Fri, Jan 23, 2009 at 3:47 PM, Mark Volkmann > > wrote: > > >> (c

namespace concept

2009-01-23 Thread e
Hi I don't really get namespaces, and, yes, I looked at http://clojure.org/namespaces . . . but was lost at "interned" (thinking about this more, I think I know what it means ... perhaps a link to a definition would work). Is it like C++ where it doesn't matter what subdirectory a file is in ..

More SLIME woes

2009-01-23 Thread Tom Emerson
Hi all, I updated my entire Clojure environment today to the latest in source control: slime, swank-clojure, clojure, clojure-contrib, clojure-mode. Now SLIME is unhappy. It appears that the swank-clojure code has been patched appropriately. Starting slime yields the following in my *inferior-li

Re: contains

2009-01-23 Thread Mark Volkmann
On Fri, Jan 23, 2009 at 3:43 PM, Chouser wrote: > > On Fri, Jan 23, 2009 at 4:13 PM, Mark Volkmann > wrote: >> >> I'm trying to implement pig latin using only what's in core in the >> simplest way possible. >> Does anyone see a simpler way? >> I'm not happy with using three functions (some, set

Re: Proposal: "smarter" set operations that take size into account for speed

2009-01-23 Thread Rich Hickey
On Jan 23, 4:19 pm, Jason Wolfe wrote: > > On Fri, Jan 23, 2009 at 12:23 PM, Jason Wolfe > > wrote: > > >> OK, if these are not wanted in core right now, will anyone sign off > >> for adding them to clojure.contrib? > > > Well, *I* want these changes you've proposed in the core, but of > > cou

Re: evalOnlyDefs

2009-01-23 Thread Stephen C. Gilardi
On Jan 23, 2009, at 4:13 PM, Konrad Hinsen wrote: How about something like (let [my-factor (* 3 (. Math sqrt 2) (. Math log 42.))] (defn foo [x] (* my-factor x))) where the let outside of the definition makes sure the constant factor is evaluated only once? Are you pointing out that closu

Re: Binding values in a list of symbols and evaluating as code

2009-01-23 Thread Zak Wilson
And it's now working perfectly, producing a new generation every second. Now I actually have to tweak it to produce good results. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group,

Re: contains

2009-01-23 Thread Chouser
On Fri, Jan 23, 2009 at 4:13 PM, Mark Volkmann wrote: > > I'm trying to implement pig latin using only what's in core in the > simplest way possible. > Does anyone see a simpler way? > I'm not happy with using three functions (some, set and str) to > determine if a letter is a vowel. I'm not qui

Re: IntelliJ Plugin Pre-Alpha 0.03 Available

2009-01-23 Thread Francesco Bellomi
IntelliJ 8.1 EAP build 9678 (which is the last released build) Mac Book Pro 10.5.6 java 1.5.0_16 I installed it through Updates / Plugins Host, as explained on the plugin dev site. Francesco On Jan 23, 10:12 pm, Peter Wolf wrote: > You are more than welcome.  Enjoy! > > I am interested that it

Re: function that takes primitives?

2009-01-23 Thread Korny Sietsma
Fair enough - though my problem couldn't be fixed by caching, it could be inlined without too much pain. I just wanted to check I hadn't missed something - I'm still learning clojure bit by bit, and while it's fabulously well documented for such a new language, it's still easy to miss this sort o

Re: Simple lisp like idiom in clojure, call function and keep the result

2009-01-23 Thread Kevin Downey
there is when-let, if-let, etc, that combine conditionals and lexical binding On Fri, Jan 23, 2009 at 1:31 PM, BerlinBrown wrote: > > What is an idiom to call a function and also retain the result. For > example, I see myself doing this a lot, but it seems to more code than > would be needed. >

Re: Binding values in a list of symbols and evaluating as code

2009-01-23 Thread Zak Wilson
Kevin, I don't know how I managed to not think of that, but it's exactly what I was looking for. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegro

Simple lisp like idiom in clojure, call function and keep the result

2009-01-23 Thread BerlinBrown
What is an idiom to call a function and also retain the result. For example, I see myself doing this a lot, but it seems to more code than would be needed. (let [a (some-func)] (when a (println (a dosomething - I wish I could avoid having to use the 'let' in this case I guess in

Re: Not nil and 'true' with conditional functions

2009-01-23 Thread Jason Wolfe
Every clojure function returns a value. Even if it is only used for side effects, it still has to return something (probably nil). -Jason On Jan 23, 12:17 pm, wubbie wrote: > Is every function supposed to return something? > Of course, except for pure side-effects. > > -sun > > On Jan 23, 3:02

Re: Possible feature: consider aliases when reading namespace-qualified keywords.

2009-01-23 Thread David Nolen
Nice :) On Fri, Jan 23, 2009 at 2:10 PM, Jason Wolfe wrote: > > On Jan 19, 4:29 pm, Jason Wolfe wrote: > > I've been doing some OO-type Clojure programming, and have run into > > the following (quite minor) annoyance: > > > > I've defined a struct with a :class of ::Foo in namespace > > my.long

Re: Binding values in a list of symbols and evaluating as code

2009-01-23 Thread Jason Wolfe
On Jan 23, 1:18 pm, Kevin Downey wrote: > instead of using binding and eval, you can generate a (fn ) form, eval > it, keep the result function stuffed away somewhere and apply it > instead of calling eval all the time Yeah, when I made this optimization to my code a couple weeks ago it sped the

Re: Proposal: "smarter" set operations that take size into account for speed

2009-01-23 Thread Jason Wolfe
> > On Fri, Jan 23, 2009 at 12:23 PM, Jason Wolfe > wrote: >> >> OK, if these are not wanted in core right now, will anyone sign off >> for adding them to clojure.contrib? >> > > Well, *I* want these changes you've proposed in the core, but of > course, I'm not in charge. Thanks. > I guess t

Re: Binding values in a list of symbols and evaluating as code

2009-01-23 Thread Kevin Downey
instead of using binding and eval, you can generate a (fn ) form, eval it, keep the result function stuffed away somewhere and apply it instead of calling eval all the time On Fri, Jan 23, 2009 at 1:10 PM, Zak Wilson wrote: > > It does seem like a legitimate use for eval, at least at first glanc

Re: reader macros

2009-01-23 Thread Mark Volkmann
On Fri, Jan 23, 2009 at 3:00 PM, Chouser wrote: > > On Fri, Jan 23, 2009 at 2:17 PM, Mark Volkmann > wrote: >> >> Are all of these considered "reader macros"? > [snip] >> Is it correct that these are not considered "reader macros"? > > I don't see any distinction made in the code: > > http://cod

Re: contains

2009-01-23 Thread Chouser
On Fri, Jan 23, 2009 at 4:04 PM, Mark Volkmann wrote: > > Why does this work > > (some (set "aeiou") "e") > > but this doesn't > > (some #{"aeiou"} "e") > > I thought (set ...) was equivalent to #{...}. (hash-set ...) is equivalent to #{...} 'set' takes a single collection as an argument, which

Re: contains

2009-01-23 Thread Mark Volkmann
I'm trying to implement pig latin using only what's in core in the simplest way possible. Does anyone see a simpler way? I'm not happy with using three functions (some, set and str) to determine if a letter is a vowel. (defn pig-latin [word] (let [first-letter (first word)] (if (some (set "

Re: IntelliJ Plugin Pre-Alpha 0.03 Available

2009-01-23 Thread Peter Wolf
You are more than welcome. Enjoy! I am interested that it works on your Mac. Others have reported problems (but not with this particular JAR). What version of Mac and IntelliJ are you using? Peter Francesco Bellomi wrote: > I installed it and it works really well, > -- thanks to the autho

Re: evalOnlyDefs

2009-01-23 Thread Konrad Hinsen
On 23.01.2009, at 19:04, Stephen C. Gilardi wrote: > is something that ultimately invokes "def". On the way to invoking > def, one could also allow compiling code, but not running it, > deferring initializers until some kind of "load" time. Macros > present a problem with this strategy, of

Re: contains

2009-01-23 Thread wwmorgan
#{"aeiou"} is the set containing the String "aeiou". You want #{\a \e \i \o \u} On Jan 23, 4:04 pm, Mark Volkmann wrote: > On Fri, Jan 23, 2009 at 2:51 PM, Chouser wrote: > > > On Fri, Jan 23, 2009 at 3:47 PM, Mark Volkmann > > wrote: > > >> (contains? "aeiou" letter) > > >> but that doesn't w

Re: contains

2009-01-23 Thread Stuart Halloway
Hi Mark, set takes a single argument, a coll, and #{} is a literal form that can have a variable number of args. To make them equivalent: (set "aeiou") -> #{\a \e \i \o \u} #{(seq "aeiou")} -> #{(\a \e \i \o \u)} Stuart > > On Fri, Jan 23, 2009 at 2:51 PM, Chouser wrote: >> >> On Fri, J

Re: Binding values in a list of symbols and evaluating as code

2009-01-23 Thread Zak Wilson
It does seem like a legitimate use for eval, at least at first glance. The biggest problem is that using eval this way is really slow when each rule is being tested on hundreds of inputs. Interesting alternative, Konrad. I can probably take advantage of the fact that all of the functions I'm call

Re: contains

2009-01-23 Thread Mark Volkmann
On Fri, Jan 23, 2009 at 2:51 PM, Chouser wrote: > > On Fri, Jan 23, 2009 at 3:47 PM, Mark Volkmann > wrote: >> >> (contains? "aeiou" letter) >> >> but that doesn't work either. > > user=> (some (set "aeiou") "dn'tndthsstinkngvwls") > \i Why does this work (some (set "aeiou") "e") but this doe

Re: function that takes primitives?

2009-01-23 Thread Albert Cardona
> > Currently, there is no way to write a function that takes/returns > primitives, all of the signatures are Object based. > And please keep them so! Turtles all the way down solves many, many problems. For performance, whoever in need, just cache the int/float/double/etc. values locally

Re: Proposal: "smarter" set operations that take size into account for speed

2009-01-23 Thread Cosmin Stejerean
On Fri, Jan 23, 2009 at 2:52 PM, Mark Engelberg wrote: > > On Fri, Jan 23, 2009 at 12:23 PM, Jason Wolfe > wrote: > > > > OK, if these are not wanted in core right now, will anyone sign off > > for adding them to clojure.contrib? > > > > Well, *I* want these changes you've proposed in the core, b

Re: reader macros

2009-01-23 Thread Chouser
On Fri, Jan 23, 2009 at 2:17 PM, Mark Volkmann wrote: > > Are all of these considered "reader macros"? [snip] > Is it correct that these are not considered "reader macros"? I don't see any distinction made in the code: http://code.google.com/p/clojure/source/browse/trunk/src/jvm/clojure/lang/Li

Re: Proposal: "smarter" set operations that take size into account for speed

2009-01-23 Thread Mark Engelberg
On Fri, Jan 23, 2009 at 12:23 PM, Jason Wolfe wrote: > > OK, if these are not wanted in core right now, will anyone sign off > for adding them to clojure.contrib? > Well, *I* want these changes you've proposed in the core, but of course, I'm not in charge. I guess the real question is, what is

Re: contains

2009-01-23 Thread Mark Volkmann
On Fri, Jan 23, 2009 at 2:45 PM, Chouser wrote: > > On Fri, Jan 23, 2009 at 3:39 PM, Justin Johnson > wrote: >> On Fri, Jan 23, 2009 at 2:32 PM, Mark Volkmann >> wrote: >>> >>> This must be something I learned months ago and then forgot ... >>> embarassing! >>> What's the easiest way to determi

Re: contains

2009-01-23 Thread Chouser
On Fri, Jan 23, 2009 at 3:47 PM, Mark Volkmann wrote: > > (contains? "aeiou" letter) > > but that doesn't work either. user=> (some (set "aeiou") "dn'tndthsstinkngvwls") \i Or, if you must, user=> (clojure.contrib.seq-utils/includes? "aeiou" \o) true --Chouser --~--~-~--~~---

Re: License of/permission for Clojure's logo

2009-01-23 Thread Jason Riedy
And Rich Hickey writes: > You can use the logo on the wikipedia article on Clojure, but only if > you spell my name correctly :) May I use the logo for the identi.ca group? ( http://identi.ca/group/clj ) Jason --~--~-~--~~~---~--~~ You received this message beca

Re: contains

2009-01-23 Thread Mark Volkmann
On Fri, Jan 23, 2009 at 2:39 PM, Justin Johnson wrote: > On Fri, Jan 23, 2009 at 2:32 PM, Mark Volkmann > wrote: >> >> This must be something I learned months ago and then forgot ... >> embarassing! >> What's the easiest way to determine if a sequence contains a given value? >> I thought there w

Re: contains

2009-01-23 Thread Chouser
On Fri, Jan 23, 2009 at 3:39 PM, Justin Johnson wrote: > On Fri, Jan 23, 2009 at 2:32 PM, Mark Volkmann > wrote: >> >> This must be something I learned months ago and then forgot ... >> embarassing! >> What's the easiest way to determine if a sequence contains a given value? >> I thought there w

Re: contains

2009-01-23 Thread Justin Johnson
On Fri, Jan 23, 2009 at 2:32 PM, Mark Volkmann wrote: > > This must be something I learned months ago and then forgot ... > embarassing! > What's the easiest way to determine if a sequence contains a given value? > I thought there would be something like this: (include? [2 4 7] 4) -> true > That d

contains

2009-01-23 Thread Mark Volkmann
This must be something I learned months ago and then forgot ... embarassing! What's the easiest way to determine if a sequence contains a given value? I thought there would be something like this: (include? [2 4 7] 4) -> true That doesn't exist. I know I can do this: (some #{4} [2 4 7]) Having to

Re: IntelliJ Plugin Pre-Alpha 0.03 Available

2009-01-23 Thread Francesco Bellomi
I installed it and it works really well, -- thanks to the authors for their work. btw, I installed it directly on my mac, without building it. Francesco On Jan 23, 6:08 pm, Peter Wolf wrote: > For those who like IntelliJ, a new version of the plugin is available.   > This one has numerous fixe

Re: Proposal: "smarter" set operations that take size into account for speed

2009-01-23 Thread Jason Wolfe
OK, if these are not wanted in core right now, will anyone sign off for adding them to clojure.contrib? I can't say I like the idea of having two sets of functions that do exactly the same thing, but ... sometimes you just don't want things to run ~1000 times slower than they should. -Jason --~

Re: Not nil and 'true' with conditional functions

2009-01-23 Thread wubbie
Is every function supposed to return something? Of course, except for pure side-effects. -sun On Jan 23, 3:02 pm, Vincent Foley wrote: > The only two false values in Clojure are false and nil.  Everything > else is logically true.  If your function returns nil/false or a > result, you don't ne

Re: Not nil and 'true' with conditional functions

2009-01-23 Thread Vincent Foley
The only two false values in Clojure are false and nil. Everything else is logically true. If your function returns nil/false or a result, you don't need (not (nil? (...))) On Jan 23, 2:59 pm, BerlinBrown wrote: > Here is some code, my question relates to '(not (nil?...': > >  (if (not (nil? (

Not nil and 'true' with conditional functions

2009-01-23 Thread BerlinBrown
Here is some code, my question relates to '(not (nil?...': (if (not (nil? (regex-search-keyword (regex-get-text) line))) (add-select-style styles-vec all-bold) (add-select-style styles-vec light))) Could I have done the following or is (not (nil? ... a better approach.

Re: Embed Clojure in OSGi Bundles

2009-01-23 Thread Laurent PETIT
OK, I understand better now, I think. Did you experience the problems you have exposed ? Or is it an anticipation of problems ? If so, can you expose the tests data, so that one can also experiment with them ? 2009/1/23 Gaetan Morice > Hello Laurent, > thank you for your interest. > > 2009/1/2

Re: Basic about setting upp Clojure and editor enviroment

2009-01-23 Thread Laurent PETIT
2009/1/23 anderspe > > Thanks for "clojure-dev" that was exaktly what i was looking for. > > I have first a problem get it running, the reason was i download > EasyEclipse-JavaDesktop > on Vista it have problem both with clojure-dev and internal update, > and still i dide't install > it in "Prog

Re: Streams work

2009-01-23 Thread chris
I work for NVIDIA doing 3d graphics engines and editor platforms on both PC and embedded platforms. Konrad, the extra memory allocation is often the difference between something fitting inside a cache line on a CPU and hitting main ram. Last time I looked, I believe the difference is a factor of

Re: Printing Strings in Lists

2009-01-23 Thread Kevin Albrecht
Ah, exactly what I was looking for, thanks. On Jan 23, 11:15 am, Kevin Downey wrote: > prn > > On Fri, Jan 23, 2009 at 11:00 AM, Kevin Albrecht wrote: > > > Below are two operations that print (1 2 3 4).  How can I do something > > similar to print ("1 2 3" 4) to standard out? > > > (println '(

reader macros

2009-01-23 Thread Mark Volkmann
Are all of these considered "reader macros"? ; (comment) @ (deref) ^ (get metadata) #^ (add metadata) ' (quote) #"..." (regex) ` (syntax quote) ~ (unquote) ~@ (unquote splicing) #' (var quote) #{...} (set) #(...) (anonymous function) Is it correct that these are not considered "reader macros"?

Re: Printing Strings in Lists

2009-01-23 Thread Kevin Downey
prn On Fri, Jan 23, 2009 at 11:00 AM, Kevin Albrecht wrote: > > Below are two operations that print (1 2 3 4). How can I do something > similar to print ("1 2 3" 4) to standard out? > > (println '("1 2 3" 4)) > -> (1 2 3 4) > > (def x "1 2 3") > (println `(~x 4)) > -> (1 2 3 4) > > --Kevin Albr

Re: Possible feature: consider aliases when reading namespace-qualified keywords.

2009-01-23 Thread Jason Wolfe
On Jan 19, 4:29 pm, Jason Wolfe wrote: > I've been doing some OO-type Clojure programming, and have run into > the following (quite minor) annoyance: > > I've defined a struct with a :class of ::Foo in namespace > my.long.namespace.foo. > > In another namespace my.long.namespace.bar, I want to de

Re: newbie Q: what's wrong with this?

2009-01-23 Thread Paul Mooser
Clojure supports functions with multiple arities (http://clojure.org/ functional_programming). Assuming you don't actually care if you call the function with a vector, you can do something like this: (defn sum ([] 0) ([acc & r] (if (nil? r) acc (recur (+ acc (first r)) (re

Re: newbie Q: what's wrong with this?

2009-01-23 Thread wubbie
thanks -sun On Jan 23, 1:43 pm, vthakr wrote: > Hi Wubble, > > Looking at the code you have above I thought I might point out that > rather than create an anonymous function inside of sum and then call > it immediately after finishing its description, you could just use the > loop/recur constru

Printing Strings in Lists

2009-01-23 Thread Kevin Albrecht
Below are two operations that print (1 2 3 4). How can I do something similar to print ("1 2 3" 4) to standard out? (println '("1 2 3" 4)) -> (1 2 3 4) (def x "1 2 3") (println `(~x 4)) -> (1 2 3 4) --Kevin Albrecht --~--~-~--~~~---~--~~ You received this messag

Re: (clojure.contrib.lazy-seqs/combinations) should return [[]], not nil?

2009-01-23 Thread Jason Wolfe
> > On Jan 23, 2009, at 1:11 PM, Stephen C. Gilardi wrote: > >> I'd be interested in hearing from Chouser before making the change. >> He added combinations to lazy-seqs. > > I think it's quite cool that simply removing the "when" accomplishes > this. Yes, exactly :) Returning nil for no-arg

Regarding (.keySet {:a :map})

2009-01-23 Thread Christian Vest Hansen
I type this expression in the REPL (trunk 1228): user=> (let [s (.keySet {:a 1})] [(set? s) (ifn? s)]) [false false] But I expected it to return [true true]. Is this an oversight, or is there a good reason for this behavior? -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~

Re: newbie Q: what's wrong with this?

2009-01-23 Thread vthakr
Hi Wubble, Looking at the code you have above I thought I might point out that rather than create an anonymous function inside of sum and then call it immediately after finishing its description, you could just use the loop/recur construct which is much more idiomatic clojure code. If you decide

Re: bug? tree-seq assumes the root is a branch

2009-01-23 Thread Christophe Grand
Christophe Grand a écrit : > tree-seq assumes the root is a branch: > user=> (tree-seq (constantly false) seq [1 2 3]) > ([1 2 3] 1 2 3) ; I expected ([1 2 3]) > > Is this a bug? > I know it's documented but I don't understand why. --~--~-~--~~~---~--~~ You rece

bug? tree-seq assumes the root is a branch

2009-01-23 Thread Christophe Grand
tree-seq assumes the root is a branch: user=> (tree-seq (constantly false) seq [1 2 3]) ([1 2 3] 1 2 3) ; I expected ([1 2 3]) Is this a bug? Christophe --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" gro

Re: Embed Clojure in OSGi Bundles

2009-01-23 Thread Gaetan Morice
Hello Laurent, thank you for your interest. 2009/1/23 Laurent PETIT > Hello Gaetan, > > I'm one of the core developers of clojuredev, an open source project whose > goal is to provide clojure support for the Eclipse IDE. > What you say below is interesting, please see what I have noted inline --

Re: (clojure.contrib.lazy-seqs/combinations) should return [[]], not nil?

2009-01-23 Thread Stephen C. Gilardi
On Jan 23, 2009, at 1:11 PM, Stephen C. Gilardi wrote: I'd be interested in hearing from Chouser before making the change. He added combinations to lazy-seqs. I think it's quite cool that simply removing the "when" accomplishes this. --Steve smime.p7s Description: S/MIME cryptographic

Re: Basic about setting upp Clojure and editor enviroment

2009-01-23 Thread anderspe
Thanks for "clojure-dev" that was exaktly what i was looking for. I have first a problem get it running, the reason was i download EasyEclipse-JavaDesktop on Vista it have problem both with clojure-dev and internal update, and still i dide't install it in "Program Files" I removed it and downlo

  1   2   >