Here you can peek at the source code of clojure.
http://code.google.com/p/clojure/source/browse/trunk/src/clj/clojure/core.clj
It is about 3700 lines, and although you have to get used to a few new
functions and names that are normally not exposed when you use
clojure, it looks fairly simple.
Do you suggest that I read Programming Clojure first and then trying
to study the source code?
What is the best place (file, package or what ever) to start reading
the source code?
On Jan 13, 10:01 am, bOR_ boris.sch...@gmail.com wrote:
Here you can peek at the source code of clojure.
On Jan 13, 2:59 pm, Chouser chou...@gmail.com wrote:
It raises a question, though -- how much functionality should a
function provide to be worth making everyone who reads the code learn
the new vocabulary? I've written each of these inline when I've
needed them. Are they better as idioms
seq returns nil when a collection has no items. According to the
documentation for empty?, empty? is the same as (not (seq coll)) so you
should use seq for expressing the opposite of empty?
On Tue, Jan 13, 2009 at 3:12 AM, GS gsincl...@gmail.com wrote:
On Jan 13, 2:59 pm, Chouser
Not sure what you want to achieve by studying the source code. I think
the answer that I can give to what works best for you will depend on
what you want to study the source code for.
I'm also not sure what you mean by 'what is the best place to start
reading..' The link that I gave before is a
For posterity: got it working! Here is how (just ignore all the gene
amino window size like words, they are specific for my code)
(add-classpath file:///linuxhome/tmp/boris/automaton.jar)
(import '(brics.automaton.RegExp))
(import '(brics.automaton.Automaton))
(import
On 13.01.2009, at 05:35, Mark P wrote:
I know that there are other functional approaches where
the compiler automatically finds ways to parallelize. Is there
much scope for this in Clojure? Or is it all pretty much
manually added concurrency?
I am not aware of any auto-parallelizing
Not sure what you want to achieve by studying the source code. I think
the answer that I can give to what works best for you will depend on
what you want to study the source code for.
I want to be familiar with a language design in general and how it
integrates with Java Platform.
I'm also not
Thanks for the answer. I think you'll need a reply from Chouser or
Rich (or someone alike) when they wake up. The best I can give you is
this part of the source, where (I think) it is defined how clojure is
build upon java.
Hi,
I searched the archives and saw that this has been raised once before,
although it wasn't really a suggestion, didn't raise any real
discussion and didn't reach any conclusion.
I just think it's worth proposing that a function set that includes
every? and not-every? but does not include
I've added some info regarding the backquote expansion mechanism in
the Reader section here:
http://en.wikibooks.org/wiki/Learning_Clojure#The_Reader
I tried to answer the author's question regarding the possible
expansion order in nested backquotes and the general algorithm Clojure
apparently
For what's it worth, I think the Programming Clojure book is
excellent (Okay Stuart, make the check payable to ). My only
complaint is that the I wish there were another largish example
besides the two in there (mc simulation and the lancelet thing).
Cheers, Aria
On Jan 13, 12:58 am, bOR_
And I would like to kindly ask from Mr. Stu to make the new book as
extensive as possible (just like Programming Ruby book) and we will
have a title like The pickaxe book :)
On Jan 13, 12:38 pm, aria42 ari...@gmail.com wrote:
For what's it worth, I think the Programming Clojure book is
This looks really cool. I've actually been experimenting with exactly
the same thing. One thing I thought about (but didn't implement), was
using some kind of lazy hash map, for the request, so that it only
calls the methods (like getServerPort) if you need them. I don't
really know how hard or
On Jan 13, 5:49 pm, Zak Wilson zak.wil...@gmail.com wrote:
You're probably thinking of
this:http://www.flownet.com/gat/papers/lisp-java.pdf
Thanks for the link.
There's also the (in)famous language benchmark
site:http://shootout.alioth.debian.org/
This is primarily what I was going on. I
On Tue, Jan 13, 2009 at 3:03 AM, GS gsincl...@gmail.com wrote:
Hi,
I searched the archives and saw that this has been raised once before,
although it wasn't really a suggestion, didn't raise any real
discussion and didn't reach any conclusion.
I just think it's worth proposing that a
A macro cannot depend on runtime information. A macro is a function
that is called at compile time, its argument is an expression (as
written by the programmer, or as returned by another macro), and its
result is a modified expression. There is no way a macro could access
runtime
On Tue, Jan 13, 2009 at 3:12 AM, GS gsincl...@gmail.com wrote:
Should that seq be seq?. If not, why not?
Nick nailed that one.
The general question it raises for _me_ is this: why is such a basic,
useful and generally applicable function like 'chunk not included in
the core? Or
I've written small wiki article which dives right into the look and
meaning of common Clojure constructs with examples. Personally I find
I learn best by examples and when starting out they were hard to find,
whereas formal descriptions were there but rather cryptic when you
don't understand the
On Tue, Jan 13, 2009 at 7:46 AM, Mark Volkmann
r.mark.volkm...@gmail.com wrote:
On Tue, Jan 13, 2009 at 3:03 AM, GS gsincl...@gmail.com wrote:
or none?
Hmm ... I'm not sure if an equivalent for that exists.
user= (doc not-any?)
-
clojure.core/not-any?
([pred coll])
On Jan 13, 7:38 am, Luc Prefontaine lprefonta...@softaddicts.ca
wrote:
as of yesterday pm, Clojure is running in a live system in a big
veterinarian hospital.
Awesome, congratulations!!! :-D
mfh
--~--~-~--~~~---~--~~
You received this message because you are
I still find this confusing, but thanks for the quick response.
In general, you should use uniform types for hash keys.
I thought I was using all ints, but it turns out that a java API
returned a long when I thought it returned an int. So then my map had
some keys that were ints and some that
Hi,
After (are-friends bill bob) they should be friends,
so I tried @bob
and don't see bill as a friend. why?
@bob
{:friends #{#Ref clojure.lang@165ab39}, :name Bob}
-sun
On Jan 10, 9:44 pm, Stuart Sierra the.stuart.sie...@gmail.com wrote:
Hi Patrick,
Here's one way to do it:
2009/1/13 Luc Prefontaine lprefonta...@softaddicts.ca
Hi everyone,
as of yesterday pm, Clojure is running in a live system in a big
veterinarian hospital.
Congratulations, its always a real buzz to get something out and running in
the wild, building it on something really new like Clojure
On Jan 11, 9:41 pm, Mark P pierh...@gmail.com wrote:
The programs I write perform applied mathematical
optimization (using mainly integer arithmetic)
and often take hours (occasionally even days)
to run. So even small percentage improvements
in execution speed can make a significant
http://blog.thinkrelevance.com/2009/1/13/programming-clojure-beta-5-is-out
Cheers,
Stu
--~--~-~--~~~---~--~~
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
On Tue, Jan 13, 2009 at 3:04 AM, HB hubaghd...@gmail.com wrote:
Do you suggest that I read Programming Clojure first and then trying
to study the source code?
That's a fine option. The book may be a shorter path to *practical*
knowledge.
What is the best place (file, package or what ever)
sure . . . I'm just impressed with how many things just work, and this
could be one more. Not enough args, but you know what I wanted it to mean.
There's no ambiguity.
On Tue, Jan 13, 2009 at 2:07 AM, Timothy Pratley
timothyprat...@gmail.comwrote:
On Jan 13, 5:57 pm, e evier...@gmail.com
Hi Aria,
Today's drop of the book has two new mediumish examples:
* a Compojure web app for that uses clojure.contrib.sql for its
backing store
* the Clojure snake we have been beating to death on the list
Let me know you think this is a decent stable of examples. I'm still
contemplating
As this is a commercial project, I imagine you are quite limited in
what you can tell us, but I'd love to hear about the issues you faced
during development.
On Jan 13, 10:38 am, Luc Prefontaine lprefonta...@softaddicts.ca
wrote:
Hi everyone,
as of yesterday pm, Clojure is running in a live
On Tue, Jan 13, 2009 at 2:18 AM, Timothy Pratley
timothyprat...@gmail.com wrote:
BTW Rich,
The documentation http://clojure.org/data_structures hints that
accessors are faster than regular map lookups and provides the
following example:
(reduce (fn [n y] (+ n (:fred y))) 0 x)
-
On Tue, Jan 13, 2009 at 2:23 PM, CuppoJava patrickli_2...@hotmail.com wrote:
Do struct-maps also have boxing and unboxing overhead? Or does the JVM
optimize that away?
Clojure collections currently store Objects, so they'll be boxed.
To store primitive values I think you'll have to use a
Hi sampii,
The problem, as I see it ( as Konrad suggested above), is that you're
not passing *functions* to (alt); you're passing values returned from
function calls, even though in the case of the sub-functions you
define those returned values are functions. Functions evaluate to
themselves, so
Hi Kees-Jochem,
Am 13.01.2009 um 12:41 schrieb Kees-Jochem Wehrmeijer:
This looks really cool. I've actually been experimenting with exactly
the same thing. One thing I thought about (but didn't implement), was
using some kind of lazy hash map, for the request, so that it only
calls the
Do struct-maps also have boxing and unboxing overhead? Or does the JVM
optimize that away?
--~--~-~--~~~---~--~~
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
Why is Clojure slower than Java? And, can it be fixed? Is it just the
dynamic lookups?
I also want to use Clojure in my work to implement the inner loops, but
I was disappointed by a previous discussion looking at the speed of
Clojure. As I recall Clojure seems to be about 1/4 the speed of
On Jan 13, 10:07 am, cliffc cli...@acm.org wrote:
Some comments:
1- If you think that HotSpot/Java is slower than C++ by any
interesting amount, I'd love to see the test case. Being the
architect of HotSpot -server I've a keen interest in where
performance isn't on par with C.
-snip-
On Jan 13, 4:45 am, Mark McGranaghan mmcgr...@gmail.com wrote:
In terms of Clojure web frameworks, I think that there is a lot to be
gained by leveraging the Ring interface, especially from the modular
functionality provided by Ring middleware. I'd like in particular to
be able to run
On Tue, Jan 13, 2009 at 4:05 PM, Jason Wolfe jawo...@berkeley.edu wrote:
It raises a question, though -- how much functionality should a
function provide to be worth making everyone who reads the code learn
the new vocabulary? I've written each of these inline when I've
needed them. Are
I've got Clojure profiling working fairly easily using the free pre-
release build of YourKit [1], and it's already been a big help in
speeding up my application (I'll post on my blog about this soon).
The main difficulty has been figuring out which functions are which in
the output, since the
On Jan 13, 6:45 pm, e evier...@gmail.com wrote:
sure . . . I'm just impressed with how many things just work, and this
could be one more. Not enough args, but you know what I wanted it to mean.
There's no ambiguity.
This is a bad idea. It just adds confusion with no real benefit.
Reading the
Hello everybody,
this patch implements a pipe-delimited syntax for symbols. The Reader
parses |this symbol| and one symbol. Symbols containing clojure syntax
are printed in this form, so they can be printed and read in again.
example: (.toString (symbol ())) = |()|
What do you think?
Robert
Hi James,
Thanks for taking the time to check out Ring.
The HttpServlet API provides methods for
parameters, cookies and sessions, but these are absent from Ring. I
notice that in your weld framework, you implement these pieces of
functionality in Clojure, but why? I can understand keeping
On Jan 13, 4:30 am, Mark P pierh...@gmail.com wrote:
On Jan 13, 5:49 pm, Zak Wilson zak.wil...@gmail.com wrote:
You're probably thinking of
this:http://www.flownet.com/gat/papers/lisp-java.pdf
Thanks for the link.
There's also the (in)famous language benchmark
On Tue, 2009-01-13 at 10:56 -0800, Vincent Foley wrote:
As this is a commercial project, I imagine you are quite limited in
what you can tell us, but I'd love to hear about the issues you faced
during development.
Mostly integration problems with the work flow in the radiology system.
That
On Jan 13, 1:42 pm, Chouser chou...@gmail.com wrote:
One of the things I found difficult with CL was the extremely large
number of builtin functions -- a large vocabulary with subtle
differences between nearly synonymous-sounding words. It meant that
at first glance, a particular block of
On Jan 13, 4:41 am, Eric Lavigne lavigne.e...@gmail.com wrote:
There's also the (in)famous language benchmark
site:http://shootout.alioth.debian.org/
This is primarily what I was going on. I realize no
benchmarking approach is going to be perfect, but
this attempt doesn't seem too
With repeated runs, and my cpu frequency set to not change, I get very
little speed improvement. I increased the size of the example range
times 10 for these runs:
For me there is a very clear speed improvement of at least 40%, doing
quite a lot of repeated runs. I can't run with range times
user= (defstruct desilu :fred :ricky)
#'user/desilu
user= (def x (map (fn [n]
(struct-map desilu
:fred n
:ricky 2
:lucy 3
:ethel 4))
(range 100)))
#'user/x
user= (time (reduce (fn [n y] (+ n (:fred
Thank you for the explanation; I understand it a lot better now. The
reason that I decided to use Delays was that I thought I would need to
change less. Now that I've actually changed everything to Delays, it
seems that they take much more time (the opposite of what I was trying
to do :(. But
;; I defined my own access method so that an accessor is not required,
;; however then you need to type hint which makes it too clumsy
;; performs very similar to an accessor, in theory slightly faster
Actually there is a very simple way to make by index quite usable
without user type hints:
Did you ever get around to posting the notes on getting the IntelliJ
plugin to work? I sorely would love IDE support for Clojure in either
Eclipse or IntelliJ. Is the IntelliJ one in a usable state, or is it
not ready for some alpha-level testers?
Cheers, Aria
On Dec 29 2008, 10:36 am, Justin
It seems to me that Ring's approach works well if there's the
possibility of implementing Ring using technology other than Servlets.
In this case, it makes sense for Ring to act as a minimum common
interface. But if this isn't your goal, then you're just removing
functionality for aesthetic
Hi Chouser list,
I like clojure.contrib.command-line -- thanks for it! -- but I wanted
to be able to specify multiple forms for an option, e.g. --help, -h,
-?, etc. Here (in the Files section)
http://bit.ly/fIVH
is a patch to enable it (the values are bound only to the first form
given --
On Jan 12, 10:21 am, Stuart Sierra the.stuart.sie...@gmail.com
wrote:
If you have
highly-optimized, custom-designed numerical algorithms written in a
low-level language like C++, you will never be able to write a version
that is equally fast in a dynamic, virtual-machine language.
I wouldn't
Well, I've gone ahead and finally bought it. Here I thought I would
have time to read a fiction novel or something :)
On Jan 13, 12:02 pm, Stuart Halloway stuart.hallo...@gmail.com
wrote:
http://blog.thinkrelevance.com/2009/1/13/programming-clojure-beta-5-i...
Cheers,
Stu
On Jan 14, 12:35 am, Mark McGranaghan mmcgr...@gmail.com wrote:
For Ring, the HttpServlet API is a means to an end, not an end in
itself. The interface that Servlets present for parameter parsing and
session handling are too flawed to merit their inclusion as default
choices for Ring apps and
On Dec 5 2008, Luc Prefontaine wrote:
I feel we will start before Xmas to put together a prototype.
I really want this to come to life because we could use cooperative
Clojure instances on our bus. This would also
provide us another form of persistance. Presently we rely on ActiveMq
queues
On Jan 14, 9:07 am, Luc Prefontaine lprefonta...@softaddicts.ca
wrote:
As this is a commercial project, I imagine you are quite limited in
what you can tell us, but I'd love to hear about the issues you faced
during development.
Mostly integration problems with the work flow in the
Aha! I notice that this problem goes away if I run the JVM the way
I'm supposed to (with -cp lucene-core.xxx.jar) instead of using (add-
classpath ...) to load the jar in the first place. This probably
isn't a big deal, then :o)
Thanks,
Mark
On Jan 13, 11:06 am, Mark Triggs
On Jan 13, 4:42 pm, Chouser chou...@gmail.com wrote:
One of the things I found difficult with CL was the extremely large
number of builtin functions -- a large vocabulary with subtle
differences between nearly synonymous-sounding words.
I've had the same experience with Common Lisp code.
On Jan 13, 11:18 am, Allen Rohner aroh...@gmail.com wrote:
I thought I was using all ints, but it turns out that a java API
returned a long when I thought it returned an int.
FYI, You can coerce to specific types with the functions int, long,
short, etc. You could use that when creating your
It might be nice if there were a function that automatically converted
the number to the type that Clojure uses for that number if typed in
as a literal.
On Tue, Jan 13, 2009 at 7:27 PM, Stuart Sierra
the.stuart.sie...@gmail.com wrote:
FYI, You can coerce to specific types with the functions
ok ok. . . .but yall made lists functions . .. so I could ask the same
question of
if foo(3): bar(3). if foo a function or a list? It looks like a function.
but it's a list, too. . . .because in clojure lists are functions . . . .but
only if they take one argument. I didn't start the
i know that will be awesome for me. I just wish clojure.org was the only
place I had to go to get stuff like that. Why not wikify it all there?
On Tue, Jan 13, 2009 at 9:12 PM, GS gsincl...@gmail.com wrote:
On Jan 14, 1:12 am, Timothy Pratley timothyprat...@gmail.com wrote:
I've written
I humbly propose that folks shouldn't complain about Clojure being
slow for their apps until they have at least one of the following:
1. A targeted benchmark for an important bottleneck in their
application, implemented in both Clojure and the current
implementation language, with performance
I've checked in updates to clojure.contrib.sql. The theme is providing
update and delete functions and a move to pervasive support of
parameterization in queries and selection criteria. Please see the doc
strings for detailed changes.
Here's a summary of the changes:
sql.clj
- Add
On Jan 14, 2:27 pm, Mark Engelberg mark.engelb...@gmail.com wrote:
I also find the choice of some/not-any? as opposites to be hard to
remember. I'd rather it be some/not-some? or any/not-any?
I think some and any? both have their place.
(let [foo (some prime? numseq)]
(do something with
On Jan 12, 2009, at 4:57 PM, Greg Harman wrote:
I couldn't figure out how to do this with the included functions/
macros in clojure.contrib.sql so I massaged with-results and do-
prepared together to get this macro (with supporting fn), which seems
to work. Useful addition for contrib.sql?
(defn chunk Lazily break s into chunks of length n (or less, for the
final chunk).
[n s]
(when (seq s)
(lazy-cons (take n s)
(chunk n (drop n s)
Should that seq be seq?. If not, why not?
On Jan 13, 7:17 pm, Nick Vogel voge...@gmail.com wrote:
seq
On Jan 11, 2009, at 10:42 AM, Stephen C. Gilardi wrote:
I'd like to include something like this in clojure.contrib.sql. That
will go smoothest if I can base it directly on what you've written
and that's only possible if you send in a contributor agreement.
Would you please send one in?
define directly I clicked on clojure.org. I don't see the link. I
stared at the page for a good 30 seconds. I don't see a links section. .
. . maybe it's there and I'm bad at reading. Ah it's inline in the getting
started dialog. In my opinion, that wiki link ought to be prominently
. . . that person being me if it wasn't clear :)
On Wed, Jan 14, 2009 at 12:35 AM, e evier...@gmail.com wrote:
define directly I clicked on clojure.org. I don't see the link. I
stared at the page for a good 30 seconds. I don't see a links section. .
. . maybe it's there and I'm bad at
Perhaps this thread is dead, but have you looked at CUDA?
A modern GPU has around 100 times the FPU firepower compared to a
modern core duo. Whether you can structure your algorithm to suite
the hardware is another question and I could help you with that. CUDA
isn't as strong on integer but
It's in the upper right hand corner of the main page. The stuff on the left
seems to be about the language itself, while the links in the upper right
reference the various external sources. I'm the kind of person who explores
every nook and cranny of a webpage though so I can't speak for how
75 matches
Mail list logo