On Feb 6, 7:14 pm, Korny Sietsma wrote:
> Hi folks - I was trying the example posted below, and I discovered a
> slight snag - unchecked-* methods don't exist for doubles or floats!
> (and if you call (unchecked-multiply 1.2 3.4) you get "No matching
> method found"... which caused some confusion
On Feb 6, 4:19 pm, mikel wrote:
> Can you imagine a Clojure implementation on a different underlying
> runtime? Which ones might possibly be suitable? Can you imagine a
> Clojure on top of, say the CLR? Or on top of a Common Lisp? Or on GHC
> or perhaps the LLVM?
There's Clojure as a language an
Well considering that the JVM is now open source as well as Clojure itself I
wouldn't worry too much :)
That said all languages are simply stepping stones, Clojure happens to be a
particular elegant one that you might want to pause on for a considerable
amount of time, take a deep breath, and enjoy
Oops not paying attention you are right. Hash map comes first as the
function. Works like a charm.
2009/2/6 Craig Andera
>
> > (methods multifn)
> >
> > Returns a hash-map where the keys are vectors if the dispatch values of
> the
> > multimethods were vectors, weird and cool :)
> > How does on
Why is this happening?
(def cs (make-array Character/TYPE 1024))
(apply str cs)
-> ""
(String/valueOf cs)
-> "[...@42880d"
Shouldn't these return the same value?
--Kevin
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Gr
Hmm, for example, this does not work:
([:spinoza/object :spinoza-example-three/serializable] (methods archive))
I get the following exception:
java.lang.IllegalArgumentException: Key must be integer
even though:
(= [:spinoza/object :spinoza-example-three/serializable] (ffirst (methods
archive)
We'd just have to write our own JVM of course. ;)
On Feb 6, 6:19 pm, mikel wrote:
> What happens to Clojure if something bad happens to the JVM?
>
> It's not that I think the JVM is going away any time soon. Sure, Sun
> looks kind of shaky right now, but there are alternative sources of
> JVMs.
Perfect. This is exactly what I need. Thank you. :)
I wonder, is it customary to append an * to the names of functions
that do the grunt work of corresponding macros?
On Feb 6, 10:03 am, Christophe Grand wrote:
> samppi a écrit :
>
> > Thanks for the reply. I've tried delays, but it seemed to m
On Feb 6, 2:02 pm, Peter Wolf wrote:
> How does one convert a Clojure Map to the equivalent Java Map? I bet I
> could do it in one line if I knew the magic.
To convert all keys to strings, there's clojure.contrib.walk/stringify-
keys.
-Stuart Sierra
--~--~-~--~~~---
Hi all, I hope I'm not reinventing the wheel with this, but I put
together a function mocking library to allow for functional test
isolation. At this point it handles return values, argument
expectations, and invocation counts. I've just put together a core
for it so far, but I intend to add som
Hi folks - I was trying the example posted below, and I discovered a
slight snag - unchecked-* methods don't exist for doubles or floats!
(and if you call (unchecked-multiply 1.2 3.4) you get "No matching
method found"... which caused some confusion :) )
Is this something that might change in the
> (methods multifn)
>
> Returns a hash-map where the keys are vectors if the dispatch values of the
> multimethods were vectors, weird and cool :)
> How does one check for the existence of a key in a hash-map if the key is
> vector? I tried several things and nothing obvious seemed to work.
Vecto
It's not currently possible to define new Java Exceptions without
ahead-of-time compilation, which is sometimes inconvenient. Besides
this, Java's try/catch exception system isn't as flexible as, for
example, Common Lisp's condition/restart system.
To address both these concerns, I've added a li
On Feb 6, 2009, at 7:19 PM, mikel wrote:
Can you imagine a Clojure implementation on a different underlying
runtime? Which ones might possibly be suitable? Can you imagine a
Clojure on top of, say the CLR? Or on top of a Common Lisp? Or on GHC
or perhaps the LLVM?
Merely imagining these altern
On Feb 6, 2009, at 4:12 PM, Jeffrey Straszheim wrote:
> So, I notice that when you create a hash you do this:
>
> { :key-1 value-1 :key-2 value-2 ... etc ... }
>
> But when you destructure a hash, you do this:
>
> { formal-1 :key-1 formal-2 :key-2 ... etc ... }
>
> Is there a reason the order is
That sounds good, I do plan on purchasing Stuart's book as soon as it
reaches an official version. I don't like reading on a computer.
And Haskell has always been one of my fascinations. If it had better
connectivity to everything else and performance, I would have been
very happy to learn that a
On Feb 6, 6:24 pm, e wrote:
> What;s Ralph all about? You've certainly peaked *my* interest. Maybe we
> should get that running on top of a JVM so it doesn't go extinct again.
Ralph is what Dylan was called before Apple publicly announced it. It
was essentially Scheme + CLOS + some functiona
I am. but that was also an attempt to (possibly) answer a question with a
question.
On Fri, Feb 6, 2009 at 7:28 PM, Raoul Duke wrote:
>
> hi,
>
> On Fri, Feb 6, 2009 at 4:24 PM, e wrote:
> > What;s Ralph all about? You've certainly peaked my interest.
>
> google it up, that's what i immediate
hi,
On Fri, Feb 6, 2009 at 4:24 PM, e wrote:
> What;s Ralph all about? You've certainly peaked my interest.
google it up, that's what i immediately started doing of course :-)
http://209.85.173.132/search?q=cache:R3Jw4HMdGIwJ:coding.derkeiler.com/pdf/Archive/Lisp/comp.lang.lisp/2005-09/msg003
What;s Ralph all about? You've certainly peaked *my* interest. Maybe we
should get that running on top of a JVM so it doesn't go extinct again.
On Fri, Feb 6, 2009 at 7:19 PM, mikel wrote:
>
> What happens to Clojure if something bad happens to the JVM?
>
> It's not that I think the JVM is goi
What happens to Clojure if something bad happens to the JVM?
It's not that I think the JVM is going away any time soon. Sure, Sun
looks kind of shaky right now, but there are alternative sources of
JVMs. Probably the JVM can survive even if Sun doesn't.
Probably.
But I had a favorite programmin
> A long time ago in a galaxy far away (okay, 1992-1994 in Cupertino) I
> worked on an OS project written in Dylan when it was still a lisp.
that was a wonderful + sad story all at the same time. i'm sick and
tired of Good Enough. but don't have the time or money to go for The
Better. :-}
--~--~
On Feb 6, 4:44 pm, Keith Bennett wrote:
> In a substantial GUI app, it is extremely important for visual
> consistency, maintainability, reliability, and extensibility for as
> many components as possible to be coded once and reused (i.e. DRY).
A long time ago in a galaxy far away (okay, 1992-19
Hello Keith,
2009/2/6 Keith Bennett
>
> Tzach -
>
> Cool!
>
> I had to do some things to get it to work.
>
> * Reversed the order of parse-digit and abs functions.
>
> * Added call to -main at the end. By the way, what is the
> significance of the hyphen in the function name?
Please, consider
Hello, not related to your question, but you should consider renaming your
file sudoku_solver to make it compiler friendly.
Concerning your question, I think there have been some answers recently on
the ml. Sorry I don't remember the links exactly.
Regards,
--
Laurent
2009/2/6 Tzach
>
> Hi
>
> I built 4 iterations of a model/protocol/thing system, accumulating
> more requirements for it with each iteration. This discussion has had
> the nice side-effect of grooming my requirements into a tidy state
> that I can use for reference. What I'm doing next is stripping out all
> of the m/p/
On Feb 6, 7:27 am, David Nolen wrote:
> > Yuck. Instead of defining a method on ::idea, you now must define a
> > method on [something-that-has-no-meaning-in-context ::idea] (because
> > the dispatch function must now return a vector, which means the
> > defmethods must now be called on vector
Thanks all, Clojure list is the best.
On Fri, Feb 6, 2009 at 11:27 AM, Christophe Grand wrote:
>
> Stuart Sierra a écrit :
> > No, but there is a pattern for keyword args:
> >
> > (defn my-function [& args]
> > (let [options (apply hash-map args)]
> > ...))
> >
> > Then you can call (my-fun
(methods multifn)
Returns a hash-map where the keys are vectors if the dispatch values of the
multimethods were vectors, weird and cool :)
How does one check for the existence of a key in a hash-map if the key is
vector? I tried several things and nothing obvious seemed to work.
Thanks,
David
-
This message is a response to the GUIs in Clojure thread from last
October (2008). There were "Reply to Author" links, but no "Reply"
links. Is that because of its age? The thread I'm referring to is:
http://groups.google.com/group/clojure/browse_thread/thread/22e4696550b6c4fa/fbccbe56dd45c80c
If no lisp background at all, maybe onlisp is not a good start.
But ANSI Common LISP is good, but maybe too tied to CL ...
The problem with CL is that it does not promote a pure functional style, so
I don't know how you will feel like while coming back from ANSI Common LISP
to clojure.
Well, mayb
Ah thank you that works perfectly!
I actually have a reading list i'm about to set out upon, and Paul
Graham's OnLisp is on it.
I'm just wondering from your perspective which book do you think I
should start on? For someone with many years of experience in Java,
but none in Lisp.
HDTP
OnLisp
AN
(defmacro print_symbol [s] `(quote ~s))
You should consider downloading on lisp by Paul Graham from this page :
http://www.paulgraham.com/onlisptext.html
You'll learn everything you want to know about macros (it's in Common Lisp,
but I think it is understable with just a clojure background, conce
Hi,
I'm trying to write a macro that outputs a symbol without attempting
to resolve it and would appreciate some pointers.
eg. I wrote a function that accepts a symbol as an argument
(defn print_symbol [a]
(println a))
which can be called like this: (print_symbol 'mysymbol)
But I want to writ
On 06.02.2009, at 19:22, Shawn Hoover wrote:
> This seems to work correctly:
>
> user> (apply + 1 2 3 [4 5])
> 15
>
> Is that what you're looking for?
Exactly - except that it doesn't work for me!
Konrad.
--~--~-~--~~~---~--~~
You received this message because y
So, I notice that when you create a hash you do this:
{ :key-1 value-1 :key-2 value-2 ... etc ... }
But when you destructure a hash, you do this:
{ formal-1 :key-1 formal-2 :key-2 ... etc ... }
Is there a reason the order is reversed?
--~--~-~--~~~---~--~~
You re
Thanks! I hadn't seen the EAP option =) I'm going to go with that.
On Feb 6, 11:57 am, Jason Wolfe wrote:
> +1 for the EAP of YourKit. It will expire every now and then, but you
> just download the new version.
>
> The only problem I have is that as far as I can figure out, it can't
> display s
Hello,
I could test the patch, it works really well. With it, no need to implement
periodic polling, which is really a bad solution when on e can avoid it!
Still don't know if there could be a performance impact that would require
to have this as an optional behaviour.
Rich, please do you think
Oops, missed the String key part -- go with Christophe's answer,
perhaps coupled with the second half of mine.
-Jason
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email
hello
Peter Wolf a écrit :
> Hello, how do I do this elegantly?
>
> I have a Clojure Map = {:foo "foo" :bah 3 ... }
>
> and I need to pass it to a Java method that is expecting a
> Map = { "foo" --> "foo" , "bah" --> 3 ...}
>
> How does one convert a Clojure Map to the equivalent Java Map? I b
AFAIK no conversion may be necessary, since Clojure maps are Java
maps.
user> (instance? java.util.Map {:foo "foo" :bah 3})
true
The only exception would be if your method expects a mutable map. In
that case,
user> (HashMap. {:foo "foo" :bah 3})
#
-Jason
On Feb 6, 11:02 am, Peter Wolf wr
Done: http://code.google.com/p/clojure/issues/detail?id=67
Sorry, I'm not with it yet on the new Google Code workflow. :-)
- Chas
On Feb 6, 1:53 pm, Rich Hickey wrote:
> On Feb 6, 2009, at 1:33 PM, Chas Emerick wrote:
>
> > Attached is a patch to add a warn-on-reflection option to
> > clojure.
Hello, how do I do this elegantly?
I have a Clojure Map = {:foo "foo" :bah 3 ... }
and I need to pass it to a Java method that is expecting a
Map = { "foo" --> "foo" , "bah" --> 3 ...}
How does one convert a Clojure Map to the equivalent Java Map? I bet I
could do it in one line if I knew t
On Feb 6, 2009, at 1:33 PM, Chas Emerick wrote:
> Attached is a patch to add a warn-on-reflection option to
> clojure.lang.Compile. In short, if the clojure.compile.warn-on-
> reflection system property is set to "true", then *warn-on-reflection*
> is set to true for the duration of the compile
Attached is a patch to add a warn-on-reflection option to
clojure.lang.Compile. In short, if the clojure.compile.warn-on-
reflection system property is set to "true", then *warn-on-reflection*
is set to true for the duration of the compile process for the libs
specified as command line args
On Fri, Feb 6, 2009 at 1:19 PM, Konrad Hinsen wrote:
>
> The doc string of apply says:
>
>([f args* argseq])
>"Applies fn f to the argument list formed by prepending args to
> argseq."
>
> This looks like I could pass in several argument PLUS one sequence of
> arguments, which just
The doc string of apply says:
([f args* argseq])
"Applies fn f to the argument list formed by prepending args to
argseq."
This looks like I could pass in several argument PLUS one sequence of
arguments, which just happens to be what I want in a specific case.
But it doesn't
+1 for the EAP of YourKit. It will expire every now and then, but you
just download the new version.
The only problem I have is that as far as I can figure out, it can't
display source code associated with a function either. This is
usually fine, except for that it can be impossible to figure o
> (defn mash
> "Reduce a seq-able to a map. The given fn should return a 2-element tuple
> representing a key and value in the new map."
> [f coll]
> (reduce
> (fn [memo elem]
> (let [[k v] (f elem)]
> (assoc memo k v)))
> {} coll))
I called this "map-map" in my util
You can also provide the unicode directly to the reader with \u,
e.g., \u0426.
On Feb 4, 11:24 pm, Terrence Brannon wrote:
> How do you write a unicode character in clojure?
>
> Or properly put: what form do you provide the reader so that it
> produces a unicode character as data structure?
I've updated this patch, eliminating the performance hit I introduced
for concatenation of stdout & stderr when they're byte arrays (turns
out it was significant). Let me know if there's anything else I can
do.
Perry
http://code.google.com/p/clojure-contrib/issues/detail?id=23
--~--~-~-
samppi a écrit :
> Thanks for the reply. I've tried delays, but it seemed to make my
> functions much slower. I think I'm going to go with var-quoting—it
> seems to be the least intrusive option, and it definitely works. My
> nightmare is finally over. :)
>
> I wonder if there's a way to make a ma
I looked into this briefly; I'm amazed at the progress you've made. Please
keep updating!
On Fri, Feb 6, 2009 at 11:29 AM, Remco van 't Veer wrote:
>
> Got startup time down to 5 seconds by completely eliminating the use
> of lispreader and putting of loading the xml, set and zip namespaces.
> T
Thanks for the reply. I've tried delays, but it seemed to make my
functions much slower. I think I'm going to go with var-quoting—it
seems to be the least intrusive option, and it definitely works. My
nightmare is finally over. :)
I wonder if there's a way to make a macro make even this unneeded
Got startup time down to 5 seconds by completely eliminating the use
of lispreader and putting of loading the xml, set and zip namespaces.
There's no clear bottlenecks left to fix.
On Fri, Feb 6, 2009 at 1:06 AM, Remco van 't Veer wrote:
> I've managed to get to startup time down from 12 second
Stuart Sierra a écrit :
> No, but there is a pattern for keyword args:
>
> (defn my-function [& args]
> (let [options (apply hash-map args)]
> ...))
>
> Then you can call (my-function :keyword value :keyword2 value)
And you can use destructuring to add support for defaults value:
(defn my-f
you can also use map destructuring.
(defn x [{:keys [a b c]}]
[a b c])
user=> (x {:a 1 :b 2 :c 3})
[1 2 3]
On Fri, Feb 6, 2009 at 7:52 AM, Jeffrey Straszheim
wrote:
> That is remarkably simple and elegant.
>
> On Fri, Feb 6, 2009 at 10:20 AM, Stuart Sierra
> wrote:
>>
>> On Feb 6,
That is excellent news. Now I just to learn enough Clojure to properly
contribute to a pukka open Source project so I can get a free copy ;-)
2009/2/6 Peter Wolf
>
> Check out this email! IntelliJ is going to get a *really* good plugin
> for Clojure :-D
>
> I have gladly turned control of the
That is remarkably simple and elegant.
On Fri, Feb 6, 2009 at 10:20 AM, Stuart Sierra
wrote:
>
> On Feb 6, 10:06 am, David Nolen wrote:
> > Is there anything in core or contrib for parsing arguments to a
> > function? Since Clojure fns don't support optional args or even keyword
> > args, is the
Hi Tim,
Thanks for the explanations; clearly there's a lot to think about
here! But I think Futures provide what I'm looking for. I don't know
if having Agents be cancel-able in general is a good idea or not; the
"Java Concurrency" page suggests not.
-Stuart Sierra
On Feb 1, 6:59 pm, Timothy
Hello,
For the non-initiated, who is Ilya ?
Anyway, great news for IntelliJ users !
If some IBM or other Eclipse commiter(s) want to help with clojuredev,
they're welcome too ! :-) :-)
--
Laurent
2009/2/6 Peter Wolf
>
> Check out this email! IntelliJ is going to get a *really* good plugin
Check out this email! IntelliJ is going to get a *really* good plugin
for Clojure :-D
I have gladly turned control of the my plugin over to Ilya, and the code
has been moved to the JetBrains SVN. I will remain involved and fix
bugs as they are found, but Ilya and his team are adding a real t
On Feb 6, 8:18 am, Frantisek Sodomka wrote:
> user=> (map (macrofn or) '(1 nil 3) '(nil 2 nil))
> (1 2 3)
>
> It is also closely related to apply_macro.clj: make macros behave like
> functions - work done by Stuart Sierra
Cool; that's a more general version of what I wrote in apply-macro.
-Stua
On Feb 6, 10:06 am, David Nolen wrote:
> Is there anything in core or contrib for parsing arguments to a
> function? Since Clojure fns don't support optional args or even keyword
> args, is there a standard set of helpers functions to do this? I looked
> around but I didn't see anything obvious.
I don't know much about Java profiling, but I've been using java -
Xprof and java -Xrunhprof, and it's usually been enough to guide me.
On Feb 5, 10:47 pm, Sergio wrote:
> I have been trying out the YourKit profiler and I think it's great.
> However, my evaluation license is going to expire soon
Is there anything in core or contrib for parsing arguments to a
function? Since Clojure fns don't support optional args or even keyword
args, is there a standard set of helpers functions to do this? I looked
around but I didn't see anything obvious.
David
--~--~-~--~~~-
I'd vote for that -- after the powers that be are happy with a name.
It would be very useful to me.
On Fri, Feb 6, 2009 at 9:43 AM, Chouser wrote:
>
> On Thu, Feb 5, 2009 at 3:08 PM, Jeffrey Straszheim
> wrote:
> > Is there a reason the assert-args macro is private to core? It seems
> like
> >
Tzach -
Cool!
I had to do some things to get it to work.
* Reversed the order of parse-digit and abs functions.
* Added call to -main at the end. By the way, what is the
significance of the hyphen in the function name?
* The call to msg-box in the About action had an extra parameter,
nil. I
On Thu, Feb 5, 2009 at 3:08 PM, Jeffrey Straszheim
wrote:
> Is there a reason the assert-args macro is private to core? It seems like
> it would be generally useful.
It was originally included without the normal amount of deliberation
on naming and API that most core functions and macros go thr
Hi all
As my first Clojure project, I decided to finally solve one of
humanity major problems - Sudoku!
Here is the source
http://code.google.com/p/sudoku-solver/source/browse/trunk/sudoku-solver.clj
I would appreciate your comments.
Thanks Konrad for useful tips.
What is the simplest way to ma
Hi Sergio,
I have been using JProfiler with the IntelliJ Clojure plugin. The
combination seems to work fine, except that JProfiler does not know how
to display Clojure source code associated with a function. However,
there is enough information displayed that you can do it trivially.
Peter
Hello,
Does it also mean that the following use case will work with *reload-all* :
- x.y.z is a lib that is made of two files : x/y/z.clj, and x/y/z1.clj , and
z.clj loads z1.clj
- x.y.z is compiled
- z1.clj is modified
- x.y.z is compiled => even if x/y/z.clj nor x/y/z__init.class are in sync,
t
On Feb 6, 2009, at 8:28 AM, Stephen C. Gilardi wrote:
When *reload-all* is true, RT.load() will (re)load all libs from
their ".clj" files even if they're already loaded.
To clarify:
When *reload-all* is true, RT.load will (re)load any lib it is asked
to load from the lib's ".clj" file eve
"require" and "use" support a ":reload-all" flag that is intended to
cause the specified libs to be reloaded along with all libs on which
they directly or indirectly depend. This is implemented by temporarily
binding a "loaded-libs" var to the empty set and then loading the
specified libs.
>
> Yuck. Instead of defining a method on ::idea, you now must define a
> method on [something-that-has-no-meaning-in-context ::idea] (because
> the dispatch function must now return a vector, which means the
> defmethods must now be called on vector dispatch values...).
Sure but as you mention
While reading article "Challenged by Common Lispers":
http://kazimirmajorinc.blogspot.com/2009/01/challenged-by-common-lispers.html
I found in its comments interesting definition of 'memfn':
https://www.blogger.com/comment.g?blogID=5894839&postID=8563938547112716465
This is my version in Clojure
You can use the Early Access version of YourKit: it does not require a
license key and in my experience works great:
http://www.yourkit.com/eap/index.jsp
- Mark
On Thu, Feb 5, 2009 at 10:47 PM, Sergio wrote:
>
> I have been trying out the YourKit profiler and I think it's great.
> However, my
I'm in Colorado Springs. I'm pretty new to Clojure, but totally sold
on it.
On Feb 5, 12:39 pm, chris wrote:
> Are there any existing clojure users in the Denver/Boulder area (other
> than me)?.
>
> Chris
--~--~-~--~~~---~--~~
You received this message because y
I have been trying out the YourKit profiler and I think it's great.
However, my evaluation license is going to expire soon and being a
student I can't purchase (even the academic) license right now.
I have tried profiler4j and it is usable but it isn't working 100%
right with clojure (in my case)
Tim
You could even embed a REPL into your
application with a socket back-door, connect to it and really have fun
with your users.
I am interested, could you make a rough patch for me to draw some
inspiration from
Emeka
--~--~-~--~~~---~--~~
You received this messag
Christophe Grand a écrit :
> (def array (delay (conc array-start value array-sep value array-end)))
>
or:
(def array (conc array-start (delay value) array-sep (delay value)
array-end))
and you don't need the call-rule helper.
--~--~-~--~~~---~--~~
You receiv
Rich Hickey wrote:
> On Feb 4, 10:36 pm, Conrad wrote:
>
>> It is useful to build a map from a list of keys and a value generator
>> function. Of Course, such a function is easy to write:
>>
>> (defn genmap [keys fun]
>> (zipmap keys (map fun keys)))
>>
>> In fact, it seems so useful that it
hello,
samppi a écrit :
> I tried asking about this yesterday, but it seems like I expressed my
> problem poorly. Anyways, here's another shot. :)
>
> (declare value)
>
> (def array (conc array-start value array-sep value array-end))
>
> (def value (alt array bit))
>
You can get your code to
Hello,
I have a problem for implementing the auto-compile feature of clojuredev
eclipse plugin.
My problem is that it seems that the function 'compile returns very fast to
the clojure dev builder, and when the builder refreshes the workspace
(operation needed to "see" the newly compiled classes),
On Feb 6, 12:18 am, David Nolen wrote:
> > (prefer-method frob ::idea ::thing)
>
> (prefer-method [::runtime-tag1 ::idea] [::runtime-tag1 ::thing])
> (prefer-method [::runtime-tag2 ::thing] [::runtime-tag2 ::idea])
>
> Provide a dispatch fn that extracts the runtime tag.
Yuck. Instead of def
85 matches
Mail list logo