On Jul 6, 8:08 pm, David Sletten wrote:
> On Jul 6, 2011, at 10:58 PM, Conrad Taylor wrote:
>
>
>
>
>
>
>
>
>
> > On Jul 6, 7:33 pm, Benny Tsai wrote:
> >> Could you please post the entire form, including the code surrounding the
> >>
On Jul 6, 7:33 pm, Benny Tsai wrote:
> Could you please post the entire form, including the code surrounding the
> cond form (since total, amount, and country need to be defined somewhere)?
Benny, that was just sample code to zero in on the initial issue. I'm
working
through the SICP with a lot
On Jul 6, 7:16 pm, David Sletten wrote:
> Conrad,
>
> The syntax of 'cond' is actually pretty straightforward. Following the symbol
> 'cond' you have pairs of predicate forms and consequent expressions. The
> 'cond' form evaluates each predicate in turn until one evaluates to true and
> then re
On Jul 6, 5:34 pm, Conrad Taylor wrote:
> Hi, what's the correct way to define an else clause of a cond form?
> For example,
>
> a)
>
> (cond
> (= total 20) 8.75
> (or (amount > 20) (= country "US") 9.75)
> (else 10.0))
>
> b)
>
On Jul 6, 6:07 pm, Benny Tsai wrote:
> I believe (d) is considered the idiomatic way*. Btw, I think the second
> case may not be written correctly; if the intended logic is that 9.75 should
> be returned when either amount > 20 or country = "US", the code should look
> something like this:
>
> (c
Hi, what's the correct way to define an else clause of a cond form?
For example,
a)
(cond
(= total 20) 8.75
(or (amount > 20) (= country "US") 9.75)
(else 10.0))
b)
(cond
(= total 20) 8.75
(or (amount > 20) (= country "US") 9.75)
:default 10.0)
c)
(cond
(= total 20) 8.75
On Jul 6, 10:42 am, Phil Hagelberg wrote:
> Hello folks.
>
> I just pushed out Leiningen 1.6.1!http://bit.ly/lein-news
>
> Highlights in this release include:
>
> * New search task: find dependencies in all remote repositories (not
> just clojars) from the command-line.
>
> * New retest task: re
On Jan 18, 10:33 pm, Richard Newman wrote:
> >> defvar
> >> defparamater
>
> def, pretty much. (Some of the niceties of CL semantics don't really
> apply.)
>
> >> let*
>
> let.
>
> >> defconstant
>
> No equivalent. Use def and allow the JIT to do the "is this constant?"
> work.
>
> >> mapcar
>
nce and I'll try to complete
a conversion today.
-Conrad
> (*) : I say "semeed" because I don't know emacs lisp that much, and,
> maybe, if I had followed the road until its end, I would have made
> different conclusions.
>
> 2010/1/19 Conrad Taylor
Hi, I'm starting to convert some code over from Lisp to Clojure.
Thus, I was wondering, what's the appropriate mapping for the
following forms:
defvar
defparamater
let*
defconstant
mapcar
BTW, I was able to find the "Clojure Programming Tutorials and Tips"
but it didn't require the above forms.
10 matches
Mail list logo