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
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
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
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
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
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
> 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
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
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
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
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
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
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
*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
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
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
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
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
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
(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
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
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
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.
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
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.
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
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
(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,
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
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
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-
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
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/
>
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
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
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
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
37 matches
Mail list logo