Strange Loop call for presentations

2010-05-06 Thread Alex Miller
Hello Clojurians.hope some of you can submit to this conference: CALL FOR SPEAKERS Strange Loop Conference St. Louis, Oct. 14-15, 2010 http://strangeloop2010.com The Strange Loop conference is now holding an open call for presentations and workshops. Strange Loop is a developer-run software

Re: labrepl updated

2010-05-06 Thread Laurent PETIT
master version of labrepl tested with ccw succesfully. Remarks: * The pom.xml should have xmlns etc. stuff declared at its top, so that IDEs able to interpret it can assist people for verification, code completion, etc. * I still see lots of SNAPSHOT dependencies "not fixed to a particular sna

Re: History Question

2010-05-06 Thread MarkSwanson
> or as-str from c.c.java-utils (I think) Good one. It's in string.clj in the latest git. I've needed this before too. There is so much good stuff in contrib. I think I have to allocate 30 minutes every day and just try to commit c.c. to memory. -- You received this message because you are subs

Re: Restricted eval

2010-05-06 Thread Heinz N. Gies
On May 7, 2010, at 3:34 , gary ng wrote: > > > On Thu, May 6, 2010 at 10:49 AM, Heinz N. Gies wrote: > If I may :) since I'm the sandbox guy. > > > Is it possible to use the sandbox functionalities without the future/thread > part ? Currently no, if it is really important and the following

Re: History Question

2010-05-06 Thread MarkSwanson
On May 6, 2:44 pm, Sean Devlin wrote: > Okay, next guy to mention name gets shot.  Nothing personal. > Ok, but have you considered using name? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups

Re: Restricted eval

2010-05-06 Thread gary ng
On Thu, May 6, 2010 at 10:49 AM, Heinz N. Gies wrote: > If I may :) since I'm the sandbox guy. > > Is it possible to use the sandbox functionalities without the future/thread part ? Basically, I am trying to create a chatty REPL(say HTTP POST based). the thread would be created by the app conta

Re: build.clojure.org update: clojure-contrib 1.2 repo path no longer includes "-master"

2010-05-06 Thread Frank Siebenlist
I just built the netbean+labrepl from start according the getting-started webpage, and the build barfed because labrepl's pom.xml included the "1.2.0-master-SNAPSHOT" instead of "1.2.0-SNAPSHOT" for clojure-contrib. After correction, all build without errors and seems to work fine. -Frank.

In the Seattle area? Seajure meeting tonight

2010-05-06 Thread Phil Hagelberg
Tonight we're having another Seajure meeting for all in the Seattle area with an interest in Clojure. We meet at 7pm at University Zoka: http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=zoka,+university+district,+seattle&sll=37.0625,-95.677068&sspn=49.490703,90.791016&ie=UTF8&hq=zoka,&h

Re: Can't defalias a macro in clojure 1.2?

2010-05-06 Thread Stuart Halloway
Just pushed a fix for this. (An ugly hack, really.) Let me know if it works for you. In clojure 1.1 you can use defalias on macros, but as far as I can tell, in the current 1.2 branch, this won't work anymore. Is this intentional, and if so, how can I work around it once I start porting stuff

build.clojure.org update: clojure-contrib 1.2 repo path no longer includes "-master"

2010-05-06 Thread Stephen C. Gilardi
This change was made to some months ago, but some builds that followed the obsolete convention have been hanging around. I removed them today. On Apr 30, 2010, at 9:50 AM, Stuart Halloway wrote: > There are plenty of recent SNAPSHOT builds: > http://build.clojure.org/snapshots/org/clojure/clojur

Annoying auto-signature

2010-05-06 Thread Mibu
Am I the only one driven mad by the new auto-appended signature to every message in this group ("You received this message because you are subscribed...")? It started on April 16th. Is there a way a moderator can stop it? -- You received this message because you are subscribed to the Google Group

Re: History Question

2010-05-06 Thread Meikel Brandmeyer
Hi, or as-str from c.c.java-utils (I think) Sincerely Meikel -- 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

Re: History Question

2010-05-06 Thread Sean Devlin
Now that's a solution :) On May 6, 2:53 pm, "Heinz N. Gies" wrote: > okay another suggestion: > > (defn nstr [& ss] >       (apply str (map #(if (keyword? %) (n-word-function-i-dont-mention %) %) > s))) > > On May 6, 2010, at 21:44 , Sean Devlin wrote: > > > > > Okay, next guy to mention name ge

Re: History Question

2010-05-06 Thread Heinz N. Gies
okay another suggestion: (defn nstr [& ss] (apply str (map #(if (keyword? %) (n-word-function-i-dont-mention %) %) s))) On May 6, 2010, at 21:44 , Sean Devlin wrote: > Okay, next guy to mention name gets shot. Nothing personal. > > On May 6, 2:42 pm, Jeff Heon wrote: >> You could use

Re: History Question

2010-05-06 Thread Jeff Heon
Sorry, the others replies weren't there yet when I begun answering 8) On May 6, 2:44 pm, Sean Devlin wrote: > Okay, next guy to mention name gets shot.  Nothing personal. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send em

Re: History Question

2010-05-06 Thread Sean Devlin
Okay, next guy to mention name gets shot. Nothing personal. On May 6, 2:42 pm, Jeff Heon wrote: > You could use name. > > (name :a) > ->"a" > > On May 6, 2:33 pm, Sean Devlin wrote: > > > Why does (str :a) return ":a" and not "a"?  I have to work around this > > a lot, and I'm just curios what

Re: History Question

2010-05-06 Thread Jeff Heon
You could use name. (name :a) ->"a" On May 6, 2:33 pm, Sean Devlin wrote: > Why does (str :a) return ":a" and not "a"?  I have to work around this > a lot, and I'm just curios what the reasoning to go this direction was. > > -- > You received this message because you are subscribed to the Google

Re: History Question

2010-05-06 Thread Heinz N. Gies
(name :a) gives you "a" :), and I think the reason is that str shows the type somewhat, just as (str '(1 2 3)) or (str [1 2 3]) Regards, Heinz On May 6, 2010, at 21:33 , Sean Devlin wrote: > Why does (str :a) return ":a" and not "a"? I have to work around this > a lot, and I'm just curios what

Re: History Question

2010-05-06 Thread Alan Dipert
Hi, On May 6, 2:33 pm, Sean Devlin wrote: > Why does (str :a) return ":a" and not "a"?  I have to work around this > a lot, and I'm just curios what the reasoning to go this direction was. str returns ":a" because (.toString :a) returns ":a". This is probably so things like (println :a) work as

History Question

2010-05-06 Thread Sean Devlin
Why does (str :a) return ":a" and not "a"? I have to work around this a lot, and I'm just curios what the reasoning to go this direction was. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.co

Re: Restricted eval

2010-05-06 Thread Rayne
Disabling it is definitely unnecessary. As you said before, we go as far as replacing the '.' special form with our own special safe dot that makes Java interop safe. As a side note, clojurebot doesn't actually use clj-sandbox (yet, hint hiredman, hint), but sexpbot does. _ato hasn't broken sexpbo

Re: Restricted eval

2010-05-06 Thread Heinz N. Gies
On May 6, 2010, at 20:57 , Anniepoo wrote: > Mibu - I've kind of gone around this track as well. > My first reaction to the 'whitelist' was that it was kind of kludgy, > and fought it for a long time, but after a lot of looking for other > ways, I'm with Licenser, it's the best way to do it. Whit

Re: Restricted eval

2010-05-06 Thread Anniepoo
Mibu - I've kind of gone around this track as well. My first reaction to the 'whitelist' was that it was kind of kludgy, and fought it for a long time, but after a lot of looking for other ways, I'm with Licenser, it's the best way to do it. And yes, you have to disable java interop not because yo

Re: Restricted eval

2010-05-06 Thread Heinz N. Gies
If I may :) since I'm the sandbox guy. On May 6, 2010, at 18:18 , Mibu wrote: > I mentioned in the first message that javaop should also be disabled > in a restricted eval. > > On May 6, 5:18 pm, gary ng wrote: >> On Thu, May 6, 2010 at 4:19 AM, Mibu wrote: >>> As far as I can tell, clj-sandbo

Re: Mahout in Clojure

2010-05-06 Thread klathrop
Hoops indeed! Thank you, the solution works great. On May 5, 11:05 pm, ataggart wrote: > Wow! What hoops one has to jump through to fit things in an "OO" API, > eh? > > Anyway, if you're using 1.2: > > (reify RecommenderBuilder >   (buildRecommender [this model] >     (let [similarity (PearsonCo

Re: Can't defalias a macro in clojure 1.2?

2010-05-06 Thread Joost
On May 6, 7:01 pm, ataggart wrote: > What "defalias" are you talking about? > The one in clojure.contrib.def -- 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 membe

Re: Can't defalias a macro in clojure 1.2?

2010-05-06 Thread ataggart
What "defalias" are you talking about? On May 6, 3:26 am, Joost wrote: > In clojure 1.1 you can use defalias on macros, but as far as I can > tell, in the current 1.2 branch, this won't work anymore. > > Is this intentional, and if so, how can I work around it once I start > porting stuff to 1.2?

Re: Dumbest test Q you ever heard

2010-05-06 Thread Quzanti
I probably could, although again it would be a bit of a hack, as I want to 'do' some preparation rather than assign anything (specifically I need to 'touch' some files before testing a function which is modification time sensitive) So I want something that happens before all several 'is' assertion

Re: last-var-wins: a simple way to ease upgrade pain

2010-05-06 Thread Mike Meyer
On Wed, 5 May 2010 23:22:06 -0700 gary ng wrote: > On Wed, May 5, 2010 at 10:34 PM, Meikel Brandmeyer wrote: > > I'm deeply suspicious of such a behaviour. Why would + on a > > date mean adding days? Why not hours? minutes? seconds? > > months? years? I would always prefer plus-days over such a

Re: given a java.lang.Class, accessing a static field of the associated class

2010-05-06 Thread Alan Dipert
Hello, Since maps are functions of their keys, I think you can get away with something like: (def unbox {Byte Byte/TYPE Integer Integer/TYPE}) (unbox Integer) ;int Regarding your let/defn, I think in general if you have functions that depend on compile-time constants it's idioma

Re: Restricted eval

2010-05-06 Thread Mibu
I mentioned in the first message that javaop should also be disabled in a restricted eval. On May 6, 5:18 pm, gary ng wrote: > On Thu, May 6, 2010 at 4:19 AM, Mibu wrote: > > As far as I can tell, clj-sandbox works by a set whitelist of > > arbitrary functions, which is not a very generic approa

Re: given a java.lang.Class, accessing a static field of the associated class

2010-05-06 Thread B Smith-Mannschott
On Thu, May 6, 2010 at 15:22, Stuart Halloway wrote: > Reflection is slow, there are less than ten of these, and the possible set > ain't gonna change. > > I would write a function that looks them up from a map. Yea, I considered that too. The only reason I didn't was because of a misguided desi

Re: labrepl updated

2010-05-06 Thread Michael Wood
On 6 May 2010 15:45, Craig Andera wrote: > So if someone produces a fork of incanter that doesn't have the > warning (or David fixes up Incanter), then the problem goes away? I don't use Incanter and I haven't tried labrepl, but I thought David had fixed Incanter a week or so ago to rename group-

Re: Restricted eval

2010-05-06 Thread gary ng
On Thu, May 6, 2010 at 4:19 AM, Mibu wrote: > As far as I can tell, clj-sandbox works by a set whitelist of > arbitrary functions, which is not a very generic approach. It works > for sandboxes like clojurebot, but not for other stuff. > > A restricted eval in all likelihood will not refer direct

Re: labrepl updated

2010-05-06 Thread Stuart Halloway
You would have to fix *all* warnings. If there is not a principled reason swank works the way it does, let's fix it. I'll get to it eventually myself if nobody else does, but it isn't near the top of my list. Stu So if someone produces a fork of incanter that doesn't have the warning (or

Re: labrepl updated

2010-05-06 Thread Craig Andera
So if someone produces a fork of incanter that doesn't have the warning (or David fixes up Incanter), then the problem goes away? Because the other place I see the warnings coming out of is swank itself. On Thu, May 6, 2010 at 9:33 AM, Stuart Halloway wrote: > This is another variant of the "Swan

Re: Dumbest test Q you ever heard

2010-05-06 Thread Sean Devlin
Can you just use a local let in the specific test? On May 6, 6:41 am, Quzanti wrote: > Sorry about this, but after an hour's googling I have drawn a blank. > > For clojure.test fixtures I understand you use :each for doing > something around each and every test, and :once for doing it once > arou

Re: labrepl updated

2010-05-06 Thread Stuart Halloway
This is another variant of the "Swank likes StringWriters, everybody else likes PrintWriters" problem, see e.g. [1] I would love to see somebody fix this, and I think it is simpler (and probably conceptually correct) to make swank use a PrintWriter, instead of requiring all possible tools t

Re: given a java.lang.Class, accessing a static field of the associated class

2010-05-06 Thread Stuart Halloway
Reflection is slow, there are less than ten of these, and the possible set ain't gonna change. I would write a function that looks them up from a map. Stu This post originally started as a question, but I've since found a solution. I thought I'd post it anyway, perhaps someone knows of a nic

Re: labrepl updated

2010-05-06 Thread Craig Andera
Update: Using the latest labrepl commit (fa89411ae "use private compojure snapshot"), I'm now able to pull in incanter and use it (albeit with tons of warnings about group-by and flatten from both incanter and swank)...but only if I use script/repl via inferior-lisp. I still can't get swank to work

Re: Restricted eval

2010-05-06 Thread Mibu
As far as I can tell, clj-sandbox works by a set whitelist of arbitrary functions, which is not a very generic approach. It works for sandboxes like clojurebot, but not for other stuff. A restricted eval in all likelihood will not refer directly to clojure.core, and it's much better allowing the c

given a java.lang.Class, accessing a static field of the associated class

2010-05-06 Thread B Smith-Mannschott
This post originally started as a question, but I've since found a solution. I thought I'd post it anyway, perhaps someone knows of a nicer approach. I'd like a function which maps from a boxed type as represented by a java.lang.Class (i.e. Integer, Boolean, Float) to the associated unboxed type.

Dumbest test Q you ever heard

2010-05-06 Thread Quzanti
Sorry about this, but after an hour's googling I have drawn a blank. For clojure.test fixtures I understand you use :each for doing something around each and every test, and :once for doing it once around all the tests in that namespace What happens if you want to do some setup just for one parti

Re: Restricted eval

2010-05-06 Thread Meikel Brandmeyer
Hi, maybe this can help: http://github.com/licenser/clj-sandbox Sincerely Meikel -- 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

Can't defalias a macro in clojure 1.2?

2010-05-06 Thread Joost
In clojure 1.1 you can use defalias on macros, but as far as I can tell, in the current 1.2 branch, this won't work anymore. Is this intentional, and if so, how can I work around it once I start porting stuff to 1.2? Regards, Joost Diepenmaat. -- You received this message because you are subscr

Restricted eval

2010-05-06 Thread Mibu
So far I have delightfully used Clojure's reader-evaluator-printer to store and load data, as an ad-hoc scripting language and command line interface, as a configuration language, and as an RPC protocol. It's all simple and great when those interfaces are trusted. Now I want to do it with untruste

Re: last-var-wins: a simple way to ease upgrade pain

2010-05-06 Thread Michael Wood
On 6 May 2010 03:38, gary ng wrote: > > On Wed, May 5, 2010 at 3:18 PM, Meikel Brandmeyer wrote: >> >> On Wed, May 05, 2010 at 02:56:09PM -0700, gary ng wrote: >> Right now, this can be handled as: >> (ns foo >>  (:refer-clojure :as core :exclude (+))) >> >> (defn + >>  [matrix1 matrix2] >>  ...

Re: last-var-wins: a simple way to ease upgrade pain

2010-05-06 Thread Meikel Brandmeyer
Hi, On 6 Mai, 08:22, gary ng wrote: > Convention, mostly. Say in the security trading settlement world, they use > terms like T+3 to mean transaction date + 3 days. Which is why I said, toy > DSL. It is used in an implicit context. Everyone in that business knows what > T+3 means. Just like we k