Hi,
On Jul 24, 7:56 am, Laurent PETIT laurent.pe...@gmail.com wrote:
Here is an example from clojure-contrib where Chouser uses explicit use of
:arglists to fine-tune the public API signature of macro deferror:
Note, that this is also useful for multimethods, since they don't have
an
2009/7/22 Meikel Brandmeyer m...@kotka.de:
Hi,
Am 22.07.2009 um 18:42 schrieb Paul Mooser:
Is it safe to assume that you can extract the key ordering from the
literal map the user specified ? Or am I misunderstanding ?
Up to eight elements in a literal map are stored
as array-map. An
On Jul 21, 5:51 am, Jan Rychter j...@rychter.com wrote:
Is there a way to get the size of a data structure in Clojure?
I've been wondering how much more space-efficient vectors are than
lists, but I don't know how to measure it.
Stuart Sierra the.stuart.sie...@gmail.com writes:
Short
On Jul 24, 12:23 am, Jeremy Gailor jer...@infinitecube.com wrote:
Hi David,
I would say that this is a problem in any programming language that makes
use of an external library. If the public API of a library changes, you're
going
to need to update the code that acts as a consumer of that
Hello,
I've been reading this list for a while. Suppose it's time to delurk. :-)
On Thu, Jul 23, 2009 at 10:58 AM, pcda...@gmail.com pcda...@gmail.comwrote:
The kind of scenario I'm worrying about is this:
- Alice writes library foo and use a particular way to encode values
(say simple
On Jul 23, 10:15 pm, Richard Newman holyg...@gmail.com wrote:
Coming from an OO background which puts a strong focus on data
encapsulation,
this makes me a little nervous.
The same problem exists with OO.
Not to the same extent, unless you expose all the internals of your
classes
Up to eight elements in a literal map are stored
as array-map. An array-map keeps the key ordering.
For more elements the map becomes a hash-map,
which does not keep the key ordering.
I assume that's an implementation detail that one could not rely on,
though, right?
Yeah, I guess
Sometimes (or maybe always?) it is mentioned in the doc. In my
opinion, this is one of the cases where dynamic languages do not
excel. If we had typing, that would be solved by implementing Lazy
interface.
Or maybe this is an use case for metadata? Each function could have a
tag :lazy? with
On Fri, Jul 24, 2009 at 5:04 AM, Jan Rychterj...@rychter.com wrote:
On Jul 21, 5:51 am, Jan Rychter j...@rychter.com wrote:
Is there a way to get the size of a data structure in Clojure?
I've been wondering how much more space-efficient vectors are than
lists, but I don't know how to
Hi,
2009/7/24 pcda...@gmail.com pcda...@gmail.com
On Jul 23, 10:15 pm, Richard Newman holyg...@gmail.com wrote:
Coming from an OO background which puts a strong focus on data
encapsulation,
this makes me a little nervous.
The same problem exists with OO.
Not to the same extent,
Hi,
On Jul 24, 2:03 pm, Laurent PETIT laurent.pe...@gmail.com wrote:
But you should consider that everything you cannot find in the (doc) of
functions is not public API.
+1
And if you don't care for docstrings... Well. It's your software which
blows up, not mine. If there is something
Hi,
Everything returning a seq is lazy: take, drop, iterate, map, ...
Everything (maybe) returning something else is not: reduce, loop, ...
Not 100% accurate, but this heuristic should get you very far.
Sincerely
Meikel
--~--~-~--~~~---~--~~
You received this
On Jul 24, 6:17 am, Dragan Djuric draga...@gmail.com wrote:
Sometimes (or maybe always?) it is mentioned in the doc. In my
opinion, this is one of the cases where dynamic languages do not
excel. If we had typing, that would be solved by implementing Lazy
interface.
We do have types and we do
I am a very new clojure user but I believe I have found a bug when
using the clojure.contrib.duck-streams library.
My attempt to stream process a very big file blows up with
java.lang.OutOfMemoryError: Java heap space.
I can reproduce the problem with the following simple code which I
think
On Jul 24, 10:30 am, Deklan diete...@gmail.com wrote:
I have scoured the online documentation for instructions on how to
compile clojure source files from the command line.
It's not often used, but you can run the class clojure.lang.Compile.
You have to set the Java system property
I'm afraid I can't reproduce this error, Alexander. I can run
(write-lines /tmp/out (line-seq (reader /tmp/bigfile)))
on a 4.5 GB file with no problem, and I don't have that much memory.
Out-of-memory errors like this usually occur when your code is
holding on to the head of the sequence.
FWIW (i.e. IMO the previous two functional solutions are better
examples) here is a more imperative style solution done sort of to
prove to myself that I could do such a thing in Clojure w/o too much
(arguable) fanfare. Maybe it will be interesting to others who are
learning Clojure too
(defn
I should admit that there may be something else I'm missing here.
write-lines is not a lazy sequence function, so it may be responsible
for holding the head of the sequence. I can't reproduce the error,
though.
-SS
On Jul 24, 11:29 am, Stuart Sierra the.stuart.sie...@gmail.com
wrote:
I'm
Is there an automatic way to discover such error? These types of
errors could be discovered by the compiler. How am I going to see if I
get an ISeq in my clojure code? I would have to dig...
On Jul 24, 3:37 pm, eyeris drewpvo...@gmail.com wrote:
On Jul 24, 6:17 am, Dragan Djuric
Are there ways to override functions so that if you have different
parameters, you get different logic?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to
yes there is a way: http://clojure.org/multimethods
On Fri, Jul 24, 2009 at 11:44 AM, BerlinBrownberlin.br...@gmail.com wrote:
Are there ways to override functions so that if you have different
parameters, you get different logic?
--
And what is good, Phaedrus,
And what is not good—
I'm pretty familiar with scheme programming, so functional programming isn't
new to me, but I rarely turn to it for solving problems during my day to day
work. In learning Clojure, I've been going through problems on project
euler, and one question I have is that while it's straigh-forward to
yes there is a way: http://clojure.org/multimethods
And also plain ol' arity overriding:
(defn foo
Do something.
([x] (println x))
([x y] (println (+ x y
For something similar to Java, where a particular method is selected
purely on the type of the arguments, a multimethod
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
Passing a collection to a function that expects a lazy seq is not
always an error. The seq library encourages it by calling (seq) on
those collections for you. I suppose all lazy functions could emit a
warning when they have to call (seq) on their arguments, based on some
global variable like
Hi
Are there any fundamental reasons why the Keyword class shouldn't be
serializable? I've been playing around with Clojure and Wicket and
it's not possible to use maps containing Keywords in Wicket page
classes. Wicket pages are serialized and stored in the session
between requests and this
Laurent PETIT laurent.pe...@gmail.com writes:
2009/7/24 pcda...@gmail.com pcda...@gmail.com
On Jul 23, 10:15 pm, Richard Newman holyg...@gmail.com wrote:
Coming from an OO background which puts a strong focus on data
encapsulation,
this makes me a little nervous.
Well, that's what I am talking about. It can be controlled, but it
requires good grasp of all the concepts and high concentration + there
is still a chance to miss something. Now it may not be such a problem
since the majority of people who use clojure are usually highly
motivated enthusiasts,
28 matches
Mail list logo