Thanks, that looks promising. Presumably I'll have to figure
out how to compile that into a proper class file, and feed it
some root object in the environment that calls instantiates it.
--~--~-~--~~~---~--~~
You received this message because you are subscribed
On Wed, Sep 16, 2009 at 6:13 AM, Krukow wrote:
> On Sep 15, 10:23 pm, Mark Volkmann wrote:
> > I think the problem is that you only ensure one of the Refs. If you
> > want to make sure that a condition between multiple Refs isn't
> > violated, you need to sure all of them. Otherwise other transa
On Sep 16, 12:32 am, Timothy Pratley wrote:
> I ran program #1 and #2 on Clojure 1.1.0-alpha-SNAPSHOT from git
> -> program #1 output skew
> -> program #2 no output
>
> What version are you using? Could be something that's been fixed
> recently.
I was running a fairly recent, but not the lates
On Sep 15, 10:23 pm, Mark Volkmann wrote:
> I think the problem is that you only ensure one of the Refs. If you
> want to make sure that a condition between multiple Refs isn't
> violated, you need to sure all of them. Otherwise other transactions
> will be free to modify the Refs that aren't e
Thank you all for your input. I think I will follow Stuart's advice
and go with something like the following, again using the example data
above.
(use 'clojure.set)
(def policies (ref #{{:id 3 :name "x" :holder 7 :vehicle 11}
{:id 4 :name "y" :holder 2 :vehicle
12}}
On Sep 15, 6:54 am, Dragan Djuric wrote:
> Ha, ha, some object-oriented lessons are being rediscovered :)))
Precisely! Just because the language doesn't enforce information
hiding doesn't mean you can't do it.
-SS
--~--~-~--~~~---~--~~
You received this message
unwind-protect is indeed a Common Lisp form, not Clojure. It ensures
that a given piece of code is always executed, even when an error or
some other condition causes the code to exit early.
In Clojure (and Java), the nearest equivalent is the try-catch-finally
block. It looks like this:
(try
I ran program #1 and #2 on Clojure 1.1.0-alpha-SNAPSHOT from git
-> program #1 output skew
-> program #2 no output
What version are you using? Could be something that's been fixed
recently.
On Sep 16, 6:14 am, Krukow wrote:
> After a discussion in dcug about the write-skew anomaly, I wanted t
2009/9/15 Gorsal :
>
> Ah, I thought there was a contrib out there for unwind-protect . I
> guess its so trivial that no one wrote it. lol.
There's error-kit:
http://richhickey.github.com/clojure-contrib/error-kit-api.html
Not sure how much that is or is not like unwind-protect.
--
Michael Woo
> I'm visiting from the Common Lisp world and I'm wondering if Clojure's
> multimethods support method combination? (Please forgive me if this
> has already been asked and just direct me to the relevant
> documentation.)
Discussed previously:
http://groups.google.com/group/clojure/browse_thread/
repl.clj in the files section of the group is exactly what you want.
--~--~-~--~~~---~--~~
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 n
Hi,
I'm visiting from the Common Lisp world and I'm wondering if Clojure's
multimethods support method combination? (Please forgive me if this
has already been asked and just direct me to the relevant
documentation.)
Here's a contrived example. B derives from A and both have methods
defined for
I've been looking for a Clojure REPL loop in a java window, the
general idea is to use it as an ad-hoc inspector for existing java
programs. Does this already exist?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "
On Tue, Sep 15, 2009 at 3:23 PM, Mark Volkmann
wrote:
> I think the problem is that you only ensure one of the Refs. If you
> want to make sure that a condition between multiple Refs isn't
> violated, you need to sure
I meant "ensure" instead of "sure".
> all of them. Otherwise other transactio
I think the problem is that you only ensure one of the Refs. If you
want to make sure that a condition between multiple Refs isn't
violated, you need to sure all of them. Otherwise other transactions
will be free to modify the Refs that aren't ensured.
On Tue, Sep 15, 2009 at 3:14 PM, Krukow wro
On Sep 15, 9:27 am, CuppoJava wrote:
> Yes. I haven't personally run into any problems (since I handle my own
> threading), but it's explicitly stated that you shouldn't put mutable
> data into Clojure's immutable data structures. It's possible that I
> misunderstood what is meant by this. It wou
After a discussion in dcug about the write-skew anomaly, I wanted to
write a program exhibiting the anomaly, together with a similar
program using ensure to eliminate it.
My program doesn't work: it exhibits the anomaly, but ensure doesn't
fix it, and neither does adding a validator to the refs.
I'll make a note on the wiki to chmod the scripts in Unix. I'm not
sure what else I can do. I swear I tested all of this on my Mac.
-Matt
On Sep 15, 10:17 am, Stuart Halloway
wrote:
> The bigger problem here is that the ant jar task loses file
> permissions, so after Conjure expands the file
On Tue, Sep 15, 2009 at 21:47, Brian Hurt wrote:
>
> The API documentation:
> http://clojure.org/data_structures#toc22
>
> mentions the existence of the basic set operations of union, intersection,
> and difference. But these functions don't seem to exist anymore (including
> in the version of c
Ah, I thought there was a contrib out there for unwind-protect . I
guess its so trivial that no one wrote it. lol.
On Sep 15, 12:25 pm, Joost wrote:
> On 15 sep, 18:19, Jarkko Oranen wrote:
>
> > Unwind-protect? Isn't that a Common Lisp thing? Sounds like you got
> > the wrong mailing list :)
>
> The API documentation:
> http://clojure.org/data_structures#toc22
>
> mentions the existence of the basic set operations of union,
> intersection, and difference. But these functions don't seem to
> exist anymore (including in the version of clojure I pulled from
> github about five minut
The API documentation:
http://clojure.org/data_structures#toc22
mentions the existence of the basic set operations of union, intersection,
and difference. But these functions don't seem to exist anymore (including
in the version of clojure I pulled from github about five minutes ago). I
was just
On Tue, Sep 15, 2009 at 2:08 PM, Sir Diddymus wrote:
>
> Dear all,
>
> I've successfully extended a Java class (:gen-class and :extends) and
> all is working as expected, until I was forced to call a protected
> final method of the superclass from within my derived class. I don't
> seem find a wa
Dear all,
I've successfully extended a Java class (:gen-class and :extends) and
all is working as expected, until I was forced to call a protected
final method of the superclass from within my derived class. I don't
seem find a way to do this (:exposes-methods really is only for
overridden method
> Although I still don't understand why the current working directory
> can cause such problems (shouldn't Java be able to make proper use of
> the classpath?), my problem has been solved.
Because the compilation of Clojure files produces files in *compile-
path* ("classes" by default), which is
On 15 sep, 18:19, Jarkko Oranen wrote:
> Unwind-protect? Isn't that a Common Lisp thing? Sounds like you got
> the wrong mailing list :)
You may be right :)
> It's true though that Clojure has no return, break or continue... They
> are imperative constructs, and Clojure is mostly functional. As
On 14 Wrz, 20:06, Richard Newman wrote:
> > Nope, it's not that easy. I changed "clojure.example.hello" to
> > "clojure.examples.hello" in the hello.clj file, and the message was
> > still the same. (Hard to believe, isn't it?)
>
> What's the value of *compile-path*? Is it in your classpath?
In
On 14 Wrz, 19:51, Michael Wood wrote:
> (...)
> What does your "runclojure" script look like?
Yes, that's the point. If the problem isn't in the Clojure itself, nor
in the source file, and the files are placed exactly where they should
be, the only possibility is the script used to run Clojure.
Yes. I haven't personally run into any problems (since I handle my own
threading), but it's explicitly stated that you shouldn't put mutable
data into Clojure's immutable data structures. It's possible that I
misunderstood what is meant by this. It would be best to ask someone
who's familiar with
On Sep 15, 6:54 pm, Gorsal wrote:
> I was just wondering about the unwind-protect form, I've heard that it
> doesn't protect against certain types of exits, but what exactly are
> these exits? I've heard return, break, and continue statements said
> but i can't seem to find these statements in c
I was just wondering about the unwind-protect form, I've heard that it
doesn't protect against certain types of exits, but what exactly are
these exits? I've heard return, break, and continue statements said
but i can't seem to find these statements in clojure. Any examples?
--~--~-~--~---
Out of curiosity I implemented an option for parallel processing
single thread: "Elapsed time: 39.275432 msecs"
parallel: "Elapsed time: 271.072837 msecs"
Ouch! I guess all that merging was a bad idea :) Obviously mutating in
place would get around that, I could use an unprotected java array as
th
The bigger problem here is that the ant jar task loses file
permissions, so after Conjure expands the file structure to create a
project Unix users will have to chmod u+x any files that are scripts.
I looked at it for about 10 seconds and decided it wasn't easily
fixable without going away
Fixed in the main branch. Stu made the change on his fork, and I
merged it in.
-Matt
On Sep 14, 2:52 pm, Jim Menard wrote:
> Matt,
>
> There's a missing double quote on line 11 of lancet.sh. After adding
> that, I had no problem compiling Conjure. Looking forward to trying
> it.
>
> Jim
--~--~
That's my plan for the next release. Unfortunately, the change to test-
is came out right before I finished the release. After reviewing what
it would take to update, I decided to wait.
If you make the changes on your fork, I'll be happy to merge them in.
-Matt
On Sep 14, 11:31 am, Stuart Hallo
On Tue, Sep 15, 2009 at 7:15 AM, Rick Moynihan wrote:
>
> Hi all,
>
> I'm looking at extending a java class in clojure, however I can't find
> any mention of how to access or change state within my super class
> object e.g. given a java class like this:
>
> public class Foo {
> protected int fo
I thought it would be interesting to make a version which spits out
the paths:
http://github.com/timothypratley/strive/blob/master/clj/sandpit/fw.clj
shortest-path 7 2:
({:node 7, :step-cost 0, :remaining-cost 6}
{:node 8, :step-cost 1, :remaining-cost 5}
{:node 6, :step-cost 1, :remaining-cost
> [snip]
>
> You are "accumulating" a result, which hints us at 'reduce.
> And 'for provides the nested enumeration:
>
> (defn floyd-warshall2 [{:keys [nodes distances]}]
> (reduce (fn [[distances prevs] [k x y]]
> (let [d (+ (distances [x k] Double/POSITIVE_INFINITY)
>
Hi all,
I'm looking at extending a java class in clojure, however I can't find
any mention of how to access or change state within my super class
object e.g. given a java class like this:
public class Foo {
protected int foo = 10;
// ...
}
How can I write the equivalent of this in clojure
Ha, ha, some object-oriented lessons are being rediscovered :)))
> For example, you would have an opaque "Person" object, perhaps in a
> Ref, and functions like get-name, set-name, get-policy, etc. The
> underlying storage model can be whatever you want -- sets, SQL,
> files, You just have
40 matches
Mail list logo