I just received the following announcement. I think a presentation on
Clojure could fit in well, so if someone geographically close and
competent is interested...
Konrad.
Begin forwarded message:
> Resent-From: [EMAIL PROTECTED]
> From: Jean Roman <[EMAIL PROTECTED]>
> Date: December 5, 20
On Dec 7, 2008, at 4:12 PM, prhlava wrote:
>
>
>> You're asking for the pipe to be repeatedly opened, one
>> uninterrupted glob of bytes read and processed and then the pipe
>> closed. Is that really what you intend?
>
> Yes, that was my intention, maybe a rethink is in order...
>
>> As writ
Hello Randall,
> If your application is client/server, you really should just go with an
> ordinary TCP connection (or, conceivably, a UDP port), define a proper
> protocol and do the whole thing properly.
This makes sense (if done right, the submitter can be invoked several
times in parallel a
On Dec 6, 11:12 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> I've moved pretty much all my spare-time projects over to clojure and
> it's been a pleasure so far. It's a nice piece of work. It seemed
> appropriate to say thanks for it. So thanks!
You're quite welcome!
Rich
--~--~-
Hello Samantha,
> Why not just stream it into a JDBC Blob to your database?
The "daemon" does more than just storing it in the database (it is
basicaly a postfix mail filter something like spamassassin in
principle, but does different things with the e-mails).
> Is there some reason the mai
+1 on all the thanks. I haven't had this much fun learning a new
language since school! You da' man Rich!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to clojure
On Sun, Dec 7, 2008 at 10:03 PM, Mark Engelberg <[EMAIL PROTECTED]>wrote:
>
> Thanks for all the info. I've searched my whole hard drive for a
> .emacs file, and can't find one. Can someone tell me where Clojure
> Box stores this file, or whether it's called something entirely
> different?
>
Cl
On Dec 7, 4:10 pm, Christophe Grand <[EMAIL PROTECTED]> wrote:
> Rich Hickey a écrit :> I think the problem is that in the original and
> subsequent versions,
> > work was being done in the current case that needn't be (checking the
> > status of coll), and that we need more laziness than lazy-
On Dec 7, 9:01 am, Mibu <[EMAIL PROTECTED]> wrote:
> Is it possible to remove the asserts in derive that restrict the
> parent and child to namespace-qualified names?
>
> It would be much more useful if the asserts are moved to the global-
> hierarchy case ([child parent]) and the "private" hier
On Dec 6, 7:52 pm, André Thieme <[EMAIL PROTECTED]> wrote:
> (for [x (range 1 20) :when (> x 8) :while (< 0 (rem x 13))] x) ==>
> java.lang.Exception: Unsupported binding form: :while
>
> But:
> (for [x (range 1 20) :when (> x 8)] x) ==>
> (9 10 11 12 13 14 15 16 17 18 19)
>
> And:
> (for [x (ra
I've got a Clojure library based around a custom data structure stored
in a struct. When printing I'd like to override the default string
output for structs, but I'm not sure how to implement the .toString
method used by (str ...) from Clojure. Anyone know how to do this?
It would be cool i
2008/12/8 [EMAIL PROTECTED] <[EMAIL PROTECTED]>
>
> +1 on all the thanks. I haven't had this much fun learning a new
> language since school! You da' man Rich!
>
I can see this is going to get gratuitous, but another thanks from me.
I spent a good part of the weekend changing over some Qt-Jamb
On Mon, Dec 8, 2008 at 9:05 AM, Rich Hickey <[EMAIL PROTECTED]> wrote:
>
> On Dec 7, 9:01 am, Mibu <[EMAIL PROTECTED]> wrote:
>> Is it possible to remove the asserts in derive that restrict the
>> parent and child to namespace-qualified names?
>>
>> It would be much more useful if the asserts are m
I'm working on a patch to add support for calling the superclass'
implementation of a method when overriding a method in Clojure with
ns/:genclass. This looks like it requires a modification of the
InstanceMethodExpr class in clojure.lang.Compiler. The proposed
syntax would be: (. super/
I had been dabbling in Common Lisp for awhile and finally purchased
LispWorks. Four days later(11-18-08) I discovered Clojure and was
captured. Since then I have spent over 90% of my time in learning
Clojure...Enclojure...Netbeans...Emacs...Clojure
Box...Java...Ant...etc.
Thanks Rich.
--~--~-
On Mon, Dec 8, 2008 at 9:06 AM, Rich Hickey <[EMAIL PROTECTED]> wrote:
>
> On Dec 6, 7:52 pm, André Thieme <[EMAIL PROTECTED]> wrote:
>> (for [x (range 1 20) :when (> x 8) :while (< 0 (rem x 13))] x) ==>
>> java.lang.Exception: Unsupported binding form: :while
>>
>> But:
>> (for [x (range 1 20) :w
I have some questions about the following:
(use '[clojure.contrib.str-utils :only (str-join)])
Why is the vector quoted? Is that because we need to quote everything
inside the vector? If so, what does it mean to quote the keyword
:only?
Why is the parameter to the use function a vector?
Why ca
2008/12/8 Matt Revelle <[EMAIL PROTECTED]>
>
> I'm working on a patch to add support for calling the superclass'
> implementation of a method when overriding a method in Clojure with
> ns/:genclass. This looks like it requires a modification of the
> InstanceMethodExpr class in clojure.lang.Compi
On Dec 8, 10:08 am, Chouser <[EMAIL PROTECTED]> wrote:
> On Mon, Dec 8, 2008 at 9:06 AM, Rich Hickey <[EMAIL PROTECTED]> wrote:
>
> > On Dec 6, 7:52 pm, André Thieme <[EMAIL PROTECTED]> wrote:
> >> (for [x (range 1 20) :when (> x 8) :while (< 0 (rem x 13))] x) ==>
> >> java.lang.Exception: Unsup
Hi,
On 8 Dez., 16:32, "Mark Volkmann" <[EMAIL PROTECTED]> wrote:
> I have some questions about the following:
>
> (use '[clojure.contrib.str-utils :only (str-join)])
>
> Why is the vector quoted? Is that because we need to quote everything
> inside the vector?
You don't have to quote the vector:
Hi all,
I have placed the sample code for _Programming Clojure_ on github, at
http://github.com/stuarthalloway/programming-clojure
. Most of the code samples now have unit tests, using Stuart Sierra's
test-is.
If you see an erratum in the book that you suspect was caused by
changes to Cloj
On Dec 8, 9:30 am, Matt Revelle <[EMAIL PROTECTED]> wrote:
> I'm working on a patch to add support for calling the superclass'
> implementation of a method when overriding a method in Clojure with
> ns/:genclass. This looks like it requires a modification of the
> InstanceMethodExpr class in cl
In clojure.contrib.seq-utils, partition-by & group-by have docstrings
following their arglists, so (doc parition-by) prints
-
clojure.contrib.seq-utils/partition-by
([f coll])
nil
nil
I'd submit a patch, but I'm sure it's easier if Stuart Sierra or
another of the contri
On Mon, Dec 8, 2008 at 9:45 AM, Meikel Brandmeyer <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> On 8 Dez., 16:32, "Mark Volkmann" <[EMAIL PROTECTED]> wrote:
>> I have some questions about the following:
>>
>> (use '[clojure.contrib.str-utils :only (str-join)])
>>
>> Why is the vector quoted? Is that beca
The original plan was to use the super keyword to signal that
invokespecial should be used. Now that you mention the lack of type
relationship, that problem is obvious. I suppose adding a :supers is
what I'll do.
-Matt
On Dec 8, 2008, at 10:59 AM, Rich Hickey wrote:
>
>
>
> On Dec 8, 9:
Hi,
On 8 Dez., 17:03, "Mark Volkmann" <[EMAIL PROTECTED]> wrote:
> I'm finding it a little difficult to remember all the allowed
> permutations. Hopefully over time this will become second nature for
> me, but I'm not there yet.
I'm sticking mostly with the way in your example. I structure my
:u
>
>> Alternatively, could I provide a "multi-
>> math" lib to redefine the core math functions?
>
> Type classes would be king.
Do you mean this in the Haskell sense? (I'm not too familiar with
those) Or something more like Java's types? I was thinking about how
to solve this problem more gen
Hi All,
It is working now. I found that I followed the instruction provided by
the author blindly, it was not meant for the windows box(vista) I am
using. The problem is on path separation, the book used forward slash
instead of backward slash.
The solution:
SET CLASSPATH=\clojure\clojure\clojure
I was wondering, since Emacs knows the file name (or at least the
buffer name) and line number it's sending a form from, and Clojure
represents that as meta-data (I think), could C-x C-e send that along
somehow wrapped in a form that sets these particular values for the
form that was shipped over?
On Mon, Dec 8, 2008 at 10:12 AM, Meikel Brandmeyer <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> On 8 Dez., 17:03, "Mark Volkmann" <[EMAIL PROTECTED]> wrote:
>> I'm finding it a little difficult to remember all the allowed
>> permutations. Hopefully over time this will become second nature for
>> me, but
On Monday 08 December 2008 08:17, janus wrote:
> ...
>
>
> However, I still get error when I try to do
> (require 'example.introduction)
> Error Message: Cloud not locate Clojure resource on classpath:
> example/introduction/introduction.clj
Then you haven't given or have given an incorrect path
Hi Emeka,
Two problems here:
(1) You are using an old version of Clojure. You will need to build
Clojure and Clojure-contrib from SVN in order to work through the book
examples.
(2) It is examples (plural) not example (singular).
Also, what version of the book are you working from? The mos
Has anybody else hit this?
I just did. Its not tricky to alter resultset-seq to return maps with
qualified keys:
(defn resultset-seq
"Creates and returns a lazy sequence of structmaps corresponding to
the rows in the java.sql.ResultSet rs"
[#^java.sql.ResultSet rs]
(let [rsmeta (. rs (g
Stuart
> (1) You are using an old version of Clojure. You will need to build
> Clojure and Clojure-contrib from SVN in order to work through the book
> examples.
When I tried (require 'clojure.contrib.str-utils)
I got 'nil' which shows that all is well. I downloaded the most recent
binary vers
On Mon, Dec 8, 2008 at 7:31 PM, janus <[EMAIL PROTECTED]> wrote:
>
> Stuart
>> (1) You are using an old version of Clojure. You will need to build
>> Clojure and Clojure-contrib from SVN in order to work through the book
>> examples.
> When I tried (require 'clojure.contrib.str-utils)
> I got 'nil
Dan Larkin <[EMAIL PROTECTED]> writes:
> It's been mentioned before but I'd like to see a planet.clojure.org à
> la the planet planet powered sites (http://www.planetplanet.org/).
I do a lot of work with feeds; I've been toying with the idea of porting
Planet to Clojure. We use the Rome feed par
Hello again,
I am trying to use java built in HttpServer and it looks that the
handle method of HttpHandler interface does not get called at all (but
the server "works" - returns a blank page, which is expected as I do
not write anything in the handle method).
The following example is minimal i
Oops,
The subject should have read:
java built in HTTP server, proxy and HttpHandler interface...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to clojure@googleg
Calling Java vararg functions seems to be less transparent in Clojure interop:
(String/format "%03d" 5)
java.lang.ClassCastException: java.lang.Integer cannot be cast to
[Ljava.lang.Object; (NO_SOURCE_FILE:0)
[Thrown class clojure.lang.Compiler$CompilerException]
while
(String/format "%03d"
On 8 déc, 17:14, Mark Fredrickson <[EMAIL PROTECTED]>
wrote:
> >> Alternatively, could I provide a "multi-
> >> math" lib to redefine the core math functions?
>
> > Type classes would be king.
>
> Do you mean this in the Haskell sense?
Yes : http://www.haskell.org/tutorial/classes.html
Haskell ma
On Dec 8, 2008, at 1:34 PM, Tom Emerson wrote:
I just wanted to make sure I wasn't missing something. Perhaps
something along the lines of
(defn format-string
[fmt & args]
(String/format fmt (to-array args)))
Hi Tom,
Good call on it being a convenient function to have around. It's
avail
On Monday 08 December 2008 10:53, Stephen C. Gilardi wrote:
> On Dec 8, 2008, at 1:34 PM, Tom Emerson wrote:
> > I just wanted to make sure I wasn't missing something. Perhaps
> > something along the lines of
> >
> > (defn format-string
> > [fmt & args]
> > (String/format fmt (to-array args)))
>
Okay, hacking complete. I've got a patch that extends the Clojure STM
so that it will make appropriate callouts to an external transaction
manager that cause the STMs transaction to be atomic/consistent/
isolated with respect to an external transaction, using a "dosync-
external" macro. Note tha
On Mon, Dec 8, 2008 at 10:42 AM, Rich Hickey <[EMAIL PROTECTED]> wrote:
>
> On Dec 8, 10:08 am, Chouser <[EMAIL PROTECTED]> wrote:
>>
>> doseq currently supports both. If both appear on the same binding,
>> the :while is always test first regardless of the order in which they
>> appear in the dos
On Mon, Dec 8, 2008 at 1:53 PM, Stephen C. Gilardi <[EMAIL PROTECTED]> wrote:
> Good call on it being a convenient function to have around. It's available
> as clojure.core/format. There's also printf along the same lines.
Steve, that is probably the most politely worded, "Read the API docs
you g
On Fri, Dec 5, 2008 at 9:22 AM, Randall R Schulz <[EMAIL PROTECTED]> wrote:
>
> On Thursday 04 December 2008 23:23, Meikel Brandmeyer wrote:
>> Hi,
>>
>> On 5 Dez., 00:38, Randall R Schulz <[EMAIL PROTECTED]> wrote:
>>
>> > And am I mistaken in my reading of the API docs for (defmulti ...)
>> > and
On Sun, Dec 7, 2008 at 10:51 AM, Stuart Sierra
<[EMAIL PROTECTED]> wrote:
>
> 1. More "is" predicates, including regular expressions and "thrown-
> with-msg?"
Great! Will the planned thrown-with-msg? support regex matching? I
used something like that in clojure.contrib.test-clojure.evaluation,
wh
Hi,
for one of the problems from Project Euler I implemented a "triangle
numbers" lazy sequence after the blueprint of the fibonacci numbers
sequence in clojure.contrib.lazy-seqs:. When taking large numbers of
items from this equence, I get an out-of-memory exception:
user=> (def triangle-numbe
> 2. "each=" and "all-true" are gone, replaced by the new macro "are",
> which works with any predicate:
> (are =
> 2 (+ 1 1)
> 4 (+ 2 2))
>
> -Stuart Sierra
Hello and thanks for additions!
Happy to see additions and work done on tests :-)
I just wonder - how do you define "all-
I've been toying with something similar. The approach I took was to
define multi-methods for the various operators:
(defmulti add class)
(defmulti sub class)
(defmulti mul class)
(defmulti div class)
...
Then I of course write the implementations for various different
types. Then, because the m
Well, it turns out that the following works, but it only prints the
"exchange" to stdout,
if the code is cut and pasted to the REPL but _not_ if run as .clj
script)...
(import
'(java.io IOException)
'(java.io OutputStream)
'(java.util Iterator)
'(java.util List)
'(java.util Set)
'(com.sun.
On Mon, Dec 8, 2008 at 3:40 PM, J. McConnell <[EMAIL PROTECTED]> wrote:
>
> Attached is a patch that adds doc-string and metadata support to
> defmulti. It does not generate arglists metadata automatically like
> defn does since the arglists are not supplied in the defmulti form as
> they are in d
I gave a small talk on Clojure this afternoon to my team. It went
well, and got the expected oohs and ahhs with respect to the potential
of software transactional memory. One question asked, though, was
about I/O in software transactions. It was clear to everyone why I/O
needed to be prohibitte
On Mon, Dec 8, 2008 at 5:18 PM, prhlava <[EMAIL PROTECTED]> wrote:
>
>
> Well, it turns out that the following works, but it only prints the
> "exchange" to stdout,
> if the code is cut and pasted to the REPL but _not_ if run as .clj
> script)...
I have gotten your example to work with a bit of r
Hi Dave,
It looks like LockingTransaction.getRunning would need to be made
public. What do you plan to do with it?
As a workaround:
(defn in-tx? [] (try (ensure (ref true)) (catch
IllegalStateException e false)))
Stuart
>
> I gave a small talk on Clojure this afternoon to my team. It w
> I have gotten your example to work with a bit of reading and
> modification (and thank you, I was after an example http server, this
> got me going):
A bit more hacking and it's possible to add/replace handlers after the
server has been started:
(import
'(java.io IOException OutputStream)
'
you're keeping the head of the sequence, and thus all the elements between
the head and nth.
it's because you're using def, basically.
if you make a function to return the sequence, and pass the result directly
to nth, without let-binding it or anything, it should work.
--~--~-~--~~-
On Dec 8, 2008, at 2:05 PM, Randall R Schulz wrote:
Correct me if I'm wrong or insufficiently aware of the relevant
issues,
but is it not the case that such a helper function has an easier job
for Format since it wants an array of Object. In other contexts, you
have to know what the type of t
On Mon, Dec 8, 2008 at 10:42 AM, Rich Hickey <[EMAIL PROTECTED]> wrote:
>
> On Dec 8, 10:08 am, Chouser <[EMAIL PROTECTED]> wrote:
>>
>> doseq currently supports both. If both appear on the same binding,
>> the :while is always test first regardless of the order in which they
>> appear in the dose
Hi Bill,
thank you for helping the beginners like me with the setup of emacs,
slime and clojure.
I tried first the official method described elsewhere on this forum -
ubuntu linux instructions.
Unsuccessful.
Following your instructions, the same issue, my linux emacs22 gets to
this point:
(add-cl
The basic use case is as a guard for I/O, to prevent them from from
filling the disk/spamming the network accidentally in case of
transaction live-lock. Probably a bit more paranoia than is idiomatic
in the dynamically-typed world, but there are domains where that's
necessary. The workaround is
Has anyone made progress on this bug?
The simplest form of the bug was this:
(defn splode [n]
(doseq [i (filter #(= % 20) (map inc (range n)))]))
This blows the heap, but it shouldn't.
I find this deeply troubling, because if this doesn't work, it
undermines my faith in the implementation of
On Mon, Dec 8, 2008 at 5:35 PM, Chouser <[EMAIL PROTECTED]> wrote:
>
> On Mon, Dec 8, 2008 at 3:40 PM, J. McConnell <[EMAIL PROTECTED]> wrote:
> >
> This is a breaking change for some (granted rather unsual) cases:
>
> (defmulti foo {:a 1 :b 2})
> (defmethod foo 1 [_] "got a1")
> (defmethod foo 2 [
On Mon, Dec 8, 2008 at 4:29 PM, mosi <[EMAIL PROTECTED]> wrote:
> thank you for helping the beginners like me with the setup of emacs,
> slime and clojure.
> I tried first the official method described elsewhere on this forum -
> ubuntu linux instructions.
> Unsuccessful.
> Following your instruct
Is there a place we should file an official bug, so that Rich and the
rest of the clojure people are aware of it? I imagine that they may
have read this thread, but I'm not sure if there is an "official"
process to make sure these things get addressed.
As I said in a previous reply, it's not clea
I share your concern about the LazyCons problem - hopefully Rich and
others are looking into this.
I have continued to experiment to see if I can gain some understanding
that might help with a solution.
The following is something I thought of today, and I'd like to see if
others get the same res
On Dec 8, 2008, at 7:45 PM, Mark Engelberg wrote:
I have an idea to try, but I'm not set up to build the java sources on
my computer, so maybe someone else can run with it:
This looked very promising to me. For one thing, I remembered that the
root of the big chain of LazyCons objects in me
On 8 déc, 23:13, "Michael Reid" <[EMAIL PROTECTED]> wrote:
> Then I of course write the implementations for various different
> types. Then, because the multi-method names don't look nice, I wrote a
> macro which transformed the regular operators into calls on the
> multi-methods, i.e.:
>
> (macr
On Dec 8, 2008, at 8:40 PM, Stephen C. Gilardi wrote:
This looked very promising to me. For one thing, I remembered that
the root of the big chain of LazyCons objects in memory (as
displayed by the YourKit profiler) was "f".
Now it's "r" and is listed as a "stack local".
--Steve
smime.
This talk was very informative, and I was glad for it. There were
several informative things in the talk that I haven't seen documented
anywhere (like the explanation of the thread pools backing (send ...)
vs (send-off ...)). But is there anyplace I could read this
information? Is there anyplac
I think I finally see the problem. The "rest expression" in filter's
call to lazy-cons has a reference to "coll" in it. That's all it takes
for coll to be retained during the entire calculation of the rest.
(defn filter
"Returns a lazy seq of the items in coll for which
(pred item) return
On Mon, Dec 8, 2008 at 5:56 PM, Stephen C. Gilardi <[EMAIL PROTECTED]> wrote:
> I think I finally see the problem. The "rest expression" in filter's call to
> lazy-cons has a reference to "coll" in it. That's all it takes for coll to
> be retained during the entire calculation of the rest.
>
Well
On Mon, Dec 8, 2008 at 5:56 PM, Stephen C. Gilardi <[EMAIL PROTECTED]> wrote:
> I think I finally see the problem. The "rest expression" in filter's call to
> lazy-cons has a reference to "coll" in it. That's all it takes for coll to
> be retained during the entire calculation of the rest.
>
Well
On Dec 8, 5:06 pm, "Frantisek Sodomka" <[EMAIL PROTECTED]>
wrote:
> I just wonder - how do you define "all-true" using "are"? Since "are"
> always makes pairs for predicate, it might not be possible.
Hi Frantisek,
The short answer is, you don't. :) Just use "is" for now. I'll
consider making
On Dec 8, 3:53 pm, "J. McConnell" <[EMAIL PROTECTED]> wrote:
> Great! Will the planned thrown-with-msg? support regex matching? I
> used something like that in clojure.contrib.test-clojure.evaluation,
> which was pretty handy.
Yes, that's where I got the idea.
-Stuart Sierra
--~--~-~--~-
On Mon, Dec 8, 2008 at 9:24 PM, Stuart Sierra
<[EMAIL PROTECTED]> wrote:
>
> On Dec 8, 3:53 pm, "J. McConnell" <[EMAIL PROTECTED]> wrote:
>> Great! Will the planned thrown-with-msg? support regex matching? I
>> used something like that in clojure.contrib.test-clojure.evaluation,
>> which was prett
Is there a primary website that provides documentation and examples of
using the various libraries in clojure-contrib? My googling efforts
have come up empty so far. I'm particularly interested in learning
more about test-is at the moment.
--
R. Mark Volkmann
Object Computing, Inc.
--~--~--
On Dec 8, 2008, at 8:56 PM, Stephen C. Gilardi wrote:
> I think I finally see the problem. The "rest expression" in filter's
> call to lazy-cons has a reference to "coll" in it. That's all it
> takes for coll to be retained during the entire calculation of the
> rest.
>
> (defn filter
> "
I agree that the ability to nest tests is important, but I'm not sure
encoding the nesting information in the test name is necessarily the
right way to go. Perhaps an intermediate step would be to define a
"test container" that, when executed, runs all the tests it contains.
With that foundation,
RSpec's contexts are for grouping tests—or defining specifications—for
a Ruby class:
describe Account do
it "should be able to withdraw money and reflect it in its balance"
do
...
end
end
...creates a test basically called "Account should be able to withdraw
money and reflect it in its b
The attached patch adds :super-methods option to generate-class as a
map, {local-name [name [param-types] return-type], ...}. The
mechanics work as Rich suggested in an earlier message, a method is
created that has the same type signature as the exposed method - it
loads the arguments, inv
I've uploaded the logo's glyph and added it to Clojure's article.
However, I'm wondering, Mr. Hickey—have you considered releasing the
language's logo under a free license? The language itself is under the
Common Public License; releasing its logo under another free license
is a logical step. If
Hey this looks great!
On Dec 7, 2008, at 10:51 AM, Stuart Sierra wrote:
>
> Hi folks,
...
>
> 2. "each=" and "all-true" are gone, replaced by the new macro "are",
> which works with any predicate:
>(are =
> 2 (+ 1 1)
> 4 (+ 2 2))
>
Just one bone to pick, though. The "are" macro d
83 matches
Mail list logo