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 half-done at best. It's
> better to focus on one project
On Nov 12, 4:47 am, Dave Newton <[EMAIL PROTECTED]> wrote:
> There's "terse", and there's "concise". I know you're attempting humor, but
> IMO there's a difference between "association"/"assoc" and "assoc"/"a" in the
> amount of information being lost in each pair. Nothing stopping anybody from
On Nov 12, 2:20 pm, "Brian Doyle" <[EMAIL PROTECTED]> wrote:
> I had to process each line of a very large file, 120MB,
> and did not want to read in the whole file at once. I
> wrote this function, chunk-file, that allows me to pass
> in a function and args that will process each line.
What hap
Another way to create a map is:
user=> (apply hash-map [:a 1 :b 2 :c 3])
{:a 1, :c 3, :b 2}
On Fri, Nov 14, 2008 at 9:42 PM, samppi <[EMAIL PROTECTED]> wrote:
>
> Excellent! I must remember about the apply function. Thank you very
> much.
>
> On Nov 14, 9:35 pm, "Kevin Downey" <[EMAIL PROTECTED
On Fri, Nov 14, 2008 at 8:33 PM, Kevin Downey <[EMAIL PROTECTED]> wrote:
> On Fri, Nov 14, 2008 at 8:17 PM, samppi <[EMAIL PROTECTED]> wrote:
>>
>> Yeah, I need to be able to do this to easily manage trees of maps. I
>> meant, how would you idiomatically implement their algorithms?
>>
>> Fold isn'
Excellent! I must remember about the apply function. Thank you very
much.
On Nov 14, 9:35 pm, "Kevin Downey" <[EMAIL PROTECTED]> wrote:
> On Fri, Nov 14, 2008 at 8:33 PM, Kevin Downey <[EMAIL PROTECTED]> wrote:
> > On Fri, Nov 14, 2008 at 8:17 PM, samppi <[EMAIL PROTECTED]> wrote:
>
> >> Yeah, I
On Fri, Nov 14, 2008 at 8:17 PM, samppi <[EMAIL PROTECTED]> wrote:
>
> Yeah, I need to be able to do this to easily manage trees of maps. I
> meant, how would you idiomatically implement their algorithms?
>
> Fold isn't build into Clojure, but they should still somehow be
> possible...right?
>
> O
Yeah, I need to be able to do this to easily manage trees of maps. I
meant, how would you idiomatically implement their algorithms?
Fold isn't build into Clojure, but they should still somehow be
possible...right?
On Nov 14, 9:12 pm, Michel Salim <[EMAIL PROTECTED]> wrote:
> On Nov 14, 10:56 pm,
On Nov 14, 10:56 pm, samppi <[EMAIL PROTECTED]> wrote:
> I'm trying to figure out how to do this:
>
> (flat-map-seq {:a 3, :b 1, :c 2}) ; returns (:a 3 :b 1 :c 2)
>
(defn flat-map-seq [m]
(if (empty? m) '()
(let [kv (first m)]
(lazy-cons (kv 0) (lazy-cons (kv 1) (flat-map-seq (rest
I'm trying to figure out how to do this:
(flat-map-seq {:a 3, :b 1, :c 2}) ; returns (:a 3 :b 1 :c 2)
...and vice versa:
(map-from-flat-collection {} [:a 3 :b 1 :c 2]) ; returns {:a 3, :b
1, :c 2}
Anyone have any idiomatic ideas?
--~--~-~--~~~---~--~~
You r
On Nov 15, 1:31 am, 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 tha
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
On Fri, Nov 14, 2008 at 9:22 PM, Howard Lewis Ship <[EMAIL PROTECTED]> wrote:
>
> On option I would like for the Repl is an option such that each
> evaluated expression that doe
On option I would like for the Repl is an option such that each
evaluated expression that does not define a new symbol itself, would
(nethertheless) bind a symbol. Many other Repl's for other languages
(such as, I believe, Scala) do this: the Repl identifies the bound
symbol and the value, not ju
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 were
loaded. Ah well, I'll worry about that later.
On Nov 14, 4:05 pm, no
you can have a collection that contains a ref to itself.
or you could cook something up with lazy-cons, having it produce a
copy of itself when needed. (this will be a lazy seq, though)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to t
On Nov 14, 5:48 pm, Chouser <[EMAIL PROTECTED]> wrote:
> On Fri, Nov 14, 2008 at 3:51 PM, Bradbev <[EMAIL PROTECTED]> wrote:
>
> > (which will convert it from lazy to ...? Hmm, what's the
> > word - motivated?)
>
> I think the word you want is "eager"
>
> http://www.zazzle.com/i_get_more_done_w
On Fri, Nov 14, 2008 at 5:19 PM, samppi <[EMAIL PROTECTED]> wrote:
>
> Would it be at all possible in Clojure for a collection to contain
> itself? For instance: [3 2 1 [3 2 1 [...]]].
Let's try!
user=> (def x [3 2 1])
#'user/x
user=> x
[3 2 1]
Great, now append it to itself:
user=> (conj x x)
On Fri, Nov 14, 2008 at 3:51 PM, Bradbev <[EMAIL PROTECTED]> wrote:
>
> (which will convert it from lazy to ...? Hmm, what's the
> word - motivated?)
I think the word you want is "eager"
http://www.zazzle.com/i_get_more_done_when_im_lazy_clojure_shirt-235544064302391169
--Chouser
--~--~--
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 - motivated?) then you will get the current value of the refs.
The example code is
(def
Would it be at all possible in Clojure for a collection to contain
itself? For instance: [3 2 1 [3 2 1 [...]]].
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to cl
On Nov 14, 4:09 pm, "Graham Fawcett" <[EMAIL PROTECTED]> wrote:
> On Fri, Nov 14, 2008 at 4:01 PM, Stephen C. Gilardi <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Nov 14, 2008, at 3:38 PM, Graham Fawcett wrote:
>
> > I'm sure there's a work-around, of course. The meta information is still
> > there:
Stuart,
On Friday 14 November 2008 12:05, Stuart Halloway wrote:
> Hi all,
>
> Make sure you update to Beta 2 of the book [1] and download the
> updated sample code. Also new: a running example (Lancet) throughout
> the book.
>
> AFAICT on a quick look all the Clojure-Contrib examples in the book
On Fri, Nov 14, 2008 at 4:01 PM, Stephen C. Gilardi <[EMAIL PROTECTED]> wrote:
>
> On Nov 14, 2008, at 3:38 PM, Graham Fawcett wrote:
>
> I'm sure there's a work-around, of course. The meta information is still
> there:
>
> This appears to be because the sources are no longer included in
> clojure
On Nov 14, 2008, at 3:38 PM, Graham Fawcett wrote:
> I'm sure there's a work-around, of course. The meta information is
> still there:
This appears to be because the sources are no longer included in
clojure.jar. I added "/src/clj"
to my classpath and now it works.
--Steve
--~--~---
I wonder if it would good to have something indicating the struct name
put in the metadata when creating a struct?
On Fri, Nov 14, 2008 at 1:42 PM, Chouser <[EMAIL PROTECTED]> wrote:
>
> On Fri, Nov 14, 2008 at 2:11 PM, Jeff Rose <[EMAIL PROTECTED]> wrote:
> > Does my dispatch function have to in
On Nov 14, 2008, at 3:11 PM, Howard Lewis Ship wrote:
> The point is, an exception that said something like:
>
> "Expected java.lang.Comparable but received :king" would have helped
> me unravel this much, much easier!
I agree. Clojure should give all the information it can about the
object(s)
On Fri, Nov 14, 2008 at 2:11 PM, Jeff Rose <[EMAIL PROTECTED]> wrote:
> Does my dispatch function have to inspect the passed in values to
> figure out which type of struct they are, or can I query that
> somehow?
My understanding is that StructMaps are just Maps with an
implementation that's opti
On Fri, Nov 14, 2008 at 2:37 PM, Rich Hickey <[EMAIL PROTECTED]> wrote:
>
>
>
> On Nov 14, 12:51 pm, "Stuart Sierra" <[EMAIL PROTECTED]>
> wrote:
>> Patch attached. This precompiles everything except parallel.clj,
>> which requires an extra Jar. It also omits the source .clj files from
>> the cl
I will be giving two talks comparing Clojure with other Java.next
languages tomorrow at the Rocky Mountain Software Symposium [1]
tomorrow.
Cheers,
Stuart
[1] http://www.nofluffjuststuff.com/conference/denver/2008/11/schedule.html
--~--~-~--~~~---~--~~
You
As a new developer to Clojure, coming from a strong Java/OO background
and NOT a functional one, I'd like to make a few observations.
One challenge to new developers are exception messages generated by
Clojure. I'm seeing a lot of ClassCastExceptions:
cribbage=> (sort-by card-order (take 11 deck
Hi all,
Make sure you update to Beta 2 of the book [1] and download the
updated sample code. Also new: a running example (Lancet) throughout
the book.
AFAICT on a quick look all the Clojure-Contrib examples in the book
already work, using latest head. Nice work Steve!
Cheers,
Stuart
[1]
Ok, will submit a patch for this early next week.
Current plan is to use a properties file (versioninfo.properties) that
will be generated from the ant build script and contain the release
version/name, the source repository, a revision indicator (number,
tag, or digest), and who built it.
On Nov 14, 12:51 pm, "Stuart Sierra" <[EMAIL PROTECTED]>
wrote:
> Patch attached. This precompiles everything except parallel.clj,
> which requires an extra Jar. It also omits the source .clj files from
> the clojure.jar file.
> -Stuart Sierra
Patch applied (svn 1101) - thanks!
Rich
--~--~
Hi,
I'm working on a library where I'd like to be able to dispatch off of
whether the arguments are one of a number of different possible structs.
I've created a custom hierarchy and everything makes sense with derive
etc., but I don't understand how I convert from input values to the
sym
On Fri, Nov 14, 2008 at 12:16 PM, Howard Lewis Ship <[EMAIL PROTECTED]> wrote:
>
> Is this mailing list the correct place to report bugs? The bug list
> on the SF page looks pretty sparse.
Yes, this is a fine place to report bugs.
--Chouser
--~--~-~--~~~---~--~~
In the latest SVN revision, there are both core-proxy.clj and proxy.clj
files in src\clj\clojure.
Is this intentional?
Frantisek
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this
> Such a specification looks a lot like a set of unit tests, though I'm
> sure you may push it beyond. Thus, I think it might be nice if these
> specification clauses could be set as metadata to the function as
> well, and yet register to your check-on-load system. The
> clojure.contrib.test-is
Patch attached. This precompiles everything except parallel.clj,
which requires an extra Jar. It also omits the source .clj files from
the clojure.jar file.
-Stuart Sierra
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Gro
On Nov 14, 4:51 am, Zak Wilson <[EMAIL PROTECTED]> wrote:
> It's currently possible to compile the files and rebuild the jar. It
> does result in a faster startup time.
I can confirm -- precompiling the core classes cuts startup time in
half:
WITHOUT precompiling:
real 4.489
user 6.612
sys 0.441
Is this mailing list the correct place to report bugs? The bug list
on the SF page looks pretty sparse.
--
Howard M. Lewis Ship
Creator Apache Tapestry and Apache HiveMind
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
There's no way to check types at compile time?
(defn len2 [#^String x]
(. x (length)))
(defn wrong [] (len2 10))
Would be good if you could find such errors at compile time.
Optional static typing =)
Regards.
Islon
On 12 nov, 21:43, Rich Hickey <[EMAIL PROTECTED]> wrote:
> On Nov 12, 7:21 p
On Sat, Nov 8, 2008 at 12:03 PM, Matt Revelle <[EMAIL PROTECTED]> wrote:
>
> If marking SVN revisions and/or release versions is something we still
> want and want automated, it now looks like using the build tool is the
> only way to go. The example I sent earlier to the list includes the
> crea
On Nov 14, 2008, at 11:21 AM, [EMAIL PROTECTED] wrote:
> Okay, maybe I have not caught on the semantics of (use) and (refer).
> Let me extend my example a bit.
>
> File home/a.clj:
>
> (ns home.a
> (:refer-clojure :exclude (load)))
>
> (defn load [] 'my-load)
> (defn other-fn [] 'other-fn)
>
> T
> user=> (use :verbose ['home.a :as 'a])
Now, I understand what was wrong: I did not want the semantics of
(use), I wanted those of (require). The [... :as ...] form I
mentioned is supported by (require), not (use).
Thank you again for getting through this with me, Chouser.
--~--~-~--~-
These are great changes!!
I see a bright future ahead.
Thanks Rich.
On 14 nov, 11:53, MikeM <[EMAIL PROTECTED]> wrote:
> > Just lift your files up a directory to accommodate this change. Note
> > that this implies that all namespaces should have at least 2 segments,
> > and following the Java pa
Okay, maybe I have not caught on the semantics of (use) and (refer).
Let me extend my example a bit.
File home/a.clj:
(ns home.a
(:refer-clojure :exclude (load)))
(defn load [] 'my-load)
(defn other-fn [] 'other-fn)
Then, I start a fresh REPL and:
user=> (use :verbose ['home.a :as 'a])
(clo
On Fri, Nov 14, 2008 at 10:26 AM, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
> No, it doesn't work. The same error message is displayed.
Make sure you have a clean namespace, that you haven't already
"refer"ed load into 'a. This works for me on Clojure SVN revision
1099:
In file a.clj:
(ns
I see. Yes, I downloaded the latest release on SourceForge, version
20080916. I don't know how to use SVN so I can't get the bleeding
edge, but it's okay. I was just puzzled.
Thanks for answering!
On Nov 14, 8:09 am, Chouser <[EMAIL PROTECTED]> wrote:
> On Fri, Nov 14, 2008 at 10:04 AM, samppi
On Fri, Nov 14, 2008 at 4:43 PM, Mark Volkmann
<[EMAIL PROTECTED]> wrote:
>
> In the Getting Started section of the wiki it says "Press Ctrl+C to
> get out of it."
> Shouldn't that be Ctrl+D? That works for me on a Mac and seems cleaner.
Ctrl+D works on Unix.
I am pretty sure I have used the equi
> That's true only if you use the :refer-clojure (all one keyword):
>
> (ns a (:refer-clojure :exclude (load)))
No, it doesn't work. The same error message is displayed.
It is the same for the clojure.contrib.mmap and clojure.contrib.zip-
filter libraries, which have a (:refer-clojure :exclude
In the Getting Started section of the wiki it says "Press Ctrl+C to
get out of it."
Shouldn't that be Ctrl+D? That works for me on a Mac and seems cleaner.
--
R. Mark Volkmann
Object Computing, Inc.
--~--~-~--~~~---~--~~
You received this message because you are
On Fri, Nov 14, 2008 at 9:52 AM, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
> I thought the :refer clause of the (ns) form would effectively remove
> the clojure.core/load mapping to load within my namespace. Is this a
> bug?
That's true only if you use the :refer-clojure (all one keyword):
On Fri, Nov 14, 2008 at 10:04 AM, samppi <[EMAIL PROTECTED]> wrote:
>
> On the type chart (http://clojure.googlegroups.com/web/chart.png?
> gda=ODsxtzsAAABoLitVpBTEcNIQc_NHg39S4VDJlSuqwy9lITiADmvt9Suq-
> FEWrXmgYiTWWcOQKecGRdr3QrylPkw2aRbXD_gF), it indicates that ISeq
> implements Sequential. So w
On the type chart (http://clojure.googlegroups.com/web/chart.png?
gda=ODsxtzsAAABoLitVpBTEcNIQc_NHg39S4VDJlSuqwy9lITiADmvt9Suq-
FEWrXmgYiTWWcOQKecGRdr3QrylPkw2aRbXD_gF), it indicates that ISeq
implements Sequential. So why is this false?
(isa? clojure.lang.ISeq clojure.lang.Sequential)
Inciden
By the way, I am using clojure r1099, porting my stuff (which use to
work) across the breaking changes of r1098.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to cl
> Just lift your files up a directory to accommodate this change. Note
> that this implies that all namespaces should have at least 2 segments,
> and following the Java package name guidelines, e.g.
> com.mydomain.mylib, is recommended.
>
I notice that the user namespace is still one segment "us
Hello all,
I want to name a function of mine "load" in my namespace home.a. The
contents of a.clj (in the home directory in one of the root
directories of my CLASSPATH, as expected) is
(ns a
(:refer clojure.core :exclude (load)))
(defn load [] 'value)
When I (use 'home.a) from the REPL, I g
On Mon, Nov 10, 2008 at 2:42 AM, Toralf Wittner <[EMAIL PROTECTED]>wrote:
> Dear list members,
>
> There is a small problem with unicode escapes in Clojure strings. When
> StringReader encounters a unicode escape it checks Character.isDigit
> which is only true for decimal digits, but not hexadeci
Hello,
> (defspec + ; Shows we are defining a specification for
> the + function
> ([] (= value 0)) ; Verify that (+) => 0
> ([1] (= value 1)) ; Verify that (+ 1) => 1
> ([1 2 3] (= value 6)) ; Verify that (+ 1 2 3) => 6
> ([1 'a] ; Verify that (+ 1 'a)
On Nov 14, 4:51 am, Zak Wilson <[EMAIL PROTECTED]> wrote:
> It's currently possible to compile the files and rebuild the jar. It
> does result in a faster startup time.
>
> There doesn't seem to be a way to generate precompiled class files
> with main methods at this point. Is there any reason s
On Nov 14, 4:21 am, Parth Malwankar <[EMAIL PROTECTED]> wrote:
> On Nov 13, 11:43 pm, Rich Hickey <[EMAIL PROTECTED]> wrote:
>
> > We're coming around the other side of the few breaking changes I
> > wanted to get done before release 1.0.
>
> > The changes are:
>
> > New regex format:
>
> >http:
It's currently possible to compile the files and rebuild the jar. It
does result in a faster startup time.
There doesn't seem to be a way to generate precompiled class files
with main methods at this point. Is there any reason such
functionality can't be added? Right now, if I want an executable
On Nov 13, 11:43 pm, Rich Hickey <[EMAIL PROTECTED]> wrote:
> We're coming around the other side of the few breaking changes I
> wanted to get done before release 1.0.
>
> The changes are:
>
> New regex format:
>
> http://groups.google.com/group/clojure/msg/eddd7f0d292da683
>
> Uniform binding s
On Nov 14, 9:47 am, Rich Hickey <[EMAIL PROTECTED]> wrote:
> On Nov 13, 11:20 pm, Parth Malwankar <[EMAIL PROTECTED]>
> wrote:
>
> > Hello,
>
> > While setting ns to clojure.zip, I get the following error:
>
> > user=> (ns clojure.zip)
> > java.lang.IllegalStateException: replace already refers
64 matches
Mail list logo