Re: New ns function

2008-09-01 Thread Stephen C. Gilardi
On Aug 30, 2008, at 11:23 AM, Rich Hickey wrote: > Yup, coincidence, please use as documented. Tools, for instance, > might analyze ns forms looking for :use etc and not find them. I suggest adding (:load-resources ...) as a supported reference argument for 'ns. --Steve --~--~-~--

Re: Should meta :file include namespace/package path?

2008-09-01 Thread Stephen C. Gilardi
On Sep 1, 2008, at 5:15 PM, Feng wrote: > With recent unified namespace and package, should meta :file include > package path as well? > user=> (.getResource (clojure.lang.RT/baseLoader) "clojure/contrib/ > sql/ > sql.clj") > file:/Users/fenghou/lib/clojure/contrib/src/clojure/contrib/sql/ > s

Should meta :file include namespace/package path?

2008-09-01 Thread Feng
Hi, With recent unified namespace and package, should meta :file include package path as well? user=> (require '(clojure.contrib sql)) nil user=> (def src (:file ^#'clojure.contrib.sql/with-connection)) #'user/src user=> src "sql.clj" user=> (.getResource (clojure.lang.RT/baseLoader) src) nil us

Using a Timer in Clojure

2008-09-01 Thread Mathias Dahl
I would like to have a java.util.Timer running in my Clojure webapp. Once per week, some time each Friday, the code the timer calls would send out an e-mail with news to a list of recipients. I have never used Timers nor worked with threads in Java so this is kind of new ground to me. I found some

Re: Discrepancies between boot.clj and API Docs

2008-09-01 Thread Meikel Brandmeyer
Hello Rich, Am 01.09.2008 um 04:04 schrieb Rich Hickey: The API docs are generated from the source, so there's nothing there you can't get from the source. Generally, the site corresponds to a release. Sometimes things change between releases and I don't want to make interim promises in the API

Re: debugging, logging, ... and code sections

2008-09-01 Thread Frantisek Sodomka
Yes, the name and semantics of aspects fits for it more. I like that. I am going to sign up for contributing soon. I am low on time currently, so feel free to extend this idea further. As soon as Rich gets agreement, you can use it :-) Frantisek --~--~-~--~~~---~

Re: Local recursive lazy sequences

2008-09-01 Thread Rich Hickey
On Aug 31, 1:58 pm, Achim Passen <[EMAIL PROTECTED]> wrote: > Hi! > > Is there a way to have locally bound recursive lazy sequences in > Clojure? I'd like to define a function that uses a lazy seq as an > interim result, so i wouldn't want to use a top-level def. > > I'll try to give a short exa

Re: Local recursive lazy sequences

2008-09-01 Thread Achim Passen
Hi Mike, thank you for your reply! On Sep 1, 3:15 pm, "Michael Reid" <[EMAIL PROTECTED]> wrote: > (defn fib [n] >   (let [fibs2 (fn fibs2 [] (lazy-cat '(0 1) (map + (fibs2) (drop 1 > (fibs2)] >     (nth (fibs2) n))) Dodgy. ;-) I wasn't aware of named anonymous fns – nice. But i suspect di

Re: Local recursive lazy sequences

2008-09-01 Thread Michael Reid
Hi Achim, On Sun, Aug 31, 2008 at 1:58 PM, Achim Passen <[EMAIL PROTECTED]> wrote: > Now suppose you want to define a function which returns the nth > fibonacci number, but you down want "fibs" around globally. My guess > was: > >(defn fib [n] > (let [fibs2 (lazy-cat '(0 1) (map

Local recursive lazy sequences

2008-09-01 Thread Achim Passen
Hi! Is there a way to have locally bound recursive lazy sequences in Clojure? I'd like to define a function that uses a lazy seq as an interim result, so i wouldn't want to use a top-level def. I'll try to give a short example. You can define the sequence of fibonacci numbers lazily-recurs

Re: with-meta usage

2008-09-01 Thread Apurva Sharan
Thanks Meikel! That makes it clearer... Regards, Apurva - Original Message - From: "Meikel Brandmeyer" <[EMAIL PROTECTED]> To: clojure@googlegroups.com Sent: Sunday, August 31, 2008 8:46:01 PM GMT +05:30 Chennai, Kolkata, Mumbai, New Delhi Subject: Re: with-meta usage Hello, > I was

Re: avoiding duplication using multi-methods

2008-09-01 Thread Parth Malwankar
On Sep 1, 12:26 pm, [EMAIL PROTECTED] wrote: > On Aug 31, 8:48 pm, Parth Malwankar <[EMAIL PROTECTED]> wrote: > > > > > Hello, > > > I have a situation in which different multi-methods > > need similar behavior with different arguments. > > > So they call the same function (one-or-two below) > >

Re: avoiding duplication using multi-methods

2008-09-01 Thread darren . austin
On Aug 31, 8:48 pm, Parth Malwankar <[EMAIL PROTECTED]> wrote: > Hello, > > I have a situation in which different multi-methods > need similar behavior with different arguments. > > So they call the same function (one-or-two below) > with the arguments. E.g. > >     (defmulti what-num (fn [x] x))