2010/6/12 Dan Larkin
> Does anyone have insight as to the reasoning here? Is it a bug? If it's
> intended behavior is there something I can do to circumvent it?
>
I do think this is intentional.
Agents "holding on" to their sends until its state transition function is
done can be a useful thing
Hi,
On Jun 16, 12:56 pm, Rasmus Svensson wrote:
> One solution to the sleep problem could perhaps be to let the agent send
> this to it self:
>
> (fn [state millis]
> (Thread/sleep millis)
> state)
With this one has to keep in mind, that maybe someone else has already
sent another action to
Yup, I think the transactional semantics are the main cause of this behavior.
Aren't send and send-off doing the same thing during a "real"
transaction in a ref? To fight the issue of repeating send if the
transaction gets retried.
On Wed, Jun 16, 2010 at 1:05 PM, Meikel Brandmeyer wrote:
> Hi,
>
Hi Rob,
Thanks for tracking this down. If you will execute a CA [1], I would love to
get a patch (with tests) that fixes this. I have created a ticket at [2] to
track it.
I would prefer something along the lines of the simpler fix shown below, unless
anybody pops up on this thread with a real-
Thanks James.
If any one else is as new to functional stuff as me then I found this
in Paul Graham's book which enables me to reason logically about the
matter (hopefully)
"A good compiler can compile a tail call into a goto, and so can
compile a tail recursive function into a loop. In typical ma
Gwt-Clojure is a subset of the Clojure language which was developed
for scripting GWT (Google Windows Toolkit) widgets in the browser
environment. It is designed to be able to share code with Clojure
running on the server.
The current deployment size is about 145kb of Javascript - including
the in
On Tue, Jun 15, 2010 at 12:23 PM, Shawn Hoover wrote:
>
> On Tue, Jun 15, 2010 at 12:01 PM, Ryan Waters wrote:
>>
>> I'm working with the code at the following gist and also pasted below:
>>
>> http://gist.github.com/421550
>>
>> I'd like to have execution of a separate thread (agent) continue
>>
Thank you for pointing that out. I notice your style is similar to
Rich's in his ant.clj [1] which seems like the kind of solution that
might be used in other functional and/or lisp languages. Do you know
if that's the case with self-calling functions and agents? However,
isn't there more overhe
Mathematicians traditionally use i and engineers traditionally use j to
represent the square root of -1. Travis undoubtedly wanted to keep both
happy.
--
Eric Krohn
> Sorry I may have missed the reason for this earlier: What's the
> reason for allowing both 'i' and 'j' to indicate the imaginar
Thanks, very helpful. I hadn't heard of clutch before your
announcement, so I appreciate the introduction. The clojure view
server sounds especially interesting!
Jim
On Tue, Jun 15, 2010 at 12:51 PM, Chas Emerick wrote:
> Last I looked (and it appears to be the same way after a quick glance ju
We Electrical Engineers are quite annoying in this regard, but
historically, there is much variation out there: Python uses "j",
MATLAB accepts i or j. Apache Commons allows the user to specify the
specific character to use, but defaults to "i" I believe. Eventually,
I would suggest this be a local
Here's my awful terrible code which is a direct translation from a
java version I wrote and needs a fast functional sieve: I prefer
Cristophe Grande's.
http://clj-me.cgrand.net/index.php?s=Everybody%20loves%20the%20Sieve%20of%20Eratosthenes
The one in contrib is pretty good as well.
(letfn [(n
The problems are real. Well done!
--
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 new members are moderated - please be patient with your
first post.
To unsubscribe fr
Another apporach I think would be modifying the data structure of
hierarchy itself. The idea is to add a counter to ancestors and
descendants.
:ancestors: { :c #{ [:a1 1] [:a2 2] } }
So, the counter 2 on :a2 means how many paths can you get :c to
reach :a2. When the counter reaches 0, you can remov
On Wed, Jun 16, 2010 at 12:17 AM, Christophe Grand
wrote:
> Hi Ryan,
>
> On Tue, Jun 15, 2010 at 6:01 PM, Ryan Waters wrote:
>> I'm working with the code at the following gist and also pasted below:
>>
>> http://gist.github.com/421550
>>
>> I'd like to have execution of a separate thread (agent)
Yeah, it's intended, just like what Ulrich showed. The same comment
appears on the doc of release-pending-sends.
In your case, the inner send-off doesn't rely on the result of the
outter send-off. So, you can use release-pending-sends.
The following code will have "hey" printed right away.
(send
There's a canonical intro on how to call or embed Clojure into Java:
http://en.wikibooks.org/wiki/Clojure_Programming/Tutorials_and_Tips#Invoking_Clojure_from_Java
While this is a great introduction, the only thing Java passes in to
Clojure here is a string. I've tried methods where Java passes in
Thanks for the reply. I wasn't trying to be critical. I have a similar
situation where I'm using an atom instead of a ref, and wanted to make sure
I wasn't missing anything in my understanding of refs vs. atoms.
I am using clojure-http currently and it works quite well, thank you! It's
very eas
Hi,
Am 15.06.2010 um 23:27 schrieb Ryan Waters:
> Thank you for pointing that out. I notice your style is similar to
> Rich's in his ant.clj [1] which seems like the kind of solution that
> might be used in other functional and/or lisp languages. Do you know
> if that's the case with self-calli
On Wed, Jun 16, 2010 at 10:20 PM, Meikel Brandmeyer wrote:
> The typical solution for your problem would probably be:
>
> (->> long-running-function-with-recur Thread. .start)
>
> This starts you function in a dedicated thread and you can save the overhead
> of send-off and use recur directly. I'
Hi,
Am 16.06.2010 um 22:34 schrieb Christophe Grand:
> I agree, it still feels a little dirty to use a future without caring
> about the return value but on the positive said you get an easy way to
> block and wait for the tread to finish (deref) and you also get
> future-done?, future-cancel and
That looks really cool. I want to do some webstuff with clojure soon
and I have to look at your stuff more then and I have to read a bit
about GWT never heard of it until now.
On 15 Jun., 20:48, pfisk wrote:
> Gwt-Clojure is a subset of the Clojure language which was developed
> for scripting GWT
Hi Stuart,
I'll be mailing the agreement later today, and I'll work on a patch
shortly. I've noticed that the unit tests file for multi-methods,
where tests for derive and underive would be located, is essentially
empty. So I thought I might put some tests in there for isa, parents,
ancestors, e
Starting from scratch, both to try it myself and to know what to tell my
students in the fall, when I'll want them all (regardless of background) to be
able to set up a reasonable Clojure environment without hassles. I've never
previously used netbeans. I'm doing this on a Mac running MacOS 10.
I like the reference counting idea, YD. I don't think that we want to
go that route, though, if underive will be called comparatively rarely
by most people. But it would be a good way to do it if that
performance were needed.
Rob
On Jun 15, 10:39 pm, YD wrote:
> Another apporach I think would
Which version of NetBeans did you install? Version 6.9 (the version
linked to on the netbeans.org front page) was released very recently.
It's unlikely that Enclojure has been updated for NetBeans 6.9.
On Jun 16, 5:29 pm, Lee Spector wrote:
> Starting from scratch, both to try it myself and to kn
Hi,
On Jun 17, 12:29 am, Lee Spector wrote:
> - Go to the 'Avalilable Plugins' tab and select the "Enclojure Clojure Plugin
> and click Install
>
> When I do it fails with the following messages:
>
> -
> Some plugins require plugin Common Scripting Language API (new) to be
> installed.
I h
Neat!
I'm currently writting a webapp with GWT for the browser client, and
clojure on the server... What is your approach to doing this, and is
the code available anywhere yet?
R.
On 15 June 2010 19:48, pfisk wrote:
> Gwt-Clojure is a subset of the Clojure language which was developed
> for scr
Given:
(defn foo [x & {:as args}] [x args])
(foo 1 :bar 2 :baz [:quux])
=> [1 {:bar 2, :baz [:quux]}]
If I have those rest-arguments already in a map, what's the most
elegant way to call foo with them?
(def args {:bar 2 :baz [:quux]})
(foo 1 ?)
I feel like I may be missing some simple way o
I'm using NetBeans 6.9, which is just what happened to be there when I went to
try this today.
Maybe I should be trying a different environment if this is going to depend on
the netbeans version or require more manual installation.
I'm hoping to find something that doesn't require manual git
You need to pass in a PersistentVector of PersistentVector's. It's in
clojure.lang and there are a number of static creation methods.
On Jun 16, 9:37 am, allie wrote:
> There's a canonical intro on how to call or embed Clojure into
> Java:http://en.wikibooks.org/wiki/Clojure_Programming/Tutoria
Actually, just look at the main method (for testing) which has been
commented out at the bottom - that will show you a better way to
create and use it.
On Jun 16, 9:37 am, allie wrote:
> There's a canonical intro on how to call or embed Clojure into
> Java:http://en.wikibooks.org/wiki/Clojure_Pr
Do you really need a Clojure vector-of-vectors, or do you just want an indexed
collection of indexed collections? If the latter, you can simply use Java
arrays, or ArrayMaps.
; build a collection a Java programmer might have made
; (I am not really going to go into Java just for an example... :
There's a disconnect between the function definition and the
datastructures used by the caller.
Either fix the data structure:
(def args [:bar 2 :baz [:quux]])
then use apply
Or change the function definition to take a map:
(defn foo [x {:keys [bar baz]}]
...)
On Jun 16, 4:00 pm, Brian Carpe
-- CallClojure.java --
import clojure.lang.RT;
import clojure.lang.Var;
import clojure.lang.PersistentVector;
public class CallClojure {
static PersistentVector toVec(int[][] arr) {
PersistentVector pv = PersistentVector.EMPTY;
for (int[] a : arr) {
Persist
Ah thanks for pointing out release-pending-sends, I didn't know about that;
it's exactly what I need in my case.
On Jun 16, 2010, at 9:52 AM, YD wrote:
> Yeah, it's intended, just like what Ulrich showed. The same comment
> appears on the doc of release-pending-sends.
> In your case, the inner s
On Jun 16, 2010, at 7:07 PM, ataggart wrote:
> There's a disconnect between the function definition and the
> datastructures used by the caller.
>
> Either fix the data structure:
> (def args [:bar 2 :baz [:quux]])
> then use apply
>
> Or change the function definition to take a map:
> (defn foo
Hey all, something very weird happens when trying to use the http-agent. If
I execute a) or b) in a browser, I get the desired result XML.
a) http://RESTful/path/to/xml
b) http://RESTful/path/to/xml?_wrap=no&_query=declare default element
namespace 'com/interrupt/bookkeeping/users';//user[ @id='one
I guess I'm mostly wondering where to get the best (continually
update-able best) version of 1.2 core (and contrib?) before it's
released.
I'd rather not go Lein or Maven2 - just a vanilla checkout and Ant if
that's still a supported build option.
Everything's on github - right? The simplest comm
On Wed, Jun 16, 2010 at 10:17 PM, Richard Lyman wrote:
> Everything's on github - right? The simplest commands to grab the core
> (and contrib?) from github as well as the commands to keep updating
> every week or so until release would be fantastic.
>
git clone url, to get it
git pull, to update
Thanks. It's always interesting to see different notations.
On Jun 15, 4:49 pm, Travis Hoffman wrote:
> We Electrical Engineers are quite annoying in this regard, but
> historically, there is much variation out there: Python uses "j",
> MATLAB accepts i or j. Apache Commons allows the user to spe
On Wed, Jun 16, 2010 at 8:36 PM, David Nolen wrote:
> On Wed, Jun 16, 2010 at 10:17 PM, Richard Lyman
> wrote:
>>
>> Everything's on github - right? The simplest commands to grab the core
>> (and contrib?) from github as well as the commands to keep updating
>> every week or so until release woul
On Wed, Jun 16, 2010 at 11:34 PM, Richard Lyman wrote:
> On Wed, Jun 16, 2010 at 8:36 PM, David Nolen
> wrote:
> > On Wed, Jun 16, 2010 at 10:17 PM, Richard Lyman >
> > wrote:
> >>
> >> Everything's on github - right? The simplest commands to grab the core
> >> (and contrib?) from github as well
> Do I need any branches? What are the branches? I thought that when a
> branch was stable it would be merged back into master (if I'm using
> the right terms).
The master branch for clojure is the main development branch for 1.2
(someone correct me if I'm wrong). It's the one I'm using, and I'm
I'm pushing for a Leiningen 1.2.0 release really soon now, and part of
that effort is sprucing up the documentation. I've revamped the readme
and added a tutorial for folks just getting started. Of course,
self-editing is never as good as having outside help, so I'd love it
if I could get some feed
On Wed, Jun 16, 2010 at 8:34 PM, Richard Lyman wrote:
>>> All of this is assuming, hopefully incorrectly, that there's no
>>> automated nightly JAR that's being produced and made available
>>> somewhere.
>>
>> The clojure master branch is being built continuously here,
>> http://build.clojure.org/
You can easily download old releases of NetBeans. From the
netbeans.orgfront page click on "Download FREE". On that page click on
"Archive" in the
upper right corner. Finally look for the version select box on the right
side of the page.
IANAL, but I believe the license of each project allows you
Hello,
I am a co-founder of Infinitely Beta Technologies
(http://infinitelybeta.com), a Pune based startup made up of few of the
brightest Indian hackers and designers.
We hack in Clojure & Python and we are building a next-gen Consumer
Finance application for the Indian finance nerd.
We h
48 matches
Mail list logo