Hi I'm not certain how to approach this problem the best,
since libraries are compiled class files they are statically linked to the
clojure and c.c version they were compiled with. Please correct me if I'm
wrong. Now also between 1.1 and 1.2 some namespaces changed entirely so some
code had to
On Apr 17, 2010, at 3:50 PM, B Smith-Mannschott wrote:
On Sat, Apr 17, 2010 at 21:32, Stuart Halloway
stuart.hallo...@gmail.com wrote:
It's almost certainly the commit that added the InternalReduce
protocol:
5b281880571573c5917781de932ce4789f18daec.
I am slowly pounding my skull against
When extending a Java class in Clojure, what is a clean way to support
multiple constructors in the base class? Below is a sample of how I
accomplished this. The key point is that the base class has two
constructors and to expose both of these in Clojure I needed to create
two proxies. I used a
Thanks Mark. I updated the Wiki with more information. I also added a
simple bash script so one can use ClojureW on Mac and Linux, which I
often do.
I will add a readme shortly. During the mean time, here is the Wiki
text:
ClojureW makes it dead easy to start with Clojure on Windows, Mac and
Thanks Zmitro for pointing this out. Here is the updated information:
Here are what you need to get started :
1. Download from http://bitbucket.org/kasim/clojurew/get/tip.zip
2. Set CLOJURE_HOME = path/to/unzipped/folder
Note: For Mac and Linux, put these line in your .profile file
On Apr 12, 4:58 pm, Antony Blakey antony.bla...@gmail.com wrote:
I also have a version (1.1.1) of the Enclojure plugin that fixes the
can't-find-clojure-jar when starting a project REPL (which is 100% of the
time with my version of NB). I've sent a pull request to Eric, but in the
meantime
I've implemented something similar for working with
java.nio.ByteBuffer objects to pull apart and build network packets,
but it's not packaged as a separate library right now. Look at
http://github.com/geoffsalmon/bonjure/blob/master/src/bonjure/bytebuffer.clj
specifically the pack, unpack,
Hi,
I am trying to implement memoize myself and have stucked on one place
for a lot of time. This is the code:
(defn mymemoize [func]
(let [dict (ref (hash-map))
inner #((let
[val (@dict %)]
(if (nil? val)
(do (dosync (alter
On Apr 18, 2010, at 9:21 AM, Yonov wrote:
Hi,
I am trying to implement memoize myself and have stucked on one place
for a lot of time. This is the code:
(defn mymemoize [func]
(let [dict (ref (hash-map))
inner #((let
[val (@dict %)]
(if
On Apr 16, 2010, at 2:06 AM, Brian Watkins wrote:
Is there a way to interrupt the Repl when I've set to some kind of
infinite loop without also shutting down the JVM entirely?
Yes there is. clojure-contrib includes add-break-thread! to do just that.
Here's an example:
% java -cp
Thanks Andrew.
I did catch 'this' argument requirement sometime back but the 'new' bit
escaped me.
Praki
On Sat, Apr 17, 2010 at 6:16 PM, Andrew Stein steinl...@gmail.com wrote:
(deftype Bar [a b c d e])
(def b (new Bar 1 2 3 4 5))
There are a few other syntax changes too, defrecord
Hi, I've been having lots of fun in the past months working in Clojure
only on my own time and wonder if there's opportunities to be paid for
it. Our community is growing everyday and I've heard that Clojure is
being more and more used in the real world. So, is there any job
opening for us
Hello!
I normally lurk on lists a bit before introducing myself (if I ever
introduce myself), but I just wanted to say hello; especially since it
tends to take a little bit to ascertain the norms on any given list,
but what the heck, eh?
I saw Aaron Bedra's presentation on Clojure at the
Thanks, a lot!
It seems that there is no nice way to make a shortened lambda function
which returns an integer.
I mean #(1) is not OK, and #1 is not OK. Although there is no problem
with this (fn [] 1).
On Apr 18, 5:48 pm, Stephen C. Gilardi squee...@mac.com wrote:
On Apr 18, 2010, at 9:21 AM,
Hi Stuart,
I would like to help as well. Just signed up for Clojure Dev and an
Assembla account. I'll send in my CA tomorrow.
id: danielglauser
Thanks,
Daniel
On Apr 15, 1:10 pm, Stuart Halloway stuart.hallo...@gmail.com wrote:
You are added. Thanks!
I'll take a stab at it. Can you
you can do #(identity 1)
2010/4/18 Yonov myo...@gmail.com
Thanks, a lot!
It seems that there is no nice way to make a shortened lambda function
which returns an integer.
I mean #(1) is not OK, and #1 is not OK. Although there is no problem
with this (fn [] 1).
On Apr 18, 5:48 pm, Stephen
Now I took a look at your code =x, i think you can let it work using #(let
instead of #((let
2010/4/18 Joop Kiefte iko...@gmail.com
you can do #(identity 1)
2010/4/18 Yonov myo...@gmail.com
Thanks, a lot!
It seems that there is no nice way to make a shortened lambda function
which returns
If you want to maintain backwards compatibility with 1.1, there are a few
gotchas:
* don't use 1.2-specific features like deftype, obviously.
* don't aot-compile anything. If you need gen-class *and* 1.1, you can
clearly document which nses need it and require your users to perform the
For deeftype, has the syntax for field accessors changed too?
I can't get it to work:
user (deftype someType [b f])
user.someType
user (def y (new someType 2 3))
#'user/y
user (:b y)
nil
user (:f y)
nil
defrecord works as expected, though.
On Apr 17, 6:16 pm, Andrew Stein steinl...@gmail.com
On Sun, Apr 18, 2010 at 1:49 PM, Rob Lachlan robertlach...@gmail.comwrote:
For deeftype, has the syntax for field accessors changed too?
I can't get it to work:
user (deftype someType [b f])
user.someType
user (def y (new someType 2 3))
#'user/y
user (:b y)
nil
user (:f y)
nil
Welcome aboard!
On Apr 18, 10:54 am, llcawthorne llcawtho...@archlinux.us wrote:
Hello!
I normally lurk on lists a bit before introducing myself (if I ever
introduce myself), but I just wanted to say hello; especially since it
tends to take a little bit to ascertain the norms on any given
My sense from the changes is that defrecord is the map-like one,
whereas deftype is the lower-level construct used to implement stuff
like clojure collections. I imagine users will use defrecord more
often than deftype.
On Apr 18, 10:49 am, Rob Lachlan robertlach...@gmail.com wrote:
For
On 18 Apr., 01:51, David McNeil mcneil.da...@gmail.com wrote:
My question is: is there a better way to accomplish this, perhaps
using a mechanism other than proxy?
You can do that with gen-class:
http://richhickey.github.com/clojure/clojure.core-api.html#clojure.core/gen-class.
... By
On 18 April 2010 19:36, Joop Kiefte iko...@gmail.com wrote:
you can do #(identity 1)
Or #(do 1).
2010/4/18 Yonov myo...@gmail.com
Thanks, a lot!
It seems that there is no nice way to make a shortened lambda function
which returns an integer.
I mean #(1) is not OK, and #1 is not OK.
Hi,
On Sun, Apr 18, 2010 at 07:36:23PM +0200, Joop Kiefte wrote:
you can do #(identity 1)
As well as #(do 1). The core function constantly works the same and
conveys the intention as well: (constantly 1).
Sincerely
Meikel
--
You received this message because you are subscribed to the Google
Since you are really interested in both Clojure and statistics, might
I recommend two RSS feeds:
* The Incanter RSS feed -- you might already have this but just in
case. @liebke pays close attention to documentation in Incanter and as
well as comments to the blog.
http://incanter-blog.org/feed/
That was my interpretation as well. I now have defrecord instead of deftype
everywhere. It looks like deftype was refactored into deftype and defrecord.
deftype implements none of the usual interfaces (IPersistentMap) whereas
defrecord does.
Praki
On Sun, Apr 18, 2010 at 11:33 AM, ataggart
I have two problems with the following code.
First, I have this `tos' business (to-string) because:
user= (first abc)
\a
user= (rest abc)
(\b \c)
Since I wanted to get strings out of strings, a character or a
collection is no good.
Second, I ended-up having to use a mutable atom `res' because I
Posted too quickly ... replace ana3 with anagram. I cleaned-up the
code before posting, forgetting that the previous version ana3 was
still in the REPL ... Oh well ...
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to
On Sun, Apr 18, 2010 at 9:20 PM, verec
jeanfrancois.brouil...@googlemail.com wrote:
I have two problems with the following code.
First, I have this `tos' business (to-string) because:
user= (first abc)
\a
user= (rest abc)
(\b \c)
Since I wanted to get strings out of strings, a character
(use 'clojure.contrib.combinatorics
'clojure.contrib.str-utils)
(defn anagrams [xs]
(map #(str-join %) (distinct (permutations xs
Of course, the real meat is in the permutations function. The
implementation in the combinatorics library is a bit complicated.
Here's something simpler
On 19 April 2010 02:59, Nicolas Buduroi nbudu...@gmail.com wrote:
Hi, I've been having lots of fun in the past months working in Clojure
only on my own time and wonder if there's opportunities to be paid for
it. Our community is growing everyday and I've heard that Clojure is
being more and
Well, network packets would also be a good use of what I was looking
for and it looks *very* much like something useful for what I want.
I'll clone it and try it in the next few days. My intention is to use
it for some low-level structures inside virtual disk files...
I haven't done anything
Hi,
I am trying to understand clojure and found a couple of interesting
things about the core library:
1. core.clj is a gigantic library with more than 400 function
definitions (378 defns and 62 defmacros to be exact). I didn't expect
to find sequence related functions, such as map/reduce in
Something like the 'for' macro (if it is thought of as a non-general
monad) can be implemented in terms of reduce. Is there a reason
this isn't so?
I can think of two:
* filter and map are lazy. Implementing every? and some? in those
terms would needlessly introduce lazy sequences to the
On Mon, Apr 19, 2010 at 10:30 AM, falcon shahb...@gmail.com wrote:
1. core.clj is a gigantic library with more than 400 function
definitions (378 defns and 62 defmacros to be exact). I didn't expect
to find sequence related functions, such as map/reduce in core.
Doesn't it make sense to move
How about this:
Symbols in namespaces are optionally organized into groups. The
vehicle might be something as simple as a :group metadata entry on the
symbols. When symbols from other namespaces are referred, new local
copies are created with :group metadata equal to the namespace name.
When
As I understand it, map is, itself, lazy. Does that mean that using
map to implement these methods would create extra intermediate
structures?
What if often used functions such as map/reduce/filter were macros,
that could 'deforest' (to use Haskell terminology) these intermediate
structures?
On Mon, Apr 19, 2010 at 12:15 PM, falcon shahb...@gmail.com wrote:
As I understand it, map is, itself, lazy. Does that mean that using
map to implement these methods would create extra intermediate
structures?
Yes.
What if often used functions such as map/reduce/filter were macros,
that
Hi phil,
thanks for the answer many good points there. So just to be sure, if I don't
add a :gen-class (which I don't need to in my case) I can use the lib with both
1.1 and 1.2 w/o problems (save for the named ones) so the lein jar jar's are
not 'statically linked' (if you can call it that
Welcome llcawthorne!
Glad to have you here :) also as a advice :visit the IRC channel #clojure (on
freenode) since the community there is incredible :)
Regards,
Heinz
On Apr 18, 2010, at 16:54 , llcawthorne wrote:
Hello!
I normally lurk on lists a bit before introducing myself (if I ever
41 matches
Mail list logo