Re: [ccw-users] CCW in Eclipse Market Place + needs a logo !

2010-07-22 Thread Laurent PETIT
2010/7/22 Konrad Hinsen > On 22 Jul 2010, at 13:09, Laurent PETIT wrote: > > But we need a logo ! >> >> If there's an area where I dooon't shine at all, it's graphics. >> > > Me neither, but here is an idea: start from the nicely circular Clojure > logo and add a circular arrow pointing counterc

Re: Slime, debug-repl & clojure debugging toolkit

2010-07-22 Thread Krukow
On Jul 23, 6:19 am, George Jahad wrote: [snip] > as i explained above you have to use swank/break with case 3. > > in addition to these 4 cases, it sounds like you are having a problem > viewing the local java object, which is why i suggested using the > vanilla debug-repl.  I want to see if it

Re: RFC on my letrec macro

2010-07-22 Thread George Jahad
sorry, wrong gist. here's one that tests for a function and only calls trampoline on it. all three of your test cases work for it. http://gist.github.com/487019 g On Jul 22, 10:50 pm, Michał Marczyk wrote: > On 23 July 2010 06:50, George Jahad wrote: > > > i like it a lot!   what do you thin

Re: RFC on my letrec macro

2010-07-22 Thread Michał Marczyk
On 23 July 2010 06:50, George Jahad wrote: > i like it a lot!   what do you think of adding trampoline to it like > so: > > http://gist.github.com/487019 Thanks! Trampoline in letrec automatically breaks all cases where the value being bound to the local is not a function, so it would interfere

Re: Memoizing a recursive function?

2010-07-22 Thread Laurent PETIT
Here is what I get: (and BTW, my original version with #' seems to work, I'm a little bit puzzled ...) user=> (defn fib [n] (println "called with " n) (if (> n 2) (+ (fib (- n 2)) (fib (- n 1))) 1)) (def fib (memoize fib)) #'user/fib user=> user=> #'user/fib user=> (fib 6) called with 6

Re: RFC on my letrec macro

2010-07-22 Thread George Jahad
i like it a lot! what do you think of adding trampoline to it like so: http://gist.github.com/487019 On Jul 22, 7:38 pm, Michał Marczyk wrote: > Hi All, > > I've written a letrec macro with the goal of hopefully tying the knot > [1] in Clojure etc. Some examples of what it can do are included

Re: Slime, debug-repl & clojure debugging toolkit

2010-07-22 Thread George Jahad
> 1) Start emacs, run M-x swank-clojure-project. > From the *slime-repl clojure* buffer run: > ; SLIME 20100404 > user> (use 'alex-and-georges.debug-repl) > nil > user> (let [c 1 > d 2] > (defn a [b c] > (debug-repl) > d)) > (a "foo" "bar") > dr-1-1001 => (+ 2 3) > > Now

RFC on my letrec macro

2010-07-22 Thread Michał Marczyk
Hi All, I've written a letrec macro with the goal of hopefully tying the knot [1] in Clojure etc. Some examples of what it can do are included in the Gist (including -- as of now -- two not immediately rewritable in terms of letfn). So far I haven't caught any bugs, but hey, it's about an hour old

Re: BUG: Clojure hierarchies (affects 1.2-beta1)

2010-07-22 Thread Michał Marczyk
On 22 July 2010 12:36, Stuart Halloway wrote: > I closed #406: this is a subset of the issue already covered under #382, > which Rob was planning to do a patch for. Oh, sorry for the duplicate then. I thought I searched for "underive", but I guess I didn't (or made a typo or something...). Sinc

ANN: clj-dropbox, Dropbox client library in Clojure

2010-07-22 Thread aria42
Hi all, I've released my clojure library for accessing the Dropbox API. Its called clj-dropbox and it can be found at: http://github.com/aria42/clj-dropbox Hope some people get use out of it. Feel free to email or leave comments and/or suggestions Best, Aria -- You received this message becau

Re: Memoizing a recursive function?

2010-07-22 Thread Paul Mooser
Why not simply do: (defn fib [n] (println "called with " n) (if (> n 2) (+ (fib (- n 2)) (fib (- n 1))) 1)) (def fib (memoize fib)) I inserted the println to verify when we were actually calling the function, and I believe this works - fib only seems to get invoked a single time for

Clojure tag wiki on Stack Overflow

2010-07-22 Thread Michał Marczyk
Hi All, Stack Overflow has recently introduced a new concept of "tag wikis". Here's the one for Clojure: http://stackoverflow.com/questions/tagged?sort=info&tagnames=clojure I thought it would be useful to put a general notice about what Clojure is and which resources might be most helpful to be

Re: Two convenience methods

2010-07-22 Thread Travis Hoffman
Frederick, I agree with all you said; perhaps this is as much my personal coding style. Also, I'm seeing Clojure through beginner's eyes. What I love about Clojure is the readability and the "naturalness" of the names of functions. While skimming the API, I was looking for the natural opposite of

Re: Two convenience methods

2010-07-22 Thread Travis Hoffman
*sigh* ... it was a typo. Good catch! On Jul 21, 10:16 pm, B Smith-Mannschott wrote: > On Wed, Jul 21, 2010 at 23:45, Travis Hoffman > wrote: > > ... > > > > > > > The second function is suggested as an addition to clojure.set. The > > "disjoint?" function decides if two sets have no elements in

Re: [ccw-users] CCW in Eclipse Market Place + needs a logo !

2010-07-22 Thread Konrad Hinsen
On 22 Jul 2010, at 13:09, Laurent PETIT wrote: But we need a logo ! If there's an area where I dooon't shine at all, it's graphics. Me neither, but here is an idea: start from the nicely circular Clojure logo and add a circular arrow pointing counterclockwise. The arrow could cover 2/3 of

Re: BUG: Clojure hierarchies (affects 1.2-beta1)

2010-07-22 Thread Rob Lachlan
I sent in my CA some weeks ago. I have a patch ready, with tests, and now I'm just waiting to be let in to clojure-dev + assembla. As I mentioned in the other thread, there are other problems with underive -- essentially the hierarchy can become inconsistent in cases of multiple inheritance, over

Re: Memoizing a recursive function?

2010-07-22 Thread Laurent PETIT
nevermind, the following code does not work. Jules' one is the right one 2010/7/22 Laurent PETIT > Another solution, use the var, and then use memoize on your function as > usual: > > (defn fib[n] > (if (> n 2) > (+ (#'fib (- n 2)) (#'fib (- n 1 > > (of course this was to answer close

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-22 Thread Meikel Brandmeyer
Hi, On Jul 22, 8:45 am, Aaron Cohen wrote: > Apologies if you know all this Meikel, but have you > seenhttp://vim.wikia.com/wiki/Execute_external_programs_asynchronously_un... > ? Thanks for the pointer. In fact I haven't seen this. I'm obviously googling the wrong keywords. Sincerely Meikel

Re: Typed Racket

2010-07-22 Thread Eli Barzilay
Mark Engelberg writes: > It is my understanding that Typed Racket programs do not run any > faster than their dynamically-typed counterparts, and in fact > commonly run slower because there are a lot of additional runtime > checks that must be inserted to handle various types of unsafe calls > th

Re: Memoizing a recursive function?

2010-07-22 Thread Jules
(def fib (memoize (lambda ...))) On Jul 22, 1:25 pm, Laurent PETIT wrote: > Another solution, use the var, and then use memoize on your function as > usual: > > (defn fib[n] >   (if (> n 2) >     (+ (#'fib (- n 2)) (#'fib (- n 1 > > (of course this was to answer closely to the question. Nobod

Re: Confusing compiler error in defrecord and deftype.

2010-07-22 Thread Baishampayan Ghose
Stuart Halloway wrote: I have created a ticket for this at https://www.assembla.com/spaces/clojure/tickets/405-better-error-messages-for-bad-defrecord-calls. The ticket comment includes instructions for how and where to patch this. If anyone has been frustrated by Clojure's error messages and

Re: Memoizing a recursive function?

2010-07-22 Thread Laurent PETIT
Another solution, use the var, and then use memoize on your function as usual: (defn fib[n] (if (> n 2) (+ (#'fib (- n 2)) (#'fib (- n 1 (of course this was to answer closely to the question. Nobody would write fib like that in practice : good general question, bad example) HTH, -- L

Re: Memoizing a recursive function?

2010-07-22 Thread Mike Meyer
On Wed, 21 Jul 2010 14:47:12 -0700 (PDT) logan wrote: > Lets say I have the following function > > (defn fib[n] > (if (> n 2) > (+ (fib (- n 2)) (fib (- n 1))) > 1)) > > and I want to memoize it, what is the right way to do it? Use defn-memo from clojure.contrib.def.

CCW in Eclipse Market Place + needs a logo !

2010-07-22 Thread Laurent PETIT
Hello, Just a word to inform you that I've provisioned the Eclipse Market Place for Counterclockwise. That way, installing counterclockwise from Eclipse Helios is even simpler than before: use the new "Install from Market Place" feature, search for "Counterclockwise", install. But we need a logo

Re: BUG: Clojure hierarchies (affects 1.2-beta1)

2010-07-22 Thread Stuart Halloway
I closed #406: this is a subset of the issue already covered under #382, which Rob was planning to do a patch for. Rich, can you check and see if CAs have arrived from Rob Lachlan and Michał Marczyk? Stu > Made a ticket for this here (including the simple diagnosis): > > https://www.assembla.

Re: Memoizing a recursive function?

2010-07-22 Thread dennis
You should make a LazySeq to momoize intermediate result: (defn fib[n] (if (> n 2) (+ (fib (- n 2)) (fib (- n 1))) 1)) (def fib (memoize fib)) (def fib-seq (map fib (iterate inc 0))) then take the result by nth: user=> (nth fib-seq 45) 1134903170 user=> (nth fib-seq 46) 1836311903 user

Re: Literate Clojure - a good lead ...

2010-07-22 Thread Eli Barzilay
Tim Daly writes: > >Antony Blakey wrote: >> The essence of the PLT model is the language integration that >> allows symbol resolution by reusing the language mechanism for the >> documentation. > > "Language integration" is a false goal. It is technically possible > to call functions in any langu

Re: gobble up a collection 2 at a time

2010-07-22 Thread Randy Hudson
(partition 2 coll) will give you the sequence two at a time. To map your function, you'd do (map #(apply myfcn %) (partition 2 '(1 2 3 4 5 6 7 8))) On Jul 21, 10:20 pm, Glen Rubin wrote: > Hi!  I want to process a collection 2 elements at a time using map. > > My function accepts 2 parameters (a,

Memoizing a recursive function?

2010-07-22 Thread logan
Lets say I have the following function (defn fib[n] (if (> n 2) (+ (fib (- n 2)) (fib (- n 1))) 1)) and I want to memoize it, what is the right way to do it? Using the default memoize does not work correctly. the reason is even though the first call to fib is memoized, the recursive ca

Re: Literate Clojure - a good lead ...

2010-07-22 Thread Tassilo Horn
On Thursday 22 July 2010 12:08:15 Martin Clausen wrote: > No it is right. The .org file can be found in the source code archive: > > http://genprog.adaptive.cs.unm.edu/asm/asm-gp.tar.bz2 Oh, I see. A very nice example. :-) Bye, Tassilo -- You received this message because you are subscribed

Re: Literate Clojure - a good lead ...

2010-07-22 Thread Martin Clausen
No it is right. The .org file can be found in the source code archive: http://genprog.adaptive.cs.unm.edu/asm/asm-gp.tar.bz2 /mac On Thu, Jul 22, 2010 at 12:00 PM, Tassilo Horn wrote: > On Thursday 22 July 2010 03:41:15 martin_clausen wrote: > > Hi Martin, > >> A good example of this for a non-

Re: Literate Clojure - a good lead ...

2010-07-22 Thread Tassilo Horn
On Thursday 22 July 2010 03:41:15 martin_clausen wrote: Hi Martin, > A good example of this for a non-trivial app is here: > > http://genprog.adaptive.cs.unm.edu/asm/instructions.html I guess that's the wrong link... Viele Grüße, Tassilo > On Jul 21, 8:54 am, Tassilo Horn wrote: > > On Wedne

Re: Slime, debug-repl & clojure debugging toolkit

2010-07-22 Thread Krukow
On Jul 21, 4:02 pm, Ramakrishnan Muthukrishnan wrote: > On Wed, Jul 21, 2010 at 6:04 PM, Krukow wrote: > >  0: com.trifork.intrafoo.clj.extract_contacts > > $extract_all.invoke(NO_SOURCE_FILE:1) > >      Locals: > >        pref = /Users/krukow/workspaces/trifork/intrafoo_clj/ > > contactdata/ >

Re: Slime, debug-repl & clojure debugging toolkit

2010-07-22 Thread Krukow
On Jul 21, 4:43 pm, George Jahad wrote: > Karl, I use the debug-repl all the time and don't see errors like > this. > > You can use the standard debug-repl from with slime's *inferior-lisp* > buffer.  Try it from there and see what you get.  If that fails, try > it from outside of emacs entirely i

Re: Access function argument from outer anonymous function

2010-07-22 Thread Meikel Brandmeyer
Hi, On Jul 22, 10:36 am, Paul Richards wrote: > When I nest these however: #() cannot be nested. 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 n

Re: Access function argument from outer anonymous function

2010-07-22 Thread B Smith-Mannschott
On Thu, Jul 22, 2010 at 10:36, Paul Richards wrote: > When I use the reader macro for anonymous functions I can use "%" to > access the function argument: > > #(... % ...) > > This is great.  When I nest these however: > > #(.. #(.. % ..) ) > > Is there a way to access the function argument for th

Access function argument from outer anonymous function

2010-07-22 Thread Paul Richards
When I use the reader macro for anonymous functions I can use "%" to access the function argument: #(... % ...) This is great. When I nest these however: #(.. #(.. % ..) ) Is there a way to access the function argument for the outer anonymous function from inside the inner one? E.g, it would