Hi,
Am 31.01.2009 um 02:19 schrieb CuppoJava:
(defn new_sprite_engine []
...
(add_sprite (new_cursor_sprite))
...)
So, my code (I think) is pretty well separated in terms of
responsibility. But as it's structured right now, I can't load the
file. Is there an elegant way of going about
Stuart Sierra the.stuart.sie...@gmail.com writes:
On Jan 30, 1:09 pm, Jan Rychter j...@rychter.com wrote:
From what I read, the reasoning is that Clojure provides extremely
general multimethods where you have to define a dispatch function. On
the object side, there is metadata and you can do
David Nolen dnolen.li...@gmail.com writes:
At this point you have to roll your own, I have an experimental thing I plan
on fleshing out temporarily called CLJOS. I've implemented field
inheritance, type inheritance, basic multiple inheritance, basic
introspection. Search the mailing list for
'lo,
Well I just got a very very basic clojure program working from OSGi (Apache
Felix), although its not yet as I'm still seeing some weirdness, but
hopefully I should have something to write about in the morning, anyway, I
had to patch clojure's RT class slightly in order to get it to work:
Daniel,
Last night I updated clj-doc so that it should run without problems:
if you're willing to try it out I'd be willing to fix any problems
that you come up against and let me know about. At this point there
are still rough edges that I want to fix and features that I want to
add (see the
Hi,
Am 31.01.2009 um 12:44 schrieb Jan Rychter:
Phrased differently, I don't understand the utility of StructMaps.
At the moment struct-maps are an optimisation for the
case that you have a lot of maps of the same type.
struct-maps share there key information. No more, no less.
Sincerely
Check out the comment left by Blue Phil. Priceless.
On Jan 31, 6:40 am, Jon Harrop j...@ffconsultancy.com wrote:
Apologies if you've seen this before but I just thought it was absolutely
hillarious:
http://www.3ofcoins.net/2009/01/30/common-lisp-clojure-and-seriousness/
--
Dr Jon Harrop,
Hello,
I'd like to separate dosync and other funcs as follows.
Any comment? Essentially I want to allow more concurrency.
(if true
(do
(dosync (ref-set r1 1))
(non-ref setting fun))
(else-fun))
Instead of
(if true
(dosync
(ref-set r1 1)
(non-ref setting
I'm must be missing something obvious for the [s1 s2] case of union:
Is it only that you've measured (conj s1 s2) to be faster when s2 is
the smallest ?
(defn un
([s1 s2]
(reduce conj s1 s2))
... )
user= (def a #{1 2 3})
user= (def b #{4 5 6 7})
user=
On Jan 30, 2009, at 6:16 PM, Stephen C. Gilardi wrote:
A minor annoyance of mine is that clojure.main exits if there is an
exception in an --init file, even if you ask for a repl. i.e.
+1 in favor of fixing this.
Patch welcome.
Rich
I'm considering implementing a small web app using Compojure. I don't
have much experience with Jetty or any other web server save Apache.
While testing Compojure, I've been using the embedded Jetty API. This
has been convenient for getting up and running quickly. However I
don't like having to
On 31 Jan., 02:44, Daniel Renfer d...@kronkltd.net wrote:
user= (take 0 (lazy-cat [(println 10)] [(println 20)]))
10
nil
What you see here is not an issue with lazy-cat, but rather an issue
with take. The current implementation of take evaluates one more than
the n passed to it.
I don’t
Ok, I take it back. (no pun intended)
I know that this used to be a problem, but looking through my email
history, it appears that the over-eager take was reported by Chouser,
and subsequently fixed by Rhickey.
On Sat, Jan 31, 2009 at 9:47 AM, André Thieme
splendidl...@googlemail.com wrote:
On 31 Jan., 02:47, Jason Wolfe jawo...@berkeley.edu wrote:
I think this behavior is as-intended, although I agree that it is
confusing.
I am worried that you could be right.
That’s why I suggested to modify the doc string of lazy-cat.
In my opinion the real step that needs to be done is to go
I've been playing around with clojure on the android platform. To my
surprise it was pretty easy to get running, after removing the bean
method from the clojure.jar as hinted by Rich somewhere. Of course
clojure code needs to be compiled AOT and eval doesn't work, as was to
be expected, but
Hi,
Am 31.01.2009 um 15:55 schrieb André Thieme:
On 31 Jan., 02:47, Jason Wolfe jawo...@berkeley.edu wrote:
I think this behavior is as-intended, although I agree that it is
confusing.
I am worried that you could be right.
That’s why I suggested to modify the doc string of lazy-cat.
In my
Name: Roland Sadowski (fyuryu on IRC).
Library name: Clojure+Processing
Library home page URL: http://github.com/rosado/clj-processing/tree/master
Category: visualization, graphics, wrapper
License: Common Public License Version 1.0
Dependencies: a recent version of Processing (processing.org)
On Jan 30, 4:00 pm, eyeris drewpvo...@gmail.com wrote:
While testing Compojure, I've been using the embedded Jetty API. This
has been convenient for getting up and running quickly. However I
don't like having to restart my script each time I need to test a
change.
I'd advise moving the code
Hi everyone- I'm a new Clojurist trying to understand how to make use
of Clojure parallelism... I wrote this simple program that calculates
the number of prime numbers in a number range. It is purposely
inefficient:
(defn prime [a]
(not-any? #(integer? (/ a %)) (range 2 a)))
(defn primes [a
Hi everyone- I'm a new Clojurist trying to understand how to make use
of Clojure parallelism... I wrote this simple program that calculates
the number of prime numbers in a number range. It is purposely
inefficient:
(defn prime [a]
(not-any? #(integer? (/ a %)) (range 2 a)))
(defn primes [a
On Jan 31, 11:41 am, Conrad drc...@gmail.com wrote:
Hi everyone- I'm a new Clojurist trying to understand how to make use
of Clojure parallelism... I wrote this simple program that calculates
the number of prime numbers in a number range. It is purposely
inefficient:
(defn prime [a]
I'm must be missing something obvious for the [s1 s2] case of union:
Is it only that you've measured (conj s1 s2) to be faster when s2 is
the smallest ?
Yes, that's it. conj iterates through the second argument, and
since count is O(1) for sets, it makes sense to always iterate through
Iris looks really good. They seem to have put a lot of work into
multiple, efficient evaluation strategies, and various levels of
expressivity versus safety. That kind of work is priceless.
However, I'm not sure if you can built your own predicates in Java
code (and therefore in Clojure code).
On Jan 30, 8:40 pm, Jon Harrop j...@ffconsultancy.com wrote:
Apologies if you've seen this before but I just thought it was absolutely
hillarious:
http://www.3ofcoins.net/2009/01/30/common-lisp-clojure-and-seriousness/
Hey, I have to admit, I was scared when I saw you show up here, but
now I
That seems simple enough. Thanks.
On Jan 31, 10:03 am, James Reeves weavejes...@googlemail.com wrote:
On Jan 31, 3:06 am, Jeffrey Straszheim straszheimjeff...@gmail.com
wrote:
Does anyone know of a gentle introduction to the Zipper stuff, and how
it is used in Clojure?
My understanding
Some naive caching code does speed up my sample by 4 times. Will
investigate further later this week, need to take my flu to bed now..
diff --git a/src/jvm/clojure/lang/Reflector.java
b/src/jvm/clojure/lang/Reflector.java
index f530b78..eccebb8 100644
--- a/src/jvm/clojure/lang/Reflector.java
clj-record
http://github.com/duelinmarkers/clj-record
Author: John Hume
Category: db
License: MIT
Dependencies: clojure-contrib
Inspired by Rails' ActiveRecord, a convenient persistence API with
support for declarative validations, callbacks, and associations.
Yup, that fixed it.
Thanks!
-Conrad
--~--~-~--~~~---~--~~
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
What's the difference between into and clojure.set/union? While their
source code is quite different, they seem to do the same thing to me.
--
R. Mark Volkmann
Object Computing, Inc.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to
Hi all,
I feel like a bloody noob for having to ask this (I've been coding C++
for years but Clojure, Lisp and Java are all new territory for me) but
I'm missing something obvious and basic here and I'm still struggling
with the syntax a bit.
I'm trying to learn clojure by simply translating an
I don't understand this: (def z (zip/zipper rest rest cons t))
Also, it didn't make sense why down arbitrarily brought you to the left
child. Why wouldn't you have to say, down-left?
Thanks.
On Sat, Jan 31, 2009 at 10:03 AM, James Reeves
weavejes...@googlemail.comwrote:
On Jan 31, 3:06 am,
When a function parameter is named coll, does that generally mean it
can be any kind of collection except a map?
For example, the some function takes a predicate function and a
coll, but it can't be a map.
--
R. Mark Volkmann
Object Computing, Inc.
Hmm, that's an interesting question. It looks to me like into could
be implemented exactly like clojure.set/union, e.g., (reduce conj to
from), so I'm not sure why it's written the way it is ... I must be
missing something.
Anyway, I think clojure.set/union is just a special case of into, at
On Sat, Jan 31, 2009 at 8:26 PM, Onorio Catenacci catena...@gmail.com wrote:
Hi all,
I feel like a bloody noob for having to ask this (I've been coding C++
for years but Clojure, Lisp and Java are all new territory for me) but
I'm missing something obvious and basic here and I'm still
;For my own reference--this is an example of a Clojure sequence
comprehension
(for [current-month [months]]
(let [current-sheet (init-sheet current-month)])
)
Two things:
- I think you want (for [current-month months] ...
As-is, this will loop a single time, binding
On Jan 31, 6:42 pm, Mark Volkmann r.mark.volkm...@gmail.com wrote:
When a function parameter is named coll, does that generally mean it
can be any kind of collection except a map?
For example, the some function takes a predicate function and a
coll, but it can't be a map.
I think it means
In Feb 1, 2:32 am, e evier...@gmail.com wrote:
I don't understand this: (def z (zip/zipper rest rest cons t))
From the API docs on zipper:
(zipper branch? children make-node root)
The branch? predicate is rest, because if a node has children, then
rest will not be nil, and therefore true.
On Feb 1, 2:42 am, Mark Volkmann r.mark.volkm...@gmail.com wrote:
When a function parameter is named coll, does that generally mean it
can be any kind of collection except a map?
For example, the some function takes a predicate function and a
coll, but it can't be a map.
I thought all
Hi,
I saw in ants.clj a notation (-).
what is it?
For example,
(defn place [[x y]]
(- world (nth x) (nth y)))
thanks in advance.
-sun
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Clojure group.
To post to
I think it means any class that implements java.util.Collection.
To be precise, I think nil is also always OK.
Sometimes other seq-able things like Java arrays can be passed too,
although I don't think this is ever promised to work (if it doesn't,
you can always explicitly call seq on them
On Jan 31, 7:09 pm, wubbie sunj...@gmail.com wrote:
Hi,
I saw in ants.clj a notation (-).
what is it?
For example,
(defn place [[x y]]
(- world (nth x) (nth y)))
Did you check the docs?
On the website:
http://clojure.org/API#toc21
Within clojure itself:
user (doc -)
Some examples...
; using -
(f1 (f2 (f3 (f4 x
; can be flattened to
(- x f4 f3 f2 f1)
Useful for nested maps...
user= (def m {:one {:a 1 :b 2 :c {:x 10 :y 11}}} )
#'user/m
user= (- m :one :c :x)
10
user= (- x :one :b)
2
On Sun, Feb 1, 2009 at 5:31 AM, Jason Wolfe jawo...@berkeley.edu
On Jan 13, 10:07 am, cliffc cli...@acm.org wrote:
-snip-
5- The debianshootoutresults generally badly mis-represent Java.
Most of them have runtimes that are too small (10sec) to show off the
JIT, and generally don't use any of the features which commonly appear
in large Java programs
Hi,
Am 01.02.2009 um 03:26 schrieb Onorio Catenacci:
(defn init-sheet
#^{:doc Initialize a worksheet with a particular month}
([current-month]
(if debugging (println In init-sheet))
)
)
You don't need #^ to attach the docstring. In fact your version
+1 for this request. I have a question as well, aren't the namespace
bindings stored in one of clojure's concurrency objects? Since the
ability to interact with a running program is one of the features that
sets clojure apart from most other mainstream programming languages,
if more than one
At this point I think maybe a broader more abstract view is in order.
How about watchers for every mutable construct in Clojure?
On Feb 1, 7:12 am, Mark Fredrickson mark.m.fredrick...@gmail.com
wrote:
I know its been discussed before, but I would like to register a
request for a feature:
I've been doing some more research on this. This article seems a good
introduction:
http://www.dcc.uchile.cl/~cgutierr/cursos/FDB/p16-bancilhon.pdf
It turns out the naive implementation (a bottom-up fixed point
iterator) is pretty easy to understand, and would not be hard to
implement --
47 matches
Mail list logo