hat these Common Lisp definitions don’t line up exactly with Clojure,
but they are illuminating.
Have all good days,
David Sletten
On Dec 28, 2015, at 11:16 AM, Ray Toal wrote:
> I think of it this way too but was really trying to get a formal definition,
> if one exists.
>
> While I'v
edges as much:
http://www.clisp.org/propaganda.html
See the section "CLISP Performance" at the bottom of the page.
Have all good days,
David Sletten
On Feb 18, 2014, at 10:37 PM, Mars0i wrote:
> It really depends on the benchmark and the programmer, and sometimes on the
> computer. An
nt numbers,
this is probably not worth getting worked up about.
Thanks,
David Sletten
On May 5, 2012, at 5:14 PM, Daniel Solano Gómez wrote:
> On Sat May 5 16:43 2012, David Sletten wrote:
>> Thanks for your response Daniel. You explain WHAT is apparently
>> happening here. Howev
On May 5, 2012, at 3:06 PM, Daniel Solano Gómez wrote:
> On Sat May 5 14:53 2012, David Sletten wrote:
>> Can anyone explain this change?
>> (clojure-version) => "1.2.0"
>> (let [x 8.9] (identical? x x)) => true
>>
>> Compared to:
>> (cl
Can anyone explain this change?
(clojure-version) => "1.2.0"
(let [x 8.9] (identical? x x)) => true
Compared to:
(clojure-version) => "1.4.0"
(let [x 8.9] (identical? x x)) => false
Thanks.
David Sletten
--
You received this message b
in
terms of a single expression as a consequent. The need for enclosing
parentheses disappears.
Beware that the predicate 'nil?' tests whether an object is 'nil'. You probably
want to use the predicate 'empty?' to test whether your coin list is empty.
Have all g
total 20) 8.75
> (or (amount > 20) (= country "US") 9.75)
> :else 10.0 )
predicate | consequent
(= total 20) | 8.75
(or (amount > 20) (= country "US") 9.75) | :else
10.0 | ???
Not syntactically correct.
Here's what you want to use:
(cond
(== tota
On Jun 29, 2011, at 1:45 AM, David Sletten wrote:
>
> (defn compute-contrib [daily-values total-values]
> (loop [contrib []
> daily-values daily-values
> total-values total-values]
> (if (empty? daily-values)
> contrib
> (recur (conj
On Jun 28, 2011, at 11:37 PM, David Sletten wrote:
>
> On Jun 28, 2011, at 8:20 PM, Bhinderwala, Shoeb wrote:
>> The inputs are two arrays of type double of the same length – dailyValues
>> and totalValues. The output is the array contrib of the same length.
>&g
s[i];
>
> }
>
1. Are you sure that this does what you want it to?
2. What does it do?
There are two obvious red flags with the code:
-You have a variable called 'sum' which is really a product.
-You never use index 0 of totalValues
Have all good days,
David Sletten
element, the 'rest' of the sequence, and allows you to construct ('cons') a new
sequence from an existing one. Lists and vectors are two concrete sequence
types, and they have significant differences in terms of behavior and
performance. But in Clojure you can 'cons'
["abc" "abd" "aed" "axf" "zqr" "zbc" "aqd"] 1) => (("abd" "aed"
"aqd"))
(match-position ["abc" "abd" "aed" "axf" "zqr" "zbc" "aqd
I stand corrected. I thought it required another arg. Yours was right already.
On Nov 24, 2010, at 11:53 PM, David Sletten wrote:
>
> On Nov 24, 2010, at 11:45 PM, Ken Wesson wrote:
>
>> On Wed, Nov 24, 2010 at 11:11 PM, Baishampayan Ghose
>> wrote:
>>>> I
On Nov 24, 2010, at 11:45 PM, Ken Wesson wrote:
> On Wed, Nov 24, 2010 at 11:11 PM, Baishampayan Ghose
> wrote:
>>> I just needed a function for every-nth element in a sequence.. I know it
>>> can be trivially implemented as ..
>>> (defn every-nth [n coll]
>>> (letfn [(evn [cn s]
>>>
Alex,
There might be some useful info here:
http://www.gettingclojure.com/cookbook:sequences#sorting
Have all good days,
David Sletten
On Nov 22, 2010, at 12:07 AM, Alex Baranosky wrote:
> So for the case I had that method worked. I wonder though if I had wanted to
> sort by multipl
ial plus links here:
http://www.gettingclojure.com/cookbook:sequences#commas
Have all good days,
David Sletten
On Nov 20, 2010, at 6:00 PM, HiHeelHottie wrote:
>
> I think ruby has nice string interpolation. You can put the following
> in a textfield that a user can modify
>
> This is a
1 only takes one arg now). But within a0
itself the references to 'a' are being resolved at runtime to a1 now, not as
references to a0 as before.
Are you saying that inside a0 Clojure detects that 'a' means something else now
and recompiles a0 to point to a1?
In any case, this beh
Ok, now I get it. The results you included weren't a hypothetical example, you
were simply using a different version of Clojure. So in your 1.3 version, the
second (b 1 2) does return -3?
Are the macro expansions of 'defn' different?
Have all good days,
David Sletten
On Nov
r takes either a java.util.Vector or an array
of Object[].
To make a String[] array out of a Clojure vector
(clojure.lang.PersistentVector):
(into-array String ["I" "B"])
So you wind up with this:
(javax.swing.table.DefaultTableModel. (into-array String ["I" &q
it is bound within the function definition to the
function object itself, allowing for self-calling, even in anonymous functions.
So I guess technically the self-referential 'a' in the function definition
actually refers to the name inside the 'fn' form not the variable that i
ould solve the OP's performance issue. I simply pointed out that he was
testing two opposite things.
> On Nov 14, 11:42 am, David Sletten wrote:
>> On Nov 14, 2010, at 2:16 PM, Eric Kobrin wrote:
>>
>>> In the API it is suggested to use `seq` to check if coll is
The StackOverflowError jumps over the lazy seq.
Have all good days,
David Sletten
--
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
(identical? () ( (time (dotimes
[_ iterations] (empty? ()
"Elapsed time: 2.608 msecs"
"Elapsed time: 2144.142 msecs"
nil
This isn't so surprising though, considering that 'identical?' is the simplest
Have all good days,
David Sletten
--
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
first post.
I don't want to start any language wars, but this is funny:
http://gosu-lang.org/comparison.shtml
Have all good days,
David Sletten
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@google
Or for those of you who prefer that other people won't be able to read your
code:
(defn foldr [f coll]
(reduce #(f %2 %1) (reverse coll)))
Have all good days,
David Sletten
On Nov 5, 2010, at 10:03 PM, Yang Dong wrote:
> Maybe because Clojure has a vector, and conj conjoins new elements
t.
Also check out the documentation for clojure.set:
http://clojure.github.com/clojure/clojure.set-api.html
Have all good days,
David Sletten
On Oct 31, 2010, at 10:55 PM, tonyl wrote:
> I guess I should've look harder (and ask more in the irc ;) it is a
> data structure and has a set
pair in a convenient way.
BTW, do you really mean to call 'add-to-result' and 'do-sth-else' with a map
and a key but no value?
Have all good days,
David Sletten
On Oct 28, 2010, at 8:49 PM, andrei wrote:
> Hi,
>
> I have a code similar to this:
>
> (def pai
Some of you might enjoy the music video for the new Land of Lisp book:
http://www.youtube.com/watch?v=HM1Zb3xmvMc&feature=player_embedded
Have all good days,
David Sletten
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post
Some of you might enjoy the music video for the new Land of Lisp book:
http://www.youtube.com/watch?v=HM1Zb3xmvMc&feature=player_embedded
Have all good days,
David Sletten
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post
if (> (+ eps 1.0) 1.0)
(recur (* eps 0.5))
eps)))
(defn scaled-epsilon [x]
(* epsilon (Math/pow 2 (Math/floor (log2 x )
And finally, what is your response to the OP? You define 'same?' but place
several caveats on its use. Are you warning that there is no gener
<= 12.305 12.3049) => true
(float<= 12.305 12.3049 1e-6) => false
(float> 12.305 12.3049 1e-6) => true
Have all good days,
David Sletten
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send e
ber that satisfies your claim, so equality
must hold.
Have all good days,
David Sletten
On Oct 13, 2010, at 6:36 PM, Matt Fowles wrote:
> Felix~
>
> You are correct that the sequence of numbers
>
> 0.9
> 0.99
> 0.999
> ...
>
> asymptotically approaches 1; however,
cate the string of 9's, which we must
invariably do in a computer-based representation.
Have all good days,
David Sletten
--
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
N
:
3463521440926951/281474976710656
Or in decimal:
12.304848840923025272
This is the best approximation for 12.3049.
When you scale epsilon (0.1) by about 12, you can see that these two
numbers are "equal" as expected in the sense defined by float=.
Have all good days,
David S
This discussion may help:
http://www.gettingclojure.com/cookbook:numbers#comparing-floats
Have all good days,
David Sletten
On Oct 12, 2010, at 12:17 PM, cej38 wrote:
> I keep running into this type of problem:
>
> user=> (- 12.305 12.3049)
> 9.9976694E-5
>
> T
efn d-map [m]
(apply concat
(map (fn [[key val-list]]
(map (fn [val] [key val])
val-list))
m)))
(d-map {:headline ["this" "is" "me"]
:points [1 2 3]
:comments [10 20 30]})
([:headline "this"] [
purpose of improving the examples.
What are your thoughts on this issue? Am I out of line, or is this a reasonable
policy?
Have all good days,
David Sletten
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to
On Oct 1, 2010, at 1:57 AM, Sean Corfield wrote:
> On Thu, Sep 30, 2010 at 12:52 AM, David Sletten wrote:
>> Huh?! How many solutions do you want? You're starting to annoy me Sean.
>
> Sorry dude. I think it's really insightful to see lots of different
> solutions
On Sep 30, 2010, at 3:40 AM, Sean Corfield wrote:
> On Thu, Sep 30, 2010 at 12:30 AM, Mark Engelberg
> wrote:
>> Except that if you use .toUpperCase, you have to remember to type hint
>> the input. Any time you call a Java method without type hinting, you
>> take a significant performance hit.
STUFF"
42}
(keyword-keys (string-keys { :stuff 42 :like 13 :this 7 } )) => {:stuff 42,
:like 13, :this 7}
Have all good days,
David Sletten
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email t
em %) coll)
>(filter #(test item %) coll)))
That's really nice Meikel. I was trying to remember how to do the new keywords,
but I couldn't find an example. You have the default value for :test in there
too. Interesting idea to replace 'remove not' with 'filter
') since we aren't passing in a list of
keywords.
(find-all 1 '(1 2 3 2 1) :test =) => (1 1)
(find-all 1 '(1 2 3 2 1) :test not=) => (2 3 2)
(find-all 1 '(1 2 3 2 1) :test-not =) => (2 3 2)
Have all good days,
David Sletten
--
You received this message becaus
e a look at the site and let us know what works and what needs to be
fixed. And start thinking up your own recipes.
Thanks.
Have all good days,
David Sletten
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this gro
least the Clojure printer is cooperating here. In Common Lisp the printer
helps hide QUOTE too in the first line here:
? (read-from-string "'(+ 1 2)")
'(+ 1 2)
8
? (first (read-from-string "'(+ 1 2)"))
QUOTE
? (length (read-from-string "'(+ 1 2)&qu
Ah, right. Thanks. I'm not keeping up with my Clojure version numbers...
On Sep 24, 2010, at 1:52 AM, Rasmus Svensson wrote:
> There's also 'bytes', 'byte-array' and 'into-array':
>
> (byte-array (map byte [1 2 3]))
> (into-array Byte/TYPE (map byte [1 2 3]))
>
> // raek
>
> --
> You received
e java.lang.Byte java.lang.Byte)
Or you can create a Java byte[] array:
(def a (make-array Byte/TYPE 3))
But you still have to coerce:
(aset a 0 (byte 2)) => 2
(aset a 0 2) =>
java.lang.IllegalArgumentException: argument type mismatch (NO_SOURCE_FILE:0)
Have all good days,
David
chapter 9 dealing
with the Y-Combinator implemented in Clojure. It's pretty weird:
http://groups.google.com/group/clojure/browse_thread/thread/c9bd4e79e5877a66
Have all good days,
David Sletten
On Sep 21, 2010, at 6:38 PM, ax2groin wrote:
> Newbie here, to both LISP and Clojure. A f
level-1))
signal)
That's a lot easier for me to understand.
Have all good days,
David Sletten
On Aug 25, 2010, at 10:06 AM, Glen Rubin wrote:
> After to
signal'. Finally, the innermost map must do the actual
work pairing each 'signal' and 'scalar'.
Have all good days,
David Sletten
On Aug 23, 2010, at 11:26 AM, Glen Rubin wrote:
> I am trying to write a fn to correlate 2 signals using 3 nested map
> fn. I have 2 coll
Does this make the processing a little clearer?
#"(?<=([ ab]))?([ab])\2*"
Have all good days,
David Sletten
On Aug 21, 2010, at 10:02 PM, CuppoJava wrote:
> Wow that's so short! Thanks Chouser! I will abstain from showing the
> awful hack that I've been workin
This may help explain things:
http://groups.google.com/group/clojure/msg/325228e8b66923ac
Have all good days,
David Sletten
On Aug 20, 2010, at 8:26 AM, bufo wrote:
> I am currently learning clojure by reading The Joy of Clojure and I
> have 2 questions on float opertions:
>
>
"Is this not pung?") => (\I \S \space
\T \H \I \S \space \N \O \T \space \P \U \N \G \?)
But now we've wound up with a sequence rather than a string specifically, so we
need one more step:
(apply str (map (fn [ch] (Character/toUpperCase ch)) "Is this not pung?"))
tead, you need to rebind the variable 'words' to subsequent tails of the
original list:
(defn show [words]
(loop [l words]
(println (first l))
(if (empty? l)
(println "DONE")
(recur (rest l)
And you probably want to test for the end of list before you pri
this 2-arity version. I personally prefer the first approach
> (with a private helper function via defn-) or the last approach (with an
> embedded loop).
Hence "pretty much the same thing". :)
Have all good days,
David Sletten
--
You received this message because you are su
(rest l) result
Or you could simplify things by using loop:
(defn count-zeros [l]
(loop [num-list l
result 0]
(cond (empty? num-list) result
(zero? (first num-list)) (recur (rest num-list) (inc result))
:else (recur (rest num-list) result
Have all good days,
D
he first 10 results.
Is it possible? Yes...
(let [yields (ref 0)]
(for [x (range 1000) :when (when (odd? x) (dosync (ref-set yields
(inc @yields))) true) :while (<= @yields 10)] x)) =>
(1 3 5 7 9 11 13 15 17 19)
Is it advisable? No.
>
> Or should I just use (take 10 ) on the for ?
84427> # # clojure.lang@1fac852> #)
>
>
In that case, here's something that reads more clearly to me:
(take 10 (repeatedly #(ref nil))) =>
(# # #
# # #
# # # #)
Also, in your second example above, I think it's more idiomatic to
write (fn [_] (r
htforward:
(repeat (count (list :old1 :old2 :old3)) :new)
Aloha,
David Sletten
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to clojure@googlegroups.c
What is the mechanism for reporting errors in documentation?
For instance, the doc string is in the wrong place for 'rational?'.
And 'quot' and 'rem' take parameters 'num' and 'div', but the
documentation talks about "de
>
Paul and David N. have already given you the right advice. But to
help you understand why your square-ref function didn't work, compare
it to this:
(defn square-ref [x] (dosync (alter foo (fn [_] (square x)
Do you see the difference?
Aloha,
David Sletten
--~--~-~--~~--
eral case, but you guys may be right
that nested loops just aren't needed.
Your example looks useful, Mark. In fact, for the real program I do
want to collect all possible suggestions rather than terminating with
the first one. So I'll be dealing with sequences anyway.
Aloha,
(if match
match
(recur i (inc j )
The one nice thing about this is I can terminate the entire loop and
return a value in one step. Otherwise the logic is a mess.
Any suggestions out there?
Aloha,
David Sletten
--~--~-~--~~~---~-
le true))
(doto canvas
(.setBounds 0,0,width height)
(.setBackground (Color/BLACK))
(.createBufferStrategy 2)
(.requestFocus))
(draw canvas
Aloha,
David Sletten
--~--~-~--~~~---~--~~
You received this message beca
(rest l)))
(rec (cons (first l)
(rec (rest (rec (rest l )))
'(a b c d e))
=> (e d c b a)
Breathtaking in its elegance!
I'm going to move forward with the negotiations, but I need to know
if you, the Clojure com
rogrammer {:language (fn [_] "Clojure") :iq #
(+ 10 %)}))
(upgrade (struct programmer "Bob" "C++" 120)) => {:name
"Bob", :language "Clojure", :iq 130}
Aloha,
David Sletten
--~--~-~--~~~---~--~~
You receive
's a good sign that a side effect has
occurred--some state has obviously changed.
Aloha,
David Sletten
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send
ly--it uses loop. Don't try this at
home:
(zipmap (map str (iterate inc 1)) (iterate inc 1))
>
Aloha,
David Sletten
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group
Is there a simpler way to do this?
(defn get-months []
(drop-last (.getMonths (java.text.DateFormatSymbols.
(defn get-weekdays []
(drop 1 (.getWeekdays (java.text.DateFormatSymbols.
Aloha,
David Sletten
--~--~-~--~~~---~--~~
You received this
only be accessed and changed by the existing support
> functions?
>
One simple (simplistic?) way to guarantee privacy is through closures:
(defn make-person [first-name last-name age sex]
(let [age (ref age)]
{:first-name (fn [] first-name)
:last-name (fn [] last-name)
:sex
' explicitly
> isn't a problem--I just thought I'd mention that the semantics have
> now changed a little.
>
Sorry Mark. I guess I misunderstood what 'prn-str' does. I thought it
was for I/O. I missed the print TO string part.
Aloha,
David Sletten
--~--~-
However, rather than relying on this behavior what
you probably should be doing is using 'apply':
(apply str (filter even? (range 1 10))) => "2468"
If you want commas between those elements, use 'interpose':
(apply str (interpose ", " (filter even? (ran
482114/
ref=sr_1_1?ie=UTF8&s=books&qid=1237204784&sr=1-1
3. Learning Java
http://www.amazon.com/Learning-Java-Pat-Niemeyer/dp/0596008732/
ref=sr_1_1?ie=UTF8&s=books&qid=1237204946&sr=1-1
Pretty up-to-date and covers a lot of ground.
Aloha,
David Sletten
--~--~
>
Umm, that's not really the correct value. Clojure gave you octal
010001 -> 4097 not binary 010001 -> 17
Sorry,
David Sletten
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure&q
011, #o377, #xDEADBEEF, #36rZZZ (Base 36 anyone?)
Illegal:
#b2, #o8, #xQUICKSAND
(Of course, #36rCLOJURE => 27432414842 :-) )
Aloha,
David Sletten
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Cloju
y are derived from a copyrighted book?
Aloha,
David Sletten
--~--~-~--~~~---~--~~
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
To unsubscribe from
d 'let' similar to the distinction
between LABELS and FLET in CL? In other words, FLET implies non-
recursive local function definition whereas LABELS suggests
(mutually) recursive function(s).
So,
(letfn [(f [x] (+ x 2))] (f 8)) ; LABELS
ith the same name
> that allowed me to enter the arguments in a simpler manner.
>
> Also, it just feels odd. You don't get an error when defining the
> same-
> named function--but suddenly neither version works. That's a pretty
> serious side-effect. So maybe this is just
place to support the
increased interest in Clojure that Stu Halloway's book will generate.
Aloha,
David Sletten
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group
not sure what the resolution was, if any.
>
> -Jason
>
Sorry. I missed that.
Thanks for the link.
Aloha,
David Sletten
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post
e basically defined the "word character" class \w verbatim
in your example:
(re-seq #"(\w+)=(\S+)"
Aloha,
David Sletten
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" gr
:
public class LineNumberingPushbackReader extends PushbackReader{
Can't be cast to BufferedReader...
What's the policy for fixing something like this?
Aloha,
David Sletten
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
On Mar 8, 2009, at 2:45 AM, Joshua Fox wrote:
>
> How about this?
> user=> (defn upper-first [s] (apply str (Character/toUpperCase (first
> s)) (rest s)))
> #'user/upper-first
> user=> (upper-first "a")
> "A"
>
That certain
Is there a function to capitalize the first letter of a string or a
better way than this idiotic code?
(apply str (map #(if (zero? %2) (Character/toUpperCase %1) %1)
"clojuriffic" (iterate inc 0)))
Aloha,
David Sletten
--~--~-~--~~~---~--~~
You rec
(recur (cons (first coll) trues) falses (rest coll))
> :else
> (recur trues (cons (first coll) falses) (rest coll)
Aloha,
David Sletten
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
u look at separate in clojure.contrib.seq-utils its simple
> and elegant;
> (defn separate [f s]
> [(filter f s) (filter (complement f) s)])
>
This is exactly what I'm trying to avoid. I don't want to traverse
the collection twice.
Aloha,
David Sletten
--~--~---
ge 10)) => [(0 2 4 6 8) (1 3 5 7 9)]
Aloha,
David Sletten
--~--~-~--~~~---~--~~
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
To unsu
I see a lot of let* in macro expansions, but Clojure's "let" already
behaves like Common Lisp's LET*. Is let* archaic? It seems to behave
the same as "let" in terms of sequential binding.
(let [x 8 y (inc x)] (list x y)) => (8 9)
(let* [x 8 y (inc x)] (
1) "How nice. 10 * 0.1 = 1"
(> x 1) "Whoops. Good thing I had an escape hatch."
:else (trap (+ x 0.1
(trap 0.1)
0.1
0.2
0.30004
0.4
0.5
0.6
0.7
0.7999
0.8999
0.
1.0999
"Whoops. Good
issues when I wrote it, but if you're interested you can
> compare. It's at http://github.com/tomfaulhaber/cl-format.)
>
Thanks for the link Tom. I'd read mention of your work somewhere but
hadn't had a chance to look at it yet. That's extremely cool that
thing". If you're
using "when" as an expression, it has to produce a value even when
the test fails. Why not just use "if" and make that value explicit?
> It would certainly be a waste of 'when' in Clojure to reserve it for
> side effects, since so much
'()
>> :else (let [[[arabic roman] & tail] num-list]
>> (if (>= n arabic)
>> (cons roman (arabic-to-roman (- n
>> arabic)
>>
c-aux seems to me
harder to read in Clojure than it would be in CL with its additional
set of grouping parentheses. When you can't fit both the predicate
and the consequent expression on the same line it gets confusing.
I'd appreciate any feedback regarding my Clojure style. Any m
re/article.html#Sets.
Ahh. Nice explanation. Thanks again Mark for the article.
As you can see I haven't finished reading the whole thing yet.
Aloha,
David Sletten
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Gr
op-while #(not= % :a) (list :c :a :f :e :b :a :b :e))
> => (:a :f :e :b :a :b :e)
>
Thanks for your example anyway.
Mahalo nui loa (vielen dank),
David Sletten
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
y verbose, and even the shortcut is kinda long:
(some #(= % 'a) '(a b c)) => true
Although this alternative is alright:
(some #{'a} '(a b c)) => a
Is that the Clojure version of MEMBER?
Aloha,
David Sletten
--~--~-~--~~~---~--~~
You received
On Feb 19, 2009, at 2:52 AM, David Sletten wrote:
>
> The macros page at clojure.org (http://clojure.org/macros) has links
> to several points in the API page. The link to the "if-not" macro
> appears to be broken (http://clojure.org/api#if-not). There is no
> such e
On Feb 24, 2009, at 6:07 PM, David Sletten wrote:
>
> (defn kill-nil
>([l] (kill-nil l '()))
>([l result] (cond (nil? l) (reverse result)
> (nil? (first l)) (recur (rest l) result)
> true (recur (rest l) (cons (first
erse result)
(nil? (first l)) (recur (rest l) result)
true (recur (rest l) (cons (first l) result )
You young whipper snappers!
Aloha,
David Sletten
--~--~-~--~~~---~--~~
You received this message because you are sub
tp://clojure.org/api#condp). Their documentation is available via
"doc" at the REPL though.
In addition, the "rationalize" function was missing last week, but it
has an entry now. So never mind that...
Aloha,
David Sletten
--~--~-~--~~~---~--
1 - 100 of 105 matches
Mail list logo