Some thoughts on really stupid things that have tripped me up:
- How do I exit Clojure - srsly
C-c
- Whatsa JVM - does this mean Clojure is really just Java with parens?
- Whatsa Classpath?
this answer presents the *ALL* important opportunity to mention that
*nix uses `:' to separate paths wher
> I would propose, that the files are hosted where ever
> they are hosted now with suitable labels with which
> Clojure version they work. This works out of the box
> with the least amount of trouble.
>
> Meikel
In contrast to the monolithic GG Code repo or C*AN or git/hg/bzr.*hubs
I find that th
At the moment assert macro accepts only a single argument - a test. If
the test fails (is false), an exception is thrown. But the only
information available (until we have better introspection tools) is
the test _expression_. This causes problems when working on many items
that should satisfy an a
It would be nice if someone updated the wiki with a new example.
I don't understand how the gen-class stuff is supposed to work.
Why doesn't the following work?
(gen-class
:name MyException
:extends [Exception])
(defn user-exception-test []
(try
(throw (new MyException "msg: user excepti
On Fri, Dec 19, 2008 at 2:41 AM, Christian Vest Hansen
wrote:
>
> All.
>
> I think it would be nice if the doc-string was allowed (in addition to
> current behavior) to immediately follow the params vector in the
> various defsomethings.
>
> To the best of my knowledge, such a change would be non
On Thu, Dec 18, 2008 at 9:08 PM, Stuart Sierra
wrote:
>
> On Dec 18, 6:05 pm, "Mark Volkmann" wrote:
>> If I understand correctly,
>>
>> (are (< 1 2, 5 7))
>>
>> is equivalent to
>>
>> (is (< 1 2))
>> (is (< 5 7))
>
> Not exactly. The first argument to "are" is a template expression,
> which is
On Fri, Dec 19, 2008 at 12:46 PM, Michael Wood wrote:
>
> Where would it go when you have multiple parameter lists and bodies?
>
> (defn blah ([a] (do-something-with a)) ([a b] (do-something-with a b)))
That case should be unchanged, and work as it does today.
>
> --
> Michael Wood
>
> >
>
On Thu, Dec 18, 2008 at 5:26 PM, Meikel Brandmeyer wrote:
> Hi,
>
> I reworked my initial proposal according to the comments
> of Rich. The syntax now looks as follows:
>
> (condp predicate expr
> test-expr result-expr
> test-expr :> result-expr
What is ":>"? Is that just a keyword whose name
Hi Mark,
On 19 Dez., 13:12, "Mark Volkmann" wrote:
> What is ":>"? Is that just a keyword whose name is ">"?
It's exactly that: a keyword with the name ">".
> I think adding more characters with special meaning
> makes code harder to read, so I hope we don't add
> more of these.
It comes fro
> If you don't need this, you don't have to use it.
I feel very strongly that Clojure, and any programming language,
should avoid using this rationale when adding support for new syntax.
Just because a developer chooses not to use a particular feature
doesn't mean they don't have to understand it
I'm learning Clojure by trying to implement some functions from Ruby
core/stdlib/ActiveSupport's core_ext.
The first one I wrote is groups-of (similar to ActiveSupport's
in_groups_of):
(defn groups-of
"Returns coll in groups of x size, optionally padding any remaining
slots with specified v
Not sure if the FAQ is the right place to put it, but I haven't seen
any mention of this "gotcha" which could really trip some people up:
http://w01fe.com/?p=32
Short version: hashing "immutable" Clojure collections that contain
mutable Java objects can lead to confusing results.
(Hi all, I'm n
Hello Mark,
On 19 Dez., 13:36, "Mark Volkmann" wrote:
> > If you don't need this, you don't have to use it.
Ok. That was a stupid statement. But at least it is
not the rationale for including condp (in whatever
form).
> I feel very strongly that Clojure, and any programming language,
> should
On Fri, Dec 19, 2008 at 6:52 AM, Meikel Brandmeyer wrote:
>
> Hello Mark,
>
> On 19 Dez., 13:36, "Mark Volkmann" wrote:
>> > If you don't need this, you don't have to use it.
>
> Ok. That was a stupid statement. But at least it is
> not the rationale for including condp (in whatever
> form).
I
For those who are following or helping my efforts (thank you), the
IntelliJ Clojure plugin code is now on GoogleCode. Enjoy!
http://code.google.com/p/clojure-intellij-plugin/source/browse/#svn/trunk/src/org/clojure/intellij
Please note that this code is nowhere near ready for use. Syntax
col
Peter,
Great news!
On Friday 19 December 2008 05:36, Peter Wolf wrote:
> For those who are following or helping my efforts (thank you), the
> IntelliJ Clojure plugin code is now on GoogleCode. Enjoy!
>
> http://code.google.com/p/clojure-intellij-plugin/source/browse/#svn/t
>runk/src/org/clojure
On Fri, Dec 19, 2008 at 1:02 PM, hosia...@gmail.com wrote:
>
> I'm learning Clojure by trying to implement some functions from Ruby
> core/stdlib/ActiveSupport's core_ext.
>
> The first one I wrote is groups-of (similar to ActiveSupport's
> in_groups_of):
>
> (defn groups-of
> "Returns coll in g
While we are talking about assert: I recently wanted for assert to
return the value of the expression, so I could embed asserts inside a
Fact test and get detailed reporting about what failed.
I checked a few other functional languages and none of their asserts
return a value either. This s
Hi Randall,
I'd like to get it to the point where some set of features completely
work before I release a plugin. I'd like to see at least coloring,
parens matching and a REPL.
For the moment you need to install the IntelliJ plugin development kit
if you just want to try it. Of course, havi
On Dec 19, 8:59 am, "Michael Wood" wrote:
> On Fri, Dec 19, 2008 at 1:02 PM, hosia...@gmail.com
> wrote:
>
> > I'm learning Clojure by trying to implement some functions from Ruby
> > core/stdlib/ActiveSupport's core_ext.
>
> > The first one I wrote is groups-of (similar to ActiveSupport's
>
On Fri, Dec 19, 2008 at 4:32 PM, Rich Hickey wrote:
>
> On Dec 19, 8:59 am, "Michael Wood" wrote:
>> On Fri, Dec 19, 2008 at 1:02 PM, hosia...@gmail.com
>> wrote:
>>
>> > I'm learning Clojure by trying to implement some functions from Ruby
>> > core/stdlib/ActiveSupport's core_ext.
>>
>> > The
On Fri, Dec 19, 2008 at 4:35 PM, Michael Wood wrote:
> On Fri, Dec 19, 2008 at 4:32 PM, Rich Hickey wrote:
>>
>> On Dec 19, 8:59 am, "Michael Wood" wrote:
[...]
>>> There is a function called partition in Clojure's core.clj that does
>>> this, except it does not pad, but rather discards any inc
On Dec 19, 4:27 pm, Stuart Halloway wrote:
> While we are talking about assert: I recently wanted for assert to
> return the value of the expression, so I could embed asserts inside a
> Fact test and get detailed reporting about what failed.
>
> I checked a few other functional languages and
Hi all,
I have made a small commit [1] to clojure-contrib that gets most of
clojure.contrib.test-clojure working again. Hopefully this will enable
people to contribute more tests. (J., evaluation.clj was more
complicated to fix so I have temporarily disabled it.)
I hope to be in the IRC m
On Fri, Dec 19, 2008 at 9:37 AM, Michael Wood wrote:
>
> On Fri, Dec 19, 2008 at 4:35 PM, Michael Wood wrote:
>>
>> hmmm... if I do this:
>>
>> user=> (partition 2 1 (iterate inc 1)) (.printStackTrace *e)
>>
>> it ends like this:
>>
>> [...]
>> 57) (587257 587258) (587258 587259) (587259 587260
Hi Meikel,
On Thu, Dec 18, 2008 at 11:18 PM, Meikel Brandmeyer wrote:
> On 19 Dez., 02:10, bc wrote:
>> For clojure-contrib, it would make sense to create a matching tarball
>> whenever a Clojure release occurs. For the other 3, it would be
>> necessary for someone to test and save off a copy o
Thanks Rich! I'll keep an eye on the defect(shame there isn't a watch
feature on google code). Other than this little minor annoyance, the
new AOT changes are working great. Thanks for all the work, I'm
really enjoying Clojure.
On Dec 17, 6:45 am, Rich Hickey wrote:
> On Dec 17, 12:43 am, Kev
On Fri, Dec 19, 2008 at 10:30 AM, Kevin Martin wrote:
>
> Thanks Rich! I'll keep an eye on the defect(shame there isn't a watch
> feature on google code). Other than this little minor annoyance, the
> new AOT changes are working great. Thanks for all the work, I'm
> really enjoying Clojure.
>
On Friday 19 December 2008 09:10, Cosmin Stejerean wrote:
> On Fri, Dec 19, 2008 at 10:30 AM, Kevin Martin
wrote:
> > Thanks Rich! I'll keep an eye on the defect(shame there isn't a
> > watch feature on google code). Other than this little minor
> > annoyance, the new AOT changes are working g
Hi,
Am 19.12.2008 um 18:19 schrieb Randall R Schulz:
Have you been able to make it work? It doesn't for me, and I am logged
in. Is there a trick? Stuart H. managed to make it work somehow. He
said something about using Firebug to figure it out.
Starring works for me (Safari on Mac & Windows).
On Dec 18, 7:18 pm, "Mark McGranaghan" wrote:
> I've likewise though a fair bit about this, but haven't been able to
> come up with a particularly satisfying solution.
>
> One approach I've considered is a watcher-type system where
> persistence is defined in terms of immutable snapshots and ap
According to Paul Graham's On Lisp, macroexpanders should be purely
functional, and you should not count on how often a macro gets
expanded. This seems like a reasonable restriction for Clojure too.
However, Chouser posted an example that shows the expansion of proxy
does have a side effec
On Tue, Dec 16, 2008 at 1:15 PM, Scott Jaderholm wrote:
> I'm trying to use the sql contrib with Microsoft SQL Server Express 2005.
I've used the jTDS driver for SQL Server 2005 (not Express) without
any problems, so if you still have problems with the Microsoft driver
you may want to try that o
I think it's a generally good idea for macros to be purely functional,
but it's not always a requirement. As long as Clojure remains
exclusively a compiler and not an interpreter (unlike some CL
implementations) I think it is safe to assume that macros will only
run at compile time.
-S
On Dec 19
+1 to Mon Key's suggestions. Those are very FAQ-like questions.
-Matt
On Dec 19, 12:45 am, Mon Key wrote:
> Some thoughts on really stupid things that have tripped me up:
>
> - How do I exit Clojure - srsly
> C-c
>
> - Whatsa JVM - does this mean Clojure is really just Java with parens?
>
> - W
I noticed this first with a project I'm working on, and verified that
it is happening as well with the temperature converter demo on the
clojure site.
After I run the file from within Slime, after a few seconds my Swing
gui stops responding, and the Repl as well. Apparently, the whole Java
proces
I'm learning macros, and I've figured something out that works for
what I want to do but looks awfully weird. Is this a hacky mess
because I don't know the clean way to do it or an idiom I just need to
get used to?
I want a macro expansion to define some functions in the namespace of
the "caller.
Hi Rich & all,
While compiling Clojure, It seems that *compile-path* is being set to
the absolute path to "classes" within the Clojure source
distribution. That is:
unzip clojure_20081217.zip
cd clojure
java -jar clojure.jar
Clojure
user=> *compile-path*
"/Users/rich/dev/clojure/classes"
And it
Hi,
Am 19.12.2008 um 21:25 schrieb John D. Hume:
(ns foo)
(defmacro defthing [s]
(let [thing-name 'thing]
`(def ~thing-name (format "the %s thing" ~s
Simply put 'thing directly into the syntax-quote:
(defmacro defthing
[s]
`(def ~'thing (format "the %s thing" ~s)))
But be sure to
Possibly related:
http://groups.google.com/group/clojure/browse_thread/thread/161d608ccb1e8b3d/76eadda70df674a4?lnk=gst&q=swing+hang#76eadda70df674a4
Bill
On Dec 19, 2:18 pm, levand wrote:
> I noticed this first with a project I'm working on, and verified that
> it is happening as well with the
On Thu, Dec 18, 2008 at 12:56 PM, Phil Hagelberg wrote:
> This was one of the most disorienting things I encountered when starting
> with clojure. I'm used to codebases providing a bin/ directory or at
> least a shell script to start from. It wouldn't be so bad if the java
> CLI launcher were any
> Anyone have any ideas? I'm pretty confused as to what might be going
> on. Some sort of deadlock in the thread pool that isn't allowing the
> AWT event thread any cycles? I'm looking at the thread pool in JSwat
> and I see a lot of Swank threads, but I can't tell exactly what's
> going on.
I li
On Tue, Dec 16, 2008 at 2:05 PM, Randall R Schulz wrote:
> Does anyone have any recommendations?
I use WordPress on my site and like it a lot: does everything I need,
and then some I suspect.
wordpress.com will host your blog for free, I think.
Also blogger.com (owned by Google) looks to be qu
Since sets are callable like functions, subset? can be written pretty
concisely:
user> (defn subset? [a b] (every? b a))
It handles the empty set cases correctly and everything. Is this
already in clojure-contrib? Want it and its brethren superset? proper-
subset? proper-superset? in there?
I should note that this also works because of sets being seq-able.
Since they're callable, we can use b as the predicate in every?; since
they're seq-able we can use a as the coll in every?. Very cool!
On Dec 19, 1:46 pm, Andrew Baine wrote:
> Since sets are callable like functions, subset? can
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 12/19/2008 04:23 PM, Tom Emerson wrote:
> On Tue, Dec 16, 2008 at 2:05 PM, Randall R Schulz wrote:
>> Does anyone have any recommendations?
>
> I use WordPress on my site and like it a lot: does everything I need,
> and then some I suspect.
>
>
Konrad,
Glad to know we were on the same page about monad transformers.
That transformer was indeed a translation from the Haskell
implementation. Using 'with-monad' does clean it up.
I'll have to take a look at your implementation of m-bind.
I did prefer the conciseness and the fact that it
I've been using assoc-in, get-in, etc, to work with nested maps, but I
recently needed a dissoc-in to free up unneeded indexes and such. I
didn't see one, so does this look about right?
(defn dissoc-in [m keys]
(if (<= (count keys) 1)
(dissoc m (first keys))
(let [k (last keys)
Am I mistaken, or is there currently no nice syntax for giving doc
strings to methods? Sure, I can do
(defmulti #^{:doc "documentation"} my-method my-dispatch-fn)
but for consistency with defn and defmacro it would be nice to have a
direct way to document multimethods. Even better would be a w
Hi Randall,
I'm in the same boat: I just set up my first blog yesterday so I could
post some gotchas i've found and experiments i've done with clojure.
I went the route David suggests: dreamhost.com has a special now, $10
for a domain and 6 months free hosting, and they have a one-click
wordpress
Jason writes:
> I'm in the same boat: I just set up my first blog yesterday so I could
> post some gotchas i've found and experiments i've done with clojure.
> I went the route David suggests: dreamhost.com has a special now, $10
> for a domain and 6 months free hosting, and they have a one-clic
"Tom Emerson" writes:
> On Thu, Dec 18, 2008 at 12:56 PM, Phil Hagelberg
> wrote:
>> This was one of the most disorienting things I encountered when starting
>> with clojure. I'm used to codebases providing a bin/ directory or at
>> least a shell script to start from. It wouldn't be so bad if
> I host my blog on Dreamhost, and it works great for static files, though
> if you're looking to host actual clojure apps DH won't cut it.
Yeah, Java hosting seems like rather tricky business, since you
basically need dedicated RAM. I've heard slicehost is very good and
reasonably priced in tha
Apart from being blasphemous - would it be a good idea to override
clojure.lang.Ref in Java land?
I want to create (children of?) refs in clojure that send an agent
when they change, so that I can create facilities to observe changes
to them. Creating a 'MyRef extends Ref' seems to be the obvious
>> I host my blog on Dreamhost, and it works great for static files, though
>> if you're looking to host actual clojure apps DH won't cut it.
>
> Yeah, Java hosting seems like rather tricky business, since you
> basically need dedicated RAM. I've heard slicehost is very good and
> reasonably pric
On Fri, Dec 19, 2008 at 8:35 PM, Rowdy Rednose wrote:
>
> Apart from being blasphemous - would it be a good idea to override
> clojure.lang.Ref in Java land?
>
> I want to create (children of?) refs in clojure that send an agent
> when they change, so that I can create facilities to observe chang
To give some structure to my previous questions - How would I make
refs, that I'm interested in, send an agent on every change, without
having to do that manually?
A: Extend the Ref class (either in Clojure land or in Java land)
B: overload/overwrite (however that would be achieved in Clojure) th
Validators seem like an easy way to do it, I'll try that. Thanks
Chouser!
Afaik Rich only thinks about adding watchers to refs currently, and I
can't find it in the list:
http://code.google.com/p/clojure/issues/list?can=2&q=&colspec=ID+Type+Status+Priority+Reporter+Owner+Summary&cells=tiles
So i
> I have a strong dislike for the concept of TIMTOWTDI (There is more
> than one way to do it .
This should be a guiding design goal for any core lisp devel. Get the
core right and TIMTOWTDI is a `side effect' of good design rather than
the inverse.
s_P
On Dec 19, 7:36 am, "Mark Volkmann" wrote
> This seems like a reasonable restriction for Clojure too.
Third rule. Macros break the rules. Don't place arbitrary
restrictions on rule breaking :P
s_P
On Dec 19, 2:05 pm, Stuart Halloway wrote:
> According to Paul Graham's On Lisp, macroexpanders should be purely
> functional, and you sh
Hans Hubner's BKNR framework for CL explores this in a very
interesting way - while relying on CLOS meta-object protocol the ideas
could prob. be extended to Clojure. With some ABCL interaction this
would make CL -> Clojure || Clojure -> CL interop possible at the JVM
level with persistence...
So
Hello, I am gearing up to write some swing code, specifically some
stuff where I want to use the grid bag layout system, and I remember
something I hated about java:
--c.fill = GridBagConstraints.HORIZONTAL;
c.weightx = 0.5;
c.gridx = 2;
c.gridy = 0;
--
You repeated c all over the place so you d
Docstrings for individual defmethods are not possible.
You can find more info about it there:
http://groups.google.com/group/clojure/msg/f7751913e875953f
Lauri
On Sat, Dec 20, 2008 at 3:05 AM, Jason wrote:
>
> Am I mistaken, or is there currently no nice syntax for giving doc
> strings to metho
Hi everyone,
I'm trying to get clojure-mode working under XEmacs and am having
troubles.
I managed to get it working under GNU Emacs with the following .emacs
file:
(setq inferior-lisp-program "java -cp C:/clojure/trunk/clojure.jar
clojure.lang.Repl")
(add-to-list 'load-path "C:/program files/xe
chris a écrit :
> Hello, I am gearing up to write some swing code, specifically some
> stuff where I want to use the grid bag layout system, and I remember
> something I hated about java:
>
> --c.fill = GridBagConstraints.HORIZONTAL;
> c.weightx = 0.5;
> c.gridx = 2;
> c.gridy = 0;
> --
>
> You re
65 matches
Mail list logo