2010/1/2 Sean Devlin :
> I don't think your version of the signature supports variadic defaults well.
Hi Sean,
Thanks for commenting.
Just by way of clarification, taking the function as the last argument
seems to work fine in my experiments. I'm sure it could be better but
here what I've been u
2010/1/2 Timothy Pratley :
> user=> ((fnil-2 1 +) nil 2 3 4 5)
> java.lang.ClassCastException: java.lang.Integer cannot be cast to
> clojure.lang.IFn (NO_SOURCE_FILE:0)
Correction, I just realized of course it doesn't work if I specify the
arguments around the wrong way! I should have done:
user=>
Phil Hagelberg writes:
> Rob Wolfe writes:
>
>> Stefan Tilkov writes:
>>
>>> Two quick Emacs/Clojure questions I can't seem to find the answer to:
>>>
>>> - In his screencasts, Sean Devlin moves the mouse over an item in his
>>> REPL history and it becomes highlighted (and he can paste it to th
On 01.01.2010, at 23:56, Hugo Duncan wrote:
>> I want to create a new instance of a deftype from inside one of its
>> methods.
>
> I ended-up using extend-type for this case.
That's probably the cleanest solution, but you lose the performance
benefit of defining methods right in the type defini
Hi,
for seminar talk at my university I have to prepare a demo program
showing Clojure's concurrency features. I stumbled upon the ants demo
presented in Rich Hickey's "Clojure Concurrency" talk (
http://blip.tv/file/812787
) which I like very much. I began to port the program to Java to
demonstr
Don't know about the current IDEA "La Clojure" clojure plugin status.
But concerning Eclipse (and its counterclockwise plugin), what you
describe here works well AFAIK.
It's also possible to place breakpoints on your own .clj files.
You can quickly start from here :
http://code.google.com/p/coun
Hey Clojurians,
To kick off the New Year, I'm releasing my neo4j wrapper. It has both a
comprehensive low level api that lets you deal with nodes and
relationships and a higher level api that uses nested hashmaps. Check
it out at:
http://bitbucket.org/mebaran/appledelhi2
I've also uploaded a v
> > I wonder if it would be a good idea to include a clojure.io
> > namespace in Clojure itself.
+1.
> > read-lines was left out since ...
On the basis that it's less painful to add new stuff in later than to
remove stuff I agree that erring on the side of caution in the correct
approach.
> Ove
> Now when I try to get a REPL (by using clojure.main as the startup class), I
> get an error about clojure/core.clj not being on the classpath. While a very
> rough solution would be to just move clj/clojure somewhere on the path, I'd
> like to know how to change the classpath for a module.
Are y
(note the .)
(deftype Bar
[i]
Foo
(foo [] (Bar. (inc i
/Jonas
--
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
Note that posts from new members are moderated - please be patien
Many thanks to you Bill - it works!
.Bill Smith at "Fri, 1 Jan 2010 10:44:37 -0800 (PST)" wrote:
.S> Happy New Year to you, Alex.
.S> I reproduced the problem as follows:
.S> user=> (loop [x (byte 0) count 0]
.S> (if (< count 10) (recur 0 (inc count
.S> java.lang.RuntimeException: ja
Hi all,
I'm trying to get all the latest and greatest swank-clojure 1.1.0
goodness via ELPA, but no joy. I'm starting with an absolutely clean
slate. I'm running a freshly installed emacs 23.1.1 on Windows 7. I
have a blank .emacs file and no elpa subdirectory under .emacs.d.
I install elpa an
Cool stuff Mark!
Hope you don't mind me forwarding this to the Neo4j community.
Happy new year!
/Tobias
On Fri, Jan 1, 2010 at 5:16 PM, Mark Baran wrote:
> Hey Clojurians,
>
> To kick off the New Year, I'm releasing my neo4j wrapper. It has both a
> comprehensive low level api that lets you d
If http://build.clojure.org/snapshots is official, I think it is great
to add a link to it to the homepage of Clojure.
On Jan 2, 3:01 pm, Phil Hagelberg wrote:
> Howard Lewis Ship writes:
>
> > Is this available via a Maven repo yet and, if so, what version of
> > clojure-contrib is compatible
Hi,
I'm just trying to understand why I would use :>> in a condp expression. The
followjg code shows how I tried to write a test for condp, but the question
remains. Why would I want to use :>> ?
Regards
Roger
(defn foo [x]
(println x)
(condp = x
true 1
Phil Hagelberg writes:
> But I'm not quite following on the exact problem and specific repro
> case; could you clarify?
Yes. When I start SLIME, the Swank back-end starts and presents the
Clojure REPL in the *inferior-lisp* buffer. Right after that, the SLIME
front-end sends an "Emacs REX" comma
"Steven E. Harris" writes:
> it takes calling RuntimeMXBean#get() -- actually using the
> RuntimeMXBean instance -- to unblock the other thread.
I meant RuntimeMXBean#getName() there.
My typing is poor this morning.
--
Steven E. Harris
--
You received this message because you are subscribed
Scala has Lift with many advanced features:
http://blog.lostlake.org/index.php?/archives/16-Web-Framework-Manifesto.html
http://blog.lostlake.org/index.php?/archives/25-Why-the-world-needs-another-web-framework.html
If a similar (or better) web framework is written in Clojure, how will
it be imple
"Steven E. Harris" writes:
[...]
> Here's the stack:
>
> o swank-clojure
> Git head.
>
> o SLIME
> Both CVS head and git://git.boinkor.net/slime.git head behave the same
> way, as the offending calls are in swank-clojure.
>
> o Clojure 1.1.0
> Downloaded Jar from code.google.com.
>
> o G
Rob Wolfe writes:
> Unfortunately I have no idea what is the reason of this problem,
That makes two of us.
> but I'm curious what Java version are you using?
user=> (map #(System/getProperty %)
["java.version" "java.vendor" "java.vm.version"])
("1.6.0_17" "Sun Microsystems Inc." "1
"Steven E. Harris" writes:
> In the meantime, I'll continue the investigation.
Here are two thread dumps of the Java process running Clojure and Swank,
which, at this time, has a live Clojure REPL, but the Swank call to
`connection-info' hasn't completed yet.
This first one comes via jvisualvm:
Hi Mike,
Is there anything useful going on in *messages*?
On Sat, Jan 2, 2010 at 9:07 AM, Mike K wrote:
> Hi all,
>
> I'm trying to get all the latest and greatest swank-clojure 1.1.0
> goodness via ELPA, but no joy. I'm starting with an absolutely clean
> slate. I'm running a freshly install
Rob Wolfe writes:
>> installation from ELPA, and William Douglas is working on adding fuzzy
>> completion to that. It's highly recommended that you follow this
>
> I will, if it will work.
>
>> approach rather than copying and pasting several pages of one-off
>> configuration. For instance, addin
"Steven E. Harris" writes:
> In the meantime, I'll continue the investigation.
And yet more information: Apparently it's not critical to call on the
RuntimeMXBean#getName() method specifically to kick the Swank thread out
of its blocking call; just about /any call on a Java method/ from the
Cloj
> … if you want
> to create a report with a consistent view of the program's state in a
> certain point of time. What does that mean in Java? Do we need a
> "global lock" for that? But then, I have to use the same global lock
> on all writing operations, too? This results in destroying all
> concur
Sorry, I think my reply got lost...
Inside deftype methods the symbol "Bar" is the name of the class. You
can use the constructor (Bar. (inc i)) instead. Again, note the "."
after Bar.
On Sat, Jan 2, 2010 at 1:23 PM, Konrad Hinsen
wrote:
> On 01.01.2010, at 23:56, Hugo Duncan wrote:
>
>>> I want
Hi,
Am 02.01.2010 um 12:23 schrieb Konrad Hinsen:
> (deftype Bar
> [i]
> Foo
> (foo [] (new Bar (inc i
>
> Its drawback is relying on an undocumented feature: the value of Foo
> inside the methods is the class Foo being defined.
Isn't this only the case for AOT compiled deftype? F
On Wed, Dec 30, 2009 at 4:07 AM, Timothy Pratley
wrote:
> 2009/12/30 Rich Hickey :
>> This was discussed before, the new version never made it into a patch:
>> http://groups.google.com/group/clojure/msg/43de40f078a291cc
>
> Great!
>
> The 'old' reductions behaves slightly different from the 'new'
On Tue, Dec 29, 2009 at 8:06 PM, Nicolas Buduroi wrote:
> Hi, just to warn that there's a small problem with sets documentation
> in the data structures page of Clojure's website. The hyperlinks to
> set operations and pseudo-relational algebra are broken as they
> haven't followed the move to the
On Sat, Jan 2, 2010 at 6:23 AM, Konrad Hinsen
wrote:
> On 01.01.2010, at 23:56, Hugo Duncan wrote:
>
>>> I want to create a new instance of a deftype from inside one of its
>>> methods.
>>
>> I ended-up using extend-type for this case.
>
> That's probably the cleanest solution, but you lose the pe
On Fri, Jan 1, 2010 at 5:16 PM, Miron Brezuleanu wrote:
> Hello,
> In order to get a better understanding of how some things happen in Clojure,
> I'd like to step through Clojure code (and I mean the Java code used to
> implement Clojure). Basically, just debug a REPL, set breakpoints etc.
> Since
On Fri, Jan 1, 2010 at 2:58 PM, Stuart Sierra
wrote:
> I should have brought this up before 1.1 was released, but I'm
> bothered by the change of clojure.core/import from a function to a
> macro.
>
> If I'm creating a namespace dynamically, I can't evaluate the name of
> the class I want to pass t
On Jan 2, 9:13 am, Shawn Hoover wrote:
> Hi Mike,
>
> Is there anything useful going on in *messages*?
Here is the contents of *Messages*:
Contacting host: tromey.com:80
Reading [text/plain]... 4k of 4k (100%)
Reading... done.
Reading [text/plain]... 54k of 54k (100%)
Saving file c:/mbk/.emacs.d
On Sat, 2 Jan 2010 07:01:20 -0800 (PST)
ngocdaothanh wrote:
> Scala has Lift with many advanced features:
> http://blog.lostlake.org/index.php?/archives/16-Web-Framework-Manifesto.html
> http://blog.lostlake.org/index.php?/archives/25-Why-the-world-needs-another-web-framework.html
There are defi
On Sat, Jan 2, 2010 at 11:03 AM, Steven E. Harris wrote:
> "Steven E. Harris" writes:
>
>> In the meantime, I'll continue the investigation.
>
> Here are two thread dumps of the Java process running Clojure and Swank,
> which, at this time, has a live Clojure REPL, but the Swank call to
> `connec
> Perhaps it would be best to paste such dumps somewhere, rather than
> mail to the entire list?
Might I suggest
http://paste.lisp.org/
?
--
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
The closest thing to Lift in Clojure right now is probably Conjure:
http://github.com/macourtney/Conjure
Tutorial on Conjure:
http://wiki.github.com/macourtney/Conjure/hello-world-tutorial
It's closer to Rails than Lift. I've looked at Lift and didn't see
much advantage of it over a Rails like f
I believe you're running into the same coding issue that I did with ELPA on
Windows. slime.el declares in its local variables that it has unix line
endings, but ELPA's download process is saving it with windows line endings.
Here's the pseudopatch I submitted to ELPA. You can hack up your
.emacs.d
> This is why persistent data structures are so cool: you gain the
> ability to look at consistent snapshots of the world for free.
it is not impossible to use persistent data structures with plain old
java, by the way :-)
--
You received this message because you are subscribed to the Google
Gro
> A bit uglier, but ought to be quite fast.
It doesn't need to be that ugly:
(defn sorted-vec [coll]
(doto (into-array coll)
(java.util.Arrays/sort)
(vec)))
looks OK to me at least.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post
> A bit uglier, but ought to be quite fast.
Doesn't need to be that ugly, this looks OK to me at least:
(defn sorted-vec [coll]
(doto (into-array coll)
(java.util.Arrays/sort)
(vec)))
It'd also be possible to generalise the return type by passing in a fn
to apply to the sorted array.
Hi !
Given the code below, I'm wondering why I get
No such namespace: c
It would be nice if some could explain to me what I'm doing wrong.
Regards
Roger
(ns coretest
(:use [clojure.test])
)
(defn foo [x]
(condp = x
true 1
false 2
Generally with Maven you want to seperate snapshots from final
releases; I'd be more confortable with http://build.clojure.org/repo
or http://build.clojure.org/maven as the root path.
On Sat, Jan 2, 2010 at 6:23 AM, ngocdaothanh wrote:
> If http://build.clojure.org/snapshots is official, I think
On Jan 2, 12:18 pm, Shawn Hoover wrote:
> I believe you're running into the same coding issue that I did with ELPA on
> Windows. slime.el declares in its local variables that it has unix line
> endings, but ELPA's download process is saving it with windows line endings.
>
> Here's the pseudopatch
Mike K writes:
> That did the trick, but now I have another question. How do I set up
> additional entries on my classpath now that I've installed via elpa
> and moved to 1.1.0?
Check the swank-clojure readme. What you're probably looking for is M-x
swank-clojure-project.
-Phil
--
You receiv
Rich Hickey writes:
> Perhaps it would be best to paste such dumps somewhere, rather than
> mail to the entire list?
I'll do that next time. Sorry for the noise.
--
Steven E. Harris
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this
I'm up and running again. Thank you very much Shawn and Phil!
Phil: For the sake of other Windows users, I suggest adding a pointer
to the patched package.el in the readme until the issue is resolved.
Mike
--
You received this message because you are subscribed to the Google
Groups "Clojure
"Steven E. Harris" writes:
> Now get this: Right before the SLIME-Swank connection completes, Emacs
> beeps and prints the following two lines in the *Messages* buffer:
>
> ,
> | error in process filter: cond: etypecase failed: defun, (number cons string)
> | error in process filter: etypecas
Hello, Miron.
to debug your Clojure scripts in IntelliJ with the appropriate plugin
installed, just create new run configuration for .clj file. It may be
created automatically via Ctrl(Meta)-Shift-F10 default shortcut. After this
you can run it in REPL mode or as a standalone script and put break
I can't seem to find the explanation I once saw for this. It's
something like: "c/foo" is resolved when the "do" form is _read_ ...
at which point the alias hasn't happened yet.
On Jan 2, 3:14 pm, Roger Gilliar wrote:
> Hi !
>
> Given the code below, I'm wondering why I get
>
> No such namespace:
Here's what I was thinking of:
http://groups.google.com/group/clojure/browse_thread/thread/c093ac2c7e7302ab
I believe it's the same phenomenon.
On Jan 2, 8:03 pm, Mike Hogye wrote:
> I can't seem to find the explanation I once saw for this. It's
> something like: "c/foo" is resolved when the "d
Mike, are you referring to this:
http://groups.google.com/group/clojure/browse_thread/thread/b4704108d85693d0/84dd4b690b6d7afd?lnk=gst&q=alias#84dd4b690b6d7afd
?
Roger, I realize this invalidates your test, but if do this instead,
the error goes away:
(alias 'c 'coretest)
(testing "test alias fun
Howard's correct. Generally, SNAPSHOTs and releases are kept
in separate repositories. It's not required, but it allows a user to
configure their maven pom to grab the latest release of a dependency (for
example using syntax like [1.0, ) . If you mix releases
and snapshots in a single repo, then a
p.s. Here's a little example of using different repos at Google's official
maven repo:
http://code.google.com/p/google-maven-repository/wiki/ProjectSetup
On Sat, Jan 2, 2010 at 12:47, Brian Schlining wrote:
> Howard's correct. Generally, SNAPSHOTs and releases are kept
> in separate repositories
Hi,
Am 02.01.2010 um 20:17 schrieb ianp:
>> A bit uglier, but ought to be quite fast.
>
> Doesn't need to be that ugly, this looks OK to me at least:
>
> (defn sorted-vec [coll]
> (doto (into-array coll)
>(java.util.Arrays/sort)
>(vec)))
>
> It'd also be possible to generalise the ret
Hi,
Am 02.01.2010 um 15:23 schrieb Roger Gilliar:
> I'm just trying to understand why I would use :>> in a condp expression. The
> followjg code shows how I tried to write a test for condp, but the question
> remains. Why would I want to use :>> ?
See here: http://groups.google.com/group/cloju
Brian Schlining writes:
> Howard's correct. Generally, SNAPSHOTs and releases are kept
> in separate repositories. It's not required, but it allows a user to
> configure their maven pom to grab the latest release of a dependency
> (for example using syntax like [1.0, ) . If you mix
> releases and
On 02.01.2010, at 18:16, Rich Hickey wrote:
> That's documented:
>
> ;from (doc deftype)
>
> "In the method bodies, the (unqualified) name can be used to name the
> class (for calls to new, instance? etc)."
Thanks, that solves the problem perfectly well!
Konrad.
--
You received this message b
58 matches
Mail list logo