On Nov 16, 12:36 am, samppi <[EMAIL PROTECTED]> wrote:
> Is there a way to get a value—call it 'anything—so that (isa? anything
> x) is always true for any x?
>
> I need this for multimethod dispatch—sometimes, I want a method to
> ignore some of the stuff its dispatch function returns:
>
> (d
On Sat, Nov 15, 2008 at 8:27 PM, lsmith <[EMAIL PROTECTED]> wrote:
>
> I've just started playing around with clojure, and can't quite make
> out how the (.special form works.
>
> For example,
> (. javax.swing.JOptionPane (showMessageDialog nil "Hello World"))
> seems to work just fine, but
> (
Clojure does not currently allow programs to define new reader macros. That is
unlikely to change.
There are more details here:
http://groups.google.com/group/clojure/search?group=clojure&q=reader+macro&qt_g=Search+this+group
There is a clever technique described on the wiki that allows Clojur
On Nov 15, 4:52 pm, Jeff Rose <[EMAIL PROTECTED]> wrote:
> Hi, I'm finding comments talking about reader macros, but nothing about
> defining them. Does anyone know of an example for adding new read
> macros? I'd like to define a #! macro that passes over the rest of the
> line so we can use c
On Nov 16, 12:52 am, Jeff Rose <[EMAIL PROTECTED]> wrote:
> Hi, I'm finding comments talking about reader macros, but nothing about
> defining them. Does anyone know of an example for adding new read
> macros? I'd like to define a #! macro that passes over the rest of the
> line so we can use cl
In my opinion, idiomatic Clojure for this is:
(.println System/out "smile")
--Steve
On Saturday, November 15, 2008, at 09:32PM, ".Bill Smith" <[EMAIL PROTECTED]>
wrote:
>
>Clojure doesn't know what to do with "System.out"; you need to express
>that as (. System out). Of course (.. System out
Clojure doesn't know what to do with "System.out"; you need to express
that as (. System out). Of course (.. System out (println "wtf")) is
equivalent to (. (. System out) (println "wtf"))
I hope that helps.
Bill
On Nov 15, 7:27 pm, lsmith <[EMAIL PROTECTED]> wrote:
> I've just started playing
I'd like to see Clojure properly packaged (with source jars as well as
binary jars), available via a maven repository, with the main Clojure
site being a multi project so that you could download and build
Clojure and standard libraries all in a single go.
I'm checking with my management to see if
I've just started playing around with clojure, and can't quite make
out how the (.special form works.
For example,
(. javax.swing.JOptionPane (showMessageDialog nil "Hello World"))
seems to work just fine, but
(. System.out (println "wtf"))
does not. Only (.. System out (println "wtf")) does
Hi, I'm finding comments talking about reader macros, but nothing about
defining them. Does anyone know of an example for adding new read
macros? I'd like to define a #! macro that passes over the rest of the
line so we can use clojure scripts just as easily as a ruby script would
be. If an
Currently agent errors are only reported when the agent is derefenced
or further actions are dispatched to the agent. It would be great if
one can get immediate notification of agent errors maybe through a
callback.
Thanks,
nt
--~--~-~--~~~---~--~~
You received th
Bill, thank you for your suggestion.
I was already using the latest versions but I found out that the
problem was that the path to clojure was wrong: it should have been /
usr/local/src/clojure/trunk/target/clojure-lang-1.0-SNAPSHOT.jar : I
forgot the "trunk".
The error message was misleading, t
Hi Giacecco,
On Sat, Nov 15, 2008 at 2:27 PM, Giacecco <[EMAIL PROTECTED]> wrote:
>
> I am using Aquamacs on MacOS 10.5.5, set up slime, swank and clojure-
> mode as described in the instructions, but when I start slime I get
> this error message:
>
> ===
> (add-classpath "file:usr/local/src/
On Nov 15, 2008, at 5:15 PM, Konrad Hinsen wrote:
>
> I am trying to write a function (for use in a macro) that replaces a
> given keyword in a form by a given symbol, i.e.
>
> (replace-symbol :foo :bar form)
>
> should return the form with all occurences of :foo replaced by :bar.
> This turned o
I am using Aquamacs on MacOS 10.5.5, set up slime, swank and clojure-
mode as described in the instructions, but when I start slime I get
this error message:
===
(add-classpath "file:usr/local/src/clojure-swank/")
(require (quote swank))
(swank/ignore-protocol-version "2008-11-02")
(swank/
I've put up a poll form to allow everyone to vote on which
clojure.contrib libs they think should be in clojure.core or otherwise
bundled with Clojure:
https://spreadsheets.google.com/viewform?key=p1hkQs__fVyaQGEP_bOFRVQ
A summary of the results is available, but I can't figure out how to
make i
I am trying to write a function (for use in a macro) that replaces a
given keyword in a form by a given symbol, i.e.
(replace-symbol :foo :bar form)
should return the form with all occurences of :foo replaced by :bar.
This turned out to be surprisingly difficult. I started out like this:
(d
On 2008.11.15., at 15:25, Rich Hickey wrote:
> Welcome Attila,
>
> I've run findbugs on Clojure before and cleaned up a few things. These
> that you mentioned, however, stand as a good example of such an
> analyzer not knowing enough, and I count as spurious, if well-
> intended.
>
> As mentione
I was trying out the new AOT compilation, but hit a roadblock with the
following error message:
java.lang.NoClassDefFoundError: compile_fail$criteria__9$f__11
If I do a dirty build, i.e. just run build 2x, it will find the class.
I stripped everything down to the bare essentials to recreates it:
On Nov 15, 2:34 pm, Meikel Brandmeyer <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Am 15.11.2008 um 19:20 schrieb Stephen C. Gilardi:
>
> > I usually use Mac OS X's Mail from a "mac.com/MobileMe"
> > account to send and receive mail with this group.
>
> I'm using Mail.app on Mac OS X and had never probl
Is there a way to get a value—call it 'anything—so that (isa? anything
x) is always true for any x?
I need this for multimethod dispatch—sometimes, I want a method to
ignore some of the stuff its dispatch function returns:
(defmulti a #(%1 %2))
(defmethod a [3 2] [x y] ...)
; in this met
Hi,
Am 15.11.2008 um 19:20 schrieb Stephen C. Gilardi:
I usually use Mac OS X's Mail from a "mac.com/MobileMe"
account to send and receive mail with this group.
I'm using Mail.app on Mac OS X and had never problems sending
attachments to the group. However Google Groups seems to be
rather chee
On Saturday 15 November 2008 10:20, Stephen C. Gilardi wrote:
> I usually use Mac OS X's Mail from a "mac.com/MobileMe" account to
> send and receive mail with this group.
>
> ...
>
> Does anyone have any hints on doing it successfully or how I might go
> about figuring out what's happening to my
On Sat, Nov 15, 2008 at 1:20 PM, Stephen C. Gilardi <[EMAIL PROTECTED]> wrote:
>
> I usually use Mac OS X's Mail from a "mac.com/MobileMe" account to
> send and receive mail with this group.
I use gmail.com, and have never noticed a problem sending an
attachment to the group.
--Chouser
--~--~--
I usually use Mac OS X's Mail from a "mac.com/MobileMe" account to
send and receive mail with this group.
There have been times in the past when I've been able to attach files
to messages and have them show up properly in
- the copy I receive from the group, and
- the archive
On Saturday 15 November 2008 09:56, Stephen C. Gilardi wrote:
> On Nov 15, 2008, at 12:45 PM, Stephen C. Gilardi wrote:
> > I've enclosed a patch to build.xml
>
> Uploaded to the group because it came through with lines truncated by
> mail.
That's what attachments are for (though at least some ma
On Nov 15, 2008, at 12:45 PM, Stephen C. Gilardi wrote:
> I've enclosed a patch to build.xml
Uploaded to the group because it came through with lines truncated by
mail.
http://groups.google.com/group/clojure/web/build-xml-patch.zip
--Steve
--~--~-~--~~~---~--~-
Hello samppi,
You could try this, the list does not really contain itself, but it
builds lists that are like itself recursively:
;builds recursion into lists, like Y the combinator
(defn build-recursive-list [fun list]
(fun (delay (build-recursive-list fun list)) list))
(def cyclic-list1
I've enclosed a patch to build.xml that lets it stand alone without
the "precompile.clj" helper file we're using currently. The patched
build.xml writes the Clojure compile script to a build directory at
build time based on a new ant property whose value is the list of libs
to compile. I t
If you're cool with passing a map instead of plain parameters, you
could use destructuring to do this:
(defn test1 [{x :x, y :y, :or {:y 3}}]
[x y])
(test1 {:x 2}) => [2 3]
Another thing you could do would be to use variable arity and handle
the absence of the other parameters in the me
Is there a more concise way of expressing an optional parameter with a
default other than writing another entire definition?
That is, instead of:
(defn a-function ; two parameters, x and y, and y is 23 by default
([x] (a-function x 23)
([x y] ...))
...is it possible to do something lik
Thanks for your answers. iterate was just what I needed.
On Nov 15, 9:30 am, "Craig Andera" <[EMAIL PROTECTED]> wrote:
> One way to lazily produce f(n) over an infinite number of integers is
> using map to apply your function to an infinite (lazy) series of
> integers:
>
> (map (fn [x] (* x 3)) (
On Nov 15, 11:15 am, samppi <[EMAIL PROTECTED]> wrote:
> Is there a way to make a lazy sequence whose sequential values are
> derived from some function? I'm thinking about two ways:
>
> (recursive-fn-seq f initial [n]) ; returns (initial (f initial) (f
> (f initial)) ...) n or infinity times
One way to lazily produce f(n) over an infinite number of integers is
using map to apply your function to an infinite (lazy) series of
integers:
(map (fn [x] (* x 3)) (iterate inc 0))
=> (0 3 6 9 ...)
Although you'd be wise to use take when evaluating this in the REPL.
If you want to instead pr
Is there a way to make a lazy sequence whose sequential values are
derived from some function? I'm thinking about two ways:
(recursive-fn-seq f initial [n]) ; returns (initial (f initial) (f
(f initial)) ...) n or infinity times
(index-fn-seq f initial [n]); returns ((f i) (f (inc i)) (f
On Nov 15, 7:58 am, "Craig Andera" <[EMAIL PROTECTED]> wrote:
> Unless I'm missing something:
>
> (count '("CCC" "COC" "C(=O)C"))
> => 3
>
> Or better yet:
>
> (count ["CCC" "COC" "C(=O)C"])
> => 3
Thank you
--~--~-~--~~~---~--~~
You received this message because
Awesome. It amazes me what Clojure can do. Thanks for everyone's help.
On Nov 15, 6:56 am, Rich Hickey <[EMAIL PROTECTED]> wrote:
> On Nov 15, 12:09 am, "Brian Doyle" <[EMAIL PROTECTED]> wrote:
>
> > Another way to create a map is:
>
> > user=> (apply hash-map [:a 1 :b 2 :c 3])
> > {:a 1, :c 3, :
Hi,
On 12.11.2008, at 22:38, Giacecco wrote:
>
> Hi all,
> I am trying setting up clojure to use rlwrap as described at
> http://en.wikibooks.org/wiki/Clojure_Programming#Enhancing_Clojure_REPL_with_rlwrap
> on a MacOS 10.5.5.
>
> I have prepared the clj-completions.clj the instructions describe
On Nov 15, 4:53 am, Attila Szegedi <[EMAIL PROTECTED]> wrote:
> Hi folks,
>
> I run FindBugs on Clojure source code, and there are few things it
> uncovered. I'd be happy to fix these and submit patches (after I
> submitted a contributor agreement), except if someone already a
> contributor want
On Friday 14 November 2008 22:05, Mark H. wrote:
> On Nov 12, 5:52 am, David <[EMAIL PROTECTED]> wrote:
> > No, I think that, if at all, we need a single set of macros. As far
> > as the IDEs are concerned, if we all try "inventing" our own (or
> > plugins for the existing ones), they will all be
On 2008.11.15., at 14:23, Phil Jordan wrote:
>
> Hi Attila,
>
> I can't comment on the other issues, but:
>
> Attila Szegedi wrote:
>> 2. Keyword and Ref define compareTo, but don't redefine equals (and
>> hashCode) to be consistent with it. It ain't necessarily a problem if
>> you know what you'
On Nov 15, 12:09 am, "Brian Doyle" <[EMAIL PROTECTED]> wrote:
> Another way to create a map is:
>
> user=> (apply hash-map [:a 1 :b 2 :c 3])
> {:a 1, :c 3, :b 2}
>
Yes, that's fine, and for the flatten:
(interleave (keys m) (vals m))
Rich
> On Fri, Nov 14, 2008 at 9:42 PM, samppi <[EMAIL PR
It's *1, *2, *3.
On Fri, Nov 14, 2008 at 9:30 PM, Eric Rochester <[EMAIL PROTECTED]> wrote:
> I'm not currently at a repl, so I can't check this, but IIRC, 1*, 2*, and 3*
> bind to the last three return values.
> Eric
--~--~-~--~~~---~--~~
You received this messag
Hi Attila,
I can't comment on the other issues, but:
Attila Szegedi wrote:
> 2. Keyword and Ref define compareTo, but don't redefine equals (and
> hashCode) to be consistent with it. It ain't necessarily a problem if
> you know what you're doing, but since they're public it's usually a
> g
Unless I'm missing something:
(count '("CCC" "COC" "C(=O)C"))
=> 3
Or better yet:
(count ["CCC" "COC" "C(=O)C"])
=> 3
On Fri, Nov 14, 2008 at 11:46 PM, Rajarshi <[EMAIL PROTECTED]> wrote:
>
> Hi, I've been learning Lisp using SBCL, but my complaint has been it
> was difficult for me to link it
Hi, I've been learning Lisp using SBCL, but my complaint has been it
was difficult for me to link it to stuff I use (such as cheminforatics
libs). So I'm very happy to have found Clojure.
However, I've been stumped trying to find out how to get the number of
elements in a list. Currently I'm usin
Hi folks,
I run FindBugs on Clojure source code, and there are few things it
uncovered. I'd be happy to fix these and submit patches (after I
submitted a contributor agreement), except if someone already a
contributor wants to tackle these instead (they're easy to fix for the
most part).
user=> (mapcat identity {:a 1 :b 2 :c 3})
(:c 3 :b 2 :a 1)
On Sat, Nov 15, 2008 at 4:05 AM, Kevin Downey <[EMAIL PROTECTED]> wrote:
> user=> (reduce concat {:a 1 :b 2 :c 3})
> (:c 3 :b 2 :a 1)
> user=>
>
>
> On Sat, Nov 15, 2008 at 4:02 AM, Matthias Benkard <[EMAIL PROTECTED]> wrote:
>>
>> On 1
On 15 Nov., 05:17, samppi <[EMAIL PROTECTED]> wrote:
> Fold isn't build into Clojure
Isn't fold just clojure/reduce?
Matthias
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, s
user=> (reduce concat {:a 1 :b 2 :c 3})
(:c 3 :b 2 :a 1)
user=>
On Sat, Nov 15, 2008 at 4:02 AM, Matthias Benkard <[EMAIL PROTECTED]> wrote:
>
> On 15 Nov., 05:17, samppi <[EMAIL PROTECTED]> wrote:
>> Fold isn't build into Clojure
>
> Isn't fold just clojure/reduce?
>
> Matthias
> >
>
--
The
On Fri, Nov 14, 2008 at 10:51 PM, Bradbev <[EMAIL PROTECTED]> wrote:
>
> I thought up an interesting issue the other night. If you map a
> function over a seq of refs, then change the refs & look at the map
> return value (which will convert it from lazy to ...? Hmm, what's the
> word - motivate
On 15 Nov., 00:31, samppi <[EMAIL PROTECTED]> wrote:
> Yeah, I surmised as much. The thing is, I'm writing a YAML library in
> Clojure, and YAML allows circular recursion like that:
>
> ---
> &x
> - 3
> - 2
> - 1
> - *x
>
> ...So I'm wondering what I should do if a document like that w
52 matches
Mail list logo