Re: Any downside of record compared to map

2012-07-23 Thread Aravindh Johendran
On Monday, July 23, 2012 8:20:40 AM UTC-4, Lee wrote: > > > Considering that maps do have upsides compared to records in some cases > (as indicated, e.g., by Chas's flowchart), and that struct-maps add a > couple of handy features in the context of some uses of maps, can anybody > say why stru

Small issue with swank-cdt on Windows

2011-05-11 Thread Aravindh Johendran
Swank cdt is unbelievably awesome and many thanks for the superb effort! On windows with swank-clojure 1.4.0-SNAPSHOT, there seems to be a small issue with displaying source once a breakpoint is hit. I get a message saying "clojure\set.clj - source not found". Digging into swank source, the method

Re: challenge with vectors

2010-10-26 Thread Aravindh Johendran
What kind of an answer are you looking for? Just the quickest way to do it? Do you want an "idiomatic" clojure solution or are you learning functional programming using clojure? There are many ways to do this. Others have provided cool solutions. Here's a way of doing it if you are interested in f

Re: Odds for tail calls in JVM

2010-10-26 Thread Aravindh Johendran
Sorry, forgot to post the link discussing upcoming jdk features: http://blogs.sun.com/mr/entry/plan_b_details -- 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

Odds for tail calls in JVM

2010-10-26 Thread Aravindh Johendran
John Rose of Oracle has posted a very articulate message on the chances of having tail calls in the JVM. http://mail.openjdk.java.net/pipermail/mlvm-dev/2010-October/002016.html I feel pessimistic about the chances. I doubt tail calls will be a priority for Oracle and IBM. I don't even see it ment

Re: Question on binding & macros

2010-10-11 Thread Aravindh Johendran
> Hope that helps. > > Sincerely > Meikel Thanks! That helped. -- 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

Question on binding & macros

2010-10-11 Thread Aravindh Johendran
I'm working on the chapter on continuations in On Lisp (Chapter 20) and am trying to translate the code to clojure However, I am running into some issues. With the following definitions: (def *cont* identity) (defmacro =values [& retvals] `(*cont* ~...@retvals)) why would the following two ex

Re: clojure-mode bug in Emacs

2010-09-30 Thread Aravindh Johendran
On Sep 30, 8:26 am, ".Bill Smith" wrote: > Has anyone else noticed this?  In Emacs clojure-mode, indentation and > syntax coloring can get out of whack after a string that contains an > open parenthesis. Not happening with the version i am using. Do you use paredit? -- You received this message

Memoizing tree recursive calls

2010-07-20 Thread Aravindh Johendran
If we have tree recursive procedure such as the follows, how can we use memoize it so that it automatically caches the values it has already computed . (defn fib [n] (println "Calling fib with arg --> " n) (cond (= n 0) 0 (= n 1) 1 :else (+ (fib (- n 1)) (fib (- n 2)))

Re: Calling apply on java methods

2010-05-12 Thread Aravindh Johendran
On May 11, 1:39 pm, Alexandre Patry wrote: > I am trying to call a java method using apply, like : > > (apply .println [System/out "hello" "world"]) > > But I get an error: "Unable to resolve symbol: .println in this context" > > Am I missing something? The apply method takes a Clojure function

Re: Calling apply on java methods

2010-05-12 Thread Aravindh Johendran
On May 11, 1:39 pm, Alexandre Patry wrote: > I am trying to call a java method using apply, like : > > (apply .println [System/out "hello" "world"]) > > But I get an error: "Unable to resolve symbol: .println in this context" > > Am I missing something? The semantics (meaning of the syntax/code)

Re: Translation from CL - "On Lisp" program

2010-04-16 Thread Aravindh Johendran
Sorry, I shoulda been clearer. By similar functionality, i meant a 20- q game with 1) the network implemented as closures and 2) code that doesn't have to hold state in a global datastructure The question wasn't about the easiest way to implement the game. State is unavoidable in many circumstanc

Translation from CL - "On Lisp" program

2010-04-14 Thread Aravindh Johendran
Is there a way to write this in clojure without java's hashmaps or clojure's atom/ref/var-binding/etc? The program doesn't have to be an exact translation. I just want similar functionality. -- >From chapte