Re: group tag for clojure newsgroup

2010-03-04 Thread Johnny Kwan
On Mar 4, 2010, at 8:00 AM, Rich Hickey wrote: > > > On Mar 4, 2:56 am, TimDaly wrote: >> For the other groups that I subscribe to, the email subjects are >> always prefixed with the group name, e.g. >> >> Re: [sage-devel] This is the mail subject >> >> This makes it possible to reliably grou

Re: newbie question: Please help me stop creating constructors

2010-03-01 Thread Johnny Kwan
Hi, On Mar 1, 2010, at 5:19 AM, Andrzej wrote: What to do if we don't know which of the equation variables are unknowns? Let's say that the user may choose whether to input "Rent" and "Sell", or "Rent" and "opportunityCost". I can imagine writing some code like this: (defn opportunity-cost [o

Re: How to efficiently import large array of doubles from file?

2010-02-22 Thread Johnny Kwan
Hi, On Feb 22, 2010, at 9:39 AM, David Nolen wrote: You also might want to pick a different strategy for parsing the string instead of splitting the string immediately into 5000 parts. Along those lines, just use a regexp sequence. Thanks, Johnny -- You received this message because

Re: Testing Private Functions

2010-02-22 Thread Johnny Kwan
Hi, On Feb 22, 2010, at 2:20 AM, Meikel Brandmeyer wrote: > First some fixes: > > (defmacro #^{:private true} use-private > [ns sym] > `(def ~(with-meta sym {:private true}) @(ns-resolve '~ns '~sym))) Awesome! >> This, however, doesn't work. The first ~sym macroexpands to (quote sym), >> w

Re: Newbie suggestion for an implementation - rosettacode pythagorean means

2010-02-22 Thread Johnny Kwan
Hi, On Feb 22, 2010, at 1:43 AM, Meikel Brandmeyer wrote: > Hi, > > On Feb 22, 12:18 am, Johnny Kwan wrote: >> I'm really new to Clojure, but I'm under the impression that reduce would >> be better than apply, since I assume that apply would reify the entire >

Testing Private Functions

2010-02-21 Thread Johnny Kwan
Hi All, I'm trying to test some private functions using the Clojure convention of placing tests in a separate test- namespace. Of course, you can't reference private vars from other namespaces (please correct me if I'm wrong). Not knowing anything at all about how stuff is interned in Clojure

Re: Newbie suggestion for an implementation - rosettacode pythagorean means

2010-02-21 Thread Johnny Kwan
I'm really new to Clojure, but I'm under the impression that reduce would be better than apply, since I assume that apply would reify the entire sequence at once, whereas reduce would consume the sequence one by one. Could someone more familiar with the implementation weigh in on this? On Feb

Re: Applying "and" macro to sequence

2010-02-20 Thread Johnny Kwan
OK, I should have just tried passing in 'and at the REPL before posting. Of course, it works. Is this the idiomatic way? I'm still curious about short-circuiting. On Feb 20, 2010, at 11:38 AM, Johnny Kwan wrote: > Hi, > > This is a very basic question, but I can't

Applying "and" macro to sequence

2010-02-20 Thread Johnny Kwan
Hi, This is a very basic question, but I can't find the answer anywhere. How do you take the "and" or "or" of sequence? They are defined as macros and can't be passed into "apply" or "reduce". Is there some reader macro character to force it? Also, how does one write it so that it will shor

Re: First program, in case you want to give hints

2010-02-14 Thread Johnny Kwan
On Feb 14, 2010, at 8:58 AM, Laurent PETIT wrote: > 2010/2/14 alux : >> Hello Sean, >> >> thank you for the answer. >> >> I used letfn not for recursive swearing, but for the localness. I >> thought the functions to be so special, >> nobody else will use it, so I put it into conway-PM. Is there

Re: clojure-dev: #55: clojure.contrib.sql expects *err* to be a PrintWriter Ticket updated - Resolution?

2010-02-13 Thread Johnny Kwan
On Feb 13, 2010, at 6:22 PM, Phil Hagelberg wrote: > On Sat, Feb 13, 2010 at 11:03 AM, Richard Newman wrote: >>> The above thread suggests defining *err* as a PrintWriter instead of >>> as a Writer. Has this been patched, and is it official? If so, I'll >>> patch clojure-swank to use PrintWrite