n 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 <ray.t...@gmail.com> wrote:
> I think of it this way too but was really trying to get a formal definition,
> if one exists.
>
> Whil
://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 marsh...@logical.net wrote:
It really depends on the benchmark and the programmer, and sometimes on the
computer. And on what a person
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 because you are subscribed to the Google
Groups
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:
(clojure-version) = 1.4.0
(let [x 8.9] (identical? x x)) = false
Well
,
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. However, I am still struggling
predicate for numerical equality.)
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
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 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
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 contrib (* (first daily-values
?
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
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group
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.
int n = dailyValues.length
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' using a list or a vector. So the
rules are a little different from other Lisps.
Have all good days,
David Sletten
zqr zbc aqd] 0) = ((abc
zbc))
(match-position [abc abd aed axf zqr zbc aqd] 1) = ((abd aed
aqd))
(match-position [abc abd aed axf zqr zbc aqd] 2) = ((abc
abd))
(match-position [abc abd aed axf zqr zbc aqd qbd tbd tqr]
0) = ((abc zbc) (abd qbd tbd) (zqr tqr))
Have all good days,
David Sletten
On Nov 24, 2010, at 11:45 PM, Ken Wesson wrote:
On Wed, Nov 24, 2010 at 11:11 PM, Baishampayan Ghose b.gh...@gmail.com
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]
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 b.gh...@gmail.com
wrote:
I just needed a function
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 multiple keys
://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 #{adjective} string.
Then, you can take
a0 to point to a1?
In any case, this behavior seems weird.
Have all good days,
David Sletten
Stu
Notice that when I redefined a, I only included one arity. If b were
updated with the fn that a was redefined to, then (b 1 2) should have
thrown an exception. Instead, it used the old
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 is
getting def'd?
Have all good days,
David Sletten
[] 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 B]) 0)
#DefaultTableModel javax.swing.table.defaulttablemo...@3ebc312f
Have all good days,
David Sletten
--
You
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 16, 2010, at 10
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 moderated - please
than that.
Have all good days,
David Sletten
I was working on some code recently found that my biggest performance
bottleneck was calling `seq` to check for emptiness. The calls to
`seq` were causing lots of object allocation and taking noticeable CPU
time. I switched to using
Elapsed time: 2144.142 msecs
nil
This isn't so surprising though, considering that 'identical?' is the simplest
possible test you could try--do two references point to the same object in
memory? It can't get any more efficient than that.
Have all good days,
David Sletten
I was working on some
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.
To unsubscribe from
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@googlegroups.com
Note
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 to
the end of the vector, so there's mere
:
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 fn too. #{} is just a reader macro for
syntactic sugar
.
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 pairs (list [1 :a] [2 :b] [3 :c]))
...
(loop [ps pairs, ret
Some of you might enjoy the music video for the new Land of Lisp book:
http://www.youtube.com/watch?v=HM1Zb3xmvMcfeature=player_embedded
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
Some of you might enjoy the music video for the new Land of Lisp book:
http://www.youtube.com/watch?v=HM1Zb3xmvMcfeature=player_embedded
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
]
(* 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 general-purpose
solution?
Have all good days,
David Sletten
On Oct 16, 2010, at 7:05 PM, Steven E. Harris
= x y epsilon
Then you determine how strict epsilon needs to be:
(float 12.3049 12.305) = false
(float 12.3049 12.305 1e-6) = true
(float= 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
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
Note that posts from new members
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, the number 0.... (with an infinite
number
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
The computer (probably the JVM
:
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 Sletten
On Oct
]})
([:headline this] [:headline is] [:headline me] [:points 1] [:points 2]
[:points 3] [:comments 10] [:comments 20] [:comments 30])
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
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 clojure@googlegroups.com
Note
On Oct 1, 2010, at 1:57 AM, Sean Corfield wrote:
On Thu, Sep 30, 2010 at 12:52 AM, David Sletten da...@bosatsu.net 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 to small point
) (for [[k v] m] [(keyword (.toLowerCase k)) v])))
This will preserve the type of the map.
(string-keys { :stuff 42 :like 13 :this 7 } ) = {THIS 7, LIKE 13, STUFF
42}
(keyword-keys (string-keys { :stuff 42 :like 13 :this 7 } )) = {:stuff 42,
:like 13, :this 7}
Have all good days,
David Sletten
On Sep 30, 2010, at 3:40 AM, Sean Corfield wrote:
On Thu, Sep 30, 2010 at 12:30 AM, Mark Engelberg
mark.engelb...@gmail.com 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
-not =) = (2 3 2)
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
)))
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'.
Have all good days,
David Sletten
--
You received this message
? (length (read-from-string '(+ 1 2)))
2
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
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 group, send email to clojure
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 this
)
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 Sletten
On Sep 24, 2010, at 12:31 AM, HiHeelHottie
:
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 friend has lent me a copy of
The Little LISPer and I've started working through it, using some
web
))
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 toying around at the REPL I realize that I have been working
with a heretofore invalid understanding of collections. For example,
working
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 collections of data. THe first group of signals called
target looks
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 working with currently.
-Patrick
On Aug
\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?)) =
IS THIS NOT PUNG?
Have all good days,
David Sletten
On Aug 20, 2010, at 4:25 AM, probertm wrote:
Hi
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:
- why does (+ 4.2
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,
David Sletten
On Aug 9, 2010, at 8:24
))
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
? 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 ?
Definitely yes.
Aloha,
David Sletten
,
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 this group, send email to
clojure+unsubscr
...@a761ce: nil #r...@622e6: nil #r...@2689a7: nil #r...@173b39:
nil)
Also, in your second example above, I think it's more idiomatic to
write (fn [_] (ref nil)) to demonstrate that you're ignoring the
argument.
Aloha,
David Sletten
--~--~-~--~~~---~--~~
You
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 denominators rather than divisors.
Aloha,
David Sletten
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
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
(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
--~--~-~--~~~---~--~~
You received this message because you
possible suggestions rather than terminating with
the first one. So I'll be dealing with sequences anyway.
Aloha,
David Sletten
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Clojure group.
To post to this group, send
useful. Try it out and let me know your opinions.
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
.
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 this group, send email to
clojure+unsubscr
]
(let [age (ref age)]
{:first-name (fn [] first-name)
:last-name (fn [] last-name)
:sex (fn [] sex)
:age (fn [] @age)
:set-age (fn [new-age] (dosync (ref-set age new-age)))}))
person= (def me (make-person David Sletten 39 male))
#'person/me
person= ((me :first-name))
David
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
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, send email to clojure@googlegroups.com
To unsubscribe from this group
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? (range 1 10 = 2, 4, 6, 8
Aloha,
David Sletten
--~--~-~--~~~---~--~~
You received this message
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
--~--~-~--~~~---~--~~
You received this message because you
octal
010001 - 4097 not binary 010001 - 17
Sorry,
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
, #o8, #xQUICKSAND
(Of course, #36rCLOJURE = 27432414842 :-) )
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
of bad. (I'll bet it's exactly
what you expect to happen.)
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
, FLET implies non-
recursive local function definition whereas LABELS suggests
(mutually) recursive function(s).
So,
(letfn [(f [x] (+ x 2))] (f 8)) ; LABELS
should ideally be:
(let [f (fn [x] (+ x 2))] (f 8)) ; FLET
Aloha,
David Sletten
--~--~-~--~~~---~--~~
You
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 this group, send email
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 Google Groups
Clojure group.
To post to this group, send email
verbatim
in your example:
(re-seq #(\w+)=(\S+)
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
.
-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 to this group, send email to clojure@googlegroups.com
To unsubscribe from
this in 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, send email
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 received
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 certainly qualifies as less idiotic. :)
Mahalo,
David Sletten
,
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 this group, send email to
clojure+unsubscr...@googlegroups.com
;
(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
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
)
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 this group, send email to
clojure+unsubscr
0.4
0.5
0.6
0.7
0.7999
0.8999
0.
1.0999
Whoops. Good thing I had an escape hatch.
If you've read this far you'll want to take a look at the links Mark
provided earlier.
Aloha,
David Sletten
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)] (list x y)) = (8 9)
Aloha,
David Sletten
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
you've implemented FORMAT!
Aloha,
David Sletten
and strings rather than nesting them.
I don't think reduce would actually work here. As you see, the test
(= n arabic) determines whether we continue working with the
original num-list or proceed to the tail. I'm not sure of how to get
that behavior with reduce.
Aloha,
David Sletten
in an AI Memo (AIM-8). Here's to McCarthy and Lisp. And
here's to you, RIch, for carrying on the flame.
Aloha,
David Sletten
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Clojure group.
To post to this group, send
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 more
natural ways to do things?
Aloha,
David Sletten
(def roman
this alternative is alright:
(some #{'a} '(a b c)) = a
Is that the Clojure version of MEMBER?
Aloha,
David Sletten
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Clojure group.
To post to this group, send email
: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 Google Groups
Clojure group.
To post to this group, send email to clojure@googlegroups.com
. Nice explanation. Thanks again Mark for the article.
sheepish
As you can see I haven't finished reading the whole thing yet.
/sheepish
Aloha,
David Sletten
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Clojure
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 entry in the API. The same holds
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 subscribed to the Google Groups
Clojure group
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 l) result )
I forgot to ask
#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
--~--~-~--~~~---~--~~
You received this message because you
On Feb 16, 2009, at 10:34 AM, Stuart Halloway wrote:
David Sletten sent me this erratum:
At the beginning of section 2.4 we have The symbol user/foo refers to
a var which is bound to the value 10. Under the next subsection
Bindings we have Vars are bound to names, but there are other
the
global.
; bar still refers to global pung
(let [pung 9] (list pung foo @bar)) = (9 8 8)
Do I have it right now?
Aloha,
David Sletten
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Clojure group.
To post
: 938.675334 msecs
But the multiply seems to have the edge in both expression and speed.
The real hit would come with bignums, no? But as far as the routine
use of MOD goes we're probably talking about fixnums 99% of the time.
Aloha,
David Sletten
99 matches
Mail list logo