is by various Scheme
implementations or how many programmers actually program with it. I
suspect not much and very few.
—
Daniel Lyons
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group
On Aug 13, 2009, at 12:16 AM, Meikel Brandmeyer wrote:
Also this function generates two classes, while the
other two variants generate 6.
Is there an easy way to tell how many classes a given function
generates?
—
Daniel Lyons
--~--~-~--~~~---~--~~
You
On Aug 17, 2009, at 1:27 AM, Meikel Brandmeyer wrote:
Not in general. But as a rule of thumb: every fn/#()
generates a class and hence everything using it:
defn, comp, partial, letfn, thunk'ing in macros, ...
Thanks!
—
Daniel Lyons
? Or is there a better example?
I halfway like the named readtable idea proposed by Richard Newman,
but I have to admit I still feel uneasy for some reason.
—
Daniel Lyons
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Clojure
or into a clojure.def namespace.
Thoughts?
I myself am rather fond of defvar. I'm for it.
—
Daniel Lyons
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure
intended).
—
Daniel Lyons
--~--~-~--~~~---~--~~
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
you have them at all.
—
Daniel Lyons
--~--~-~--~~~---~--~~
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
didn't have enough information to do that correctly at
compile time.
—
Daniel Lyons
--~--~-~--~~~---~--~~
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
of that macro to make it actually implement infix arithmetic.
—
Daniel Lyons
--~--~-~--~~~---~--~~
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
souls
who have the combination of skills and inclination to do something
about it. This is what seems to me to have happened with Ruby and
various other high level languages with mediocre performance.
—
Daniel Lyons
--~--~-~--~~~---~--~~
You received
of other core blocks like regex.
Half the point of clojure.contrib is to be a staging area for future
additions to core. The more that people use things like duck streams,
the greater the likelihood they will be merged with core.
--
Daniel Lyons
for
this change though. I use reductions from time to time.
—
Daniel Lyons
--~--~-~--~~~---~--~~
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
)))
(use 'clojure.contrib.duck-streams)
(doseq [line (read-lines /home/albert/test.xml)]
(println line))
(Sure, one can write (vec (.split (slurp /home/albert/test.xml)
\n))
but that
again implies one knows the java API by heart.)
(vec (read-lines /home/albert/test.xml))
—
Daniel Lyons
been poking around, but all I'm
finding is zipmap, which is close but it builds a map instead of a
list of pairs. Writing my own isn't a big deal, but it seems like
something that has to be in the core somewhere.
map can do this.
user (map vector '(1 2 3) '(4 5 6))
([1 4] [2 5] [3 6])
—
Daniel
-pretty-lambda.html
It can be customized for other languages, but I can't find any
references to anyone doing it with Clojure yet. Details on the mode
here:
http://www.emacswiki.org/emacs/PrettyLambda
—
Daniel Lyons
--~--~-~--~~~---~--~~
You received this message
a little better. Probably it would help to try and implement a lazy
list of the Fibonacci sequence before looking at that code, and then
maybe try some other mathematical sequences that are a little easier
to construct too.
Hope that helps a little,
—
Daniel Lyons
Jeremy,
On Jul 24, 1:20 pm, Jeremy Gailor jer...@infinitecube.com wrote:
I'm just looking for general optimizations that I should be aware of, the
nature of the function itself isn't really important. I could turn to
number theory to get some performance improvement, but from a Clojure
comes to
mind) but I think x/0 is an error (unless it's 0/0).
—
Daniel Lyons
--~--~-~--~~~---~--~~
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
On Jul 10, 2009, at 2:05 PM, Kevin Downey wrote:
using math knowledge to answer (corner) cases of the floating point
spec is silly
people using doubles should be able to expect doubles to behave like
doubles
I don't think it's silly, but fair enough.
—
Daniel Lyons
to and that it gives you a
nice language to write your language in. :) It's also a good exercise
in general and it makes it easier for someone who only knows the
language the ability to work on the language.
—
Daniel Lyons
--~--~-~--~~~---~--~~
You received
misguided. Probably better to use recur and pass the new value to the
next iteration of the loop instead, if there's any way you can do
that. Keep it local instead of mutable.
—
Daniel Lyons
--~--~-~--~~~---~--~~
You received this message because you are subscribed
.
Just my $0.02,
—
Daniel Lyons
--~--~-~--~~~---~--~~
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
hang-ups (closures are probably another) but
this is the first one that comes to mind for me.
—
Daniel Lyons
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure
On Jul 8, 2009, at 10:22 AM, Sean Devlin wrote:
Isn't this why you would use a doc string, and not a comment?
Docstrings aren't the only comments in my code. :)
—
Daniel Lyons
--~--~-~--~~~---~--~~
You received this message because you are subscribed
is the final position.)
—
Daniel Lyons
--~--~-~--~~~---~--~~
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
to my house and * my sister!
I wish you wouldn't talk like that.
—
Daniel Lyons
--~--~-~--~~~---~--~~
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
be a substantial
improvement. Another team had written a VM with a just-in-time
compiler which defeated our braindead C implementation handily. It was
written in Haskell, of course:
http://comonad.com/reader/wiki;mode=categoryitem=Perl
All the best,
—
Daniel Lyons
PS: you can emulate a switch
functions are more composable and reusable.
—
Daniel Lyons
--~--~-~--~~~---~--~~
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
/שלם
user שלם
peace
Interestingly, Emacs doesn't seem to change the writing direction, but
when I pasted it into my mail client it did the right (-to-left)
thing. This stuff is tricky.
—
Daniel Lyons
--~--~-~--~~~---~--~~
You received this message because you
/um/cambridge/projects/terminator/
The rest of that original thread is a great read, by the way, and
thanks for bringing it up!
—
Daniel Lyons
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Clojure group.
To post
implementations share the same general design and
algorithms, we're comparing apples and oranges. Quicksort in Python
will always dominate bubble sort in Clojure.
—
Daniel Lyons
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
.
—
Daniel Lyons
--~--~-~--~~~---~--~~
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
on a case-by-case
basis.
—
Daniel Lyons
--~--~-~--~~~---~--~~
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
advantages in Clojure though. :)
—
Daniel Lyons
--~--~-~--~~~---~--~~
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
On Jun 30, 2009, at 3:53 AM, fft1976 wrote:
On Jun 30, 12:55 am, Daniel Lyons fus...@storytotell.org wrote:
I don't see why that wouldn't be the case, if you were using Java's
native multidimensional arrays. I don't think it would be as much
fun,
That's my point. It's often argued
filesystem thing? Just
curious.
Thanks and hope this helps,
—
Daniel Lyons
--~--~-~--~~~---~--~~
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
without data and objects don't work without
methods. Sometimes one is a better fit than the other. Like Martin
Luther said, mankind is like a drunkard whom after falling off on side
of the horse is liable to get back on and fall off the other side.
All the best,
—
Daniel Lyons
,
BG
--
Baishampayan Ghose b.gh...@ocricket.com
oCricket.com
—
Daniel Lyons
--~--~-~--~~~---~--~~
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
comments are really things you've already heard on the list. You
should use -'s instead of _'s, for consistency if not for readability,
and I'm still leery of defblockfn. But part of the joy of Lisp is
constructing an environment of your liking and taking flight.
—
Daniel Lyons
On Jun 25, 2009, at 12:39 PM, CuppoJava wrote:
I enjoyed Daniel Lyons post there. I recognize some Ayn Rand ideas
there. Ever read Atlas Shrugged perchance? =)
Thanks! Fountainhead yes, Atlas Shrugged no, actually. :) But my
suggestions there come from my (limited) experience. She's a fun
On Jun 25, 2009, at 12:57 PM, CuppoJava wrote:
I'm not running off any server. All the pages are static html, which
are generated by a Clojure script.
Haha, that explains the speed. :) *slaps forehead*
—
Daniel Lyons
--~--~-~--~~~---~--~~
You received
with
and sometimes you just want to dump out some crap and don't really
care if it's valid. Convenience versus correctness. I tend to side
with convenience on templating.
I dunno. This problem has a lot of solutions and all of them seem to
involve compromises.
—
Daniel Lyons
the impression insertion into a balanced binary
tree is O(log(N)), but wouldn't you still need to have N of them? This
algorithm reminds me of heap sort.
—
Daniel Lyons
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups
n from coll):
result.add(x)
result.deleteMinimum() // adding 1 element and removing 1 keeps
the result collection at size n
return result
Hope this helps,
Yes, this explains it. :) Thanks!
—
Daniel Lyons
--~--~-~--~~~---~--~~
You received
must involve *compile-files* and
*compile-path* in some way, but I can't manage to make this work.)
Are there other people on the mailing list compiling (calling eval) at
runtime that might be interested?
—
Daniel Lyons
--~--~-~--~~~---~--~~
You received
On Jun 23, 2009, at 12:41 PM, Christophe Grand wrote:
On Tue, Jun 23, 2009 at 8:02 PM, Daniel Lyons
fus...@storytotell.org wrote:
On Jun 23, 2009, at 11:37 AM, Kyle Schaffrick wrote:
As an aside, I also notice you prefer 'reduce to 'apply when using
arithmetic functions, yet I've
On Jun 23, 2009, at 2:38 PM, Christophe Grand wrote:
On Tue, Jun 23, 2009 at 9:14 PM, Daniel Lyons
fus...@storytotell.org wrote:
Wish it were so, because I like your theory better than my reality: :)
Drat! Stupid reality!
Now I have to bend it to make my theory valid.
range is wily
manipulate Clojure's immutable types as though they are
mutable due to Java's access protection mechanism. You would have to
worry about side-effects happening on the other side during Clojure
transactions that got replayed though.
—
Daniel Lyons
in O(N) time, so I
can see how to do top-n in O(n*N) ≈ O(N) time, but I don't see how to
do that in sqrt(N) time. What's this algorithm called or how does it
work?
—
Daniel Lyons
--~--~-~--~~~---~--~~
You received this message because you are subscribed
going to be in Albuquerque this Sunday, the meeting
will be at the UNM HPC Center and starts at 2 PM.
Thanks,
—
Daniel Lyons
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group
is probably a
blessing).
—
Daniel Lyons
--~--~-~--~~~---~--~~
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
in the hope that someday they'll work for
Facebook or write the next Twitter.
I also find the thought of using a language with software
transactional memory to talk to a database that doesn't have
transactions a little hilarious. :)
—
Daniel Lyons
http://www.storytotell.org -- Tell
like that in practice despite the
caveat and I find it nicer looking than an explicit test.
—
Daniel Lyons
http://www.storytotell.org -- Tell It!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Clojure group
on the core can find a
solution. For some reason I believe there will probably be a good
solution to this, if not generally, then at least in the 80% cases we
are likely to run into.
—
Daniel Lyons
http://www.storytotell.org -- Tell
/
Hope that helps,
—
Daniel Lyons
http://www.storytotell.org -- Tell It!
--~--~-~--~~~---~--~~
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
get there. And a great deal of this is
prevented not just by Clojure but by the JVM itself. There just isn't
a lower level that you can get to from here like you're accustomed to
in C++.
—
Daniel Lyons
http://www.storytotell.org -- Tell
) (+ UPDATEABLE_VALUE (SOME_FUNC)
Whenever you would have modified a local variable before, in FP you
establish a new binding instead.
—
Daniel Lyons
http://www.storytotell.org -- Tell It!
--~--~-~--~~~---~--~~
You received this message because you are subscribed
with commute is using it
when you have a function that isn't commutative.
Anybody want to help with my errors?
—
Daniel Lyons
http://www.storytotell.org -- Tell It!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Clojure
On Jun 10, 2009, at 4:22 AM, Toralf Wittner wrote:
As written above the serial execution of an Agent's actions makes this
thread-safe.
If the actions are executed serially, what is the benefit of having
multiple threads per agent?
—
Daniel Lyons
http://www.storytotell.org -- Tell
On Jun 10, 2009, at 12:03 PM, Toralf Wittner wrote:
On Wed, 2009-06-10 at 10:22 -0600, Daniel Lyons wrote:
If the actions are executed serially, what is the benefit of having
multiple threads per agent?
There is none. Did anybody say there are multiple threads per agent?
There are two
the function
I think this is extremely good advice.
Thanks!
—
Daniel Lyons
http://www.storytotell.org -- Tell It!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure
with
a sort-order column or an auto-incrementing ID, I admit.
Of course, just because it violates relational theory doesn't mean it
wouldn't be a great addition to the language. I'm curious.
Would you mind sharing the code with the error for the calculation
you're doing?
—
Daniel Lyons
http
functions in another thread, which is
what Erlang's processes are like, but your remark piques my curiosity.
Can one be implemented trivially via the other?
—
Daniel Lyons
http://www.storytotell.org -- Tell It!
--~--~-~--~~~---~--~~
You received this message
benefit. It's
easier just to name these kinds of macros with-foo. =)
I think Slime does this with CL. At least I seem to remember having
code with macros that indented differently when the connection was
established.
—
Daniel Lyons
http://www.storytotell.org -- Tell
I recommend Purely Functional Data Structures by Chris Okasaki. If
you can get your hands on OCaml for Scientists it's pretty good too.
And of course The Little Lisper/Schemer. I haven't made it through my
copy of SICP or PAIP.
--
Daniel
On Jun 6, 2009, at 10:26 AM, kyle smith
, but at 29,470
records, you're saving yourself 70,592 * 1000 MD5 calculations by just
starting with this list. Plus this list gives you some auxiliary data
that can't be inferred from the number by itself, like state and
county and the lat/lon coordinates.
Hope that helps,
—
Daniel Lyons
http
Daniel,
I guess I have to ask... why do you need to do this in the first
place? :) Zip codes are already unique. Are you searching through data
where someone else MD5'd some zip codes to obfuscate them? Just curious.
—
Daniel Lyons
http://www.storytotell.org -- Tell
could see.
I am quite curious what the final answer turns out to be but I
couldn't come up with it in the ~20 minutes I spent on it. Let us know
when you figure it out!
—
Daniel Lyons
http://www.storytotell.org -- Tell It!
--~--~-~--~~~---~--~~
You received
hit several
thousand elements or have similarly sized input lists.
—
Daniel Lyons
http://www.storytotell.org -- Tell It!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send
2 is wrong (or
both).
I think your code will get a lot simpler if you find a more
appropriate data structure, such as a two-dimensional array. I find
that cleaner code is also easier to debug, so if I were you I might
start over rather than try to make this work.
Hope that helps,
—
Daniel
/
—
Daniel Lyons
http://www.storytotell.org -- Tell It!
--~--~-~--~~~---~--~~
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
-right I get error when
IF is true. Why is it so? The function chang works on it own...
What parameters are you calling proceed-now-right with?
—
Daniel Lyons
http://www.storytotell.org -- Tell It!
--~--~-~--~~~---~--~~
You received this message because you
application and variable arity functions.
—
Daniel Lyons
http://www.storytotell.org -- Tell It!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure
On May 30, 2009, at 7:25 PM, kinghajj wrote:
On May 30, 1:19 pm, Daniel Lyons fus...@storytotell.org wrote:
You can't have both partial application and variable arity functions.
Uh, yeah you can. Haskell can have variadic functions, like
Text.Printf.printf, and with some explicit type
) your feedback, :)
—
Daniel Lyons
http://www.storytotell.org -- Tell It!
--~--~-~--~~~---~--~~
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
/
This is really great! Thanks for sharing it with us! Cool stuff.
—
Daniel Lyons
http://www.storytotell.org -- Tell It!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Clojure group.
To post to this group, send email to clojure
:0)
[Thrown class clojure.lang.Compiler$CompilerException]
(Of course, if you use = instead of compare, it won't really sort the
list...)
—
Daniel Lyons
http://www.storytotell.org -- Tell It!
--~--~-~--~~~---~--~~
You received this message because you
.
—
Daniel Lyons
http://www.storytotell.org -- Tell It!
--~--~-~--~~~---~--~~
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
this is not an uncommon idiom.
- Korny
--
Kornelis Sietsma korny at my surname dot com
Every jumbled pile of person has a thinking part
that wonders what the part that isn't thinking
isn't thinking of
—
Daniel Lyons
http://www.storytotell.org -- Tell
needing another macro.
—
Daniel Lyons
http://www.storytotell.org -- Tell It!
--~--~-~--~~~---~--~~
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
/clojure/msg/de5246273c08571f
.
Hope this helps,
—
Daniel Lyons
http://www.storytotell.org -- Tell It!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Clojure group.
To post to this group, send email to clojure
seem to work.
—
Daniel Lyons
http://www.storytotell.org -- Tell It!
--~--~-~--~~~---~--~~
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
.
Hope you're enjoying Clojure as much as I am! Cheers,
—
Daniel Lyons
http://www.storytotell.org -- Tell It!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Clojure group.
To post to this group, send email
from Java
(and other JVM languages) and might be closer to what you're having to
do.
—
Daniel Lyons
http://www.storytotell.org -- Tell It!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Clojure group.
To post
On May 21, 2009, at 7:39 PM, CuppoJava wrote:
Hi everyone,
I'm just wondering where the equivalent of the operator is for
Clojure. I need it to do a divide-by-power-of-2 on unsigned bytes.
I could use this too.
—
Daniel Lyons
http://www.storytotell.org -- Tell
. Memoize and delay/force give you most of the other
laziness or pure functional benefits you get in Haskell. (By the way,
strictness annotations do wonders for making sense of Haskell.) Try it
out. I bet you'll find it lots easier.
—
Daniel Lyons
http://www.storytotell.org -- Tell
amount of flexibility
for it. And I doubt that the performance difference has much to do
with laziness or how laziness is implemented in it.
—
Daniel Lyons
http://www.storytotell.org -- Tell It!
--~--~-~--~~~---~--~~
You received this message because you
? It could happen.
—
Daniel Lyons
http://www.storytotell.org -- Tell It!
--~--~-~--~~~---~--~~
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
(remove-comment (first csv-data]
(map #(apply struct entry-struct %) (rest csv-data
—
Daniel Lyons
http://www.storytotell.org -- Tell It!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Clojure group
don't want this one either, because it's so objecty,
but I think it's important to maintain a sense of balance and respect.
All of the CL libraries I tried worked. Getting everything installed
and set up was the pain.
—
Daniel Lyons
http://www.storytotell.org -- Tell
.
—
Daniel Lyons
http://www.storytotell.org -- Tell It!
--~--~-~--~~~---~--~~
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
novel ways of approaching well-known problems
hiding within Clojure right now.
—
Daniel Lyons
http://www.storytotell.org -- Tell It!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Clojure group.
To post
know, I'll add them to the
Clojure
site.
Please supply a primary URL for getting info for your group.
Thanks!
Rich
—
Daniel Lyons
http://www.storytotell.org -- Tell It!
--~--~-~--~~~---~--~~
You received this message because you
anything anyone else is
doing at the moment. I hope you'll keep us abreast of your progress.
It will be enlightening.
—
Daniel Lyons
http://www.storytotell.org -- Tell It!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
94 matches
Mail list logo