Hello everybody,
the following code is not producing what was expected of it in clojure 1.2
.. has this been fixed the clojure 1.3?
(let [x (transient {})]
(dotimes [i 10]
(assoc! x i (* i i)))
(persistent! x))
> Hello everybody,
> the following code is not producing what was expected of it in clojure 1.2
> .. has this been fixed the clojure 1.3?
> (let [x (transient {})]
>
>
> (dotimes [i 10]
>
>
> (assoc! x i (* i i)))
>
>
>
Yea you are right it does not work for anything greater than 8 .. It took me
a while to figure out that the bug was infact the transients.. but did you
try it in clojure 1.3 alpha versions?
Sunil.
On Thu, Jan 6, 2011 at 3:35 PM, Baishampayan Ghose wrote:
> > Hello everybody,
> > the following co
Hi Sean,
Yes the two statements are equivalent. ClojureQL compiles everything
to prepared
statements, with every argument automatically paramterized. You
shouldn't have to
call the compiler function directly, ever. For quick inspection,
simply type the statement
in the repl and it will emit the SQ
That is not a bug. You should NEVER use transient and its related
functions to emulate variables - you're supposed to use assoc! and
friends as if they're pure functions. That is, always use the return
value of assoc! and don't rely on its argument being modified.
something like:
(loop [x (transi
Sunil S Nandihalli writes:
> Hello everybody,
> the following code is not producing what was expected of it in clojure
> 1.2 .. has this been fixed the clojure 1.3?
>
> (let [x (transient {})]
> (dotimes [i 10]
> (assoc! x i (* i i)))
> (persistent! x))
This is not a bug, it's a misuse o
Joost wrote:
> you're supposed to use assoc! and
> friends as if they're pure functions.
Just correcting myself for clarity:
assoc! etc MAY modify their transient arguments, but not always, and
not always in the way you might think. The correct result of these
operations is their return value, bu
thanks for the clarification .. I did know about the fact that I have to
capture the return value .. but some how slipped my mind and assumed it was
a bug .. I guess that will never happen again after burning my fingers this
time
Sunil.
On Thu, Jan 6, 2011 at 4:30 PM, Joost wrote:
> Joost
> thanks for the clarification .. I did know about the fact that I have to
> capture the return value .. but some how slipped my mind and assumed it was
> a bug .. I guess that will never happen again after burning my fingers this
> time
Haha! Same here. I have used transients many times too,
I note that the stringtemplate-clj library defaults to using directory
paths only, but StringTemplate itself can pull templates from the
classpath as well. If you placed your templates in
"resources/templates" and used StringTemplate directly, you wouldn't
have to worry about where the template dir
http://coderloop.com/ like Project Euler but more modern
--
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
Hey Eric
I did something similar for handling unsigned types. I think it's
simpler and probably faster, not that I've checked. Here's a gist of
it https://gist.github.com/767887
That code is part of a little library I wrote a while ago
https://github.com/geoffsalmon/bytebuffer It's closer to your
On Jan 5, 3:14 pm, LauJensen wrote:
> ... Works out of the box with PostgreSQL and MySQL ...
nice work !
your testcode references sqlite3 too.
so what about sqlite3-support ?
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group,
Thanks!
sqlite has certain oddities. For instance when you do a union the
first query must not be in parens. In order to support this various
quirks, somebody would have to copy/paste the sql92compiler and
adjust it slightly for sqlite. I haven't done it yet, but if somebody
does I'd be happy to i
http://clojure.org/transients
mentions that transients are not designed to be bashed in place like mutable
datastructures.
The following produces the correct result.
(loop [x (transient {}) i 0]
(if (< i 10)
(recur (assoc! x i (* i i)) (inc i))
(persistent! x)))
--
You receive
Thank you for working on this! I wanted to create an extension with
just syntax highlighting and AOT compilation but I gave up while
reading through the VS extension API. Your patience must be never-
ending to use that API :) I will download and test this later today.
On Dec 30 2010, 10:30 pm, j
Tim Daly writes:
> On 1/6/2011 12:03 AM, Eric Schulte wrote:
>>> Can you post examples of these? I'd love to see some other examples.
>> Sure thing, check out this old version of a file which tangles out into
>> the directory layout expected by lein.
>> http://gitweb.adaptive.cs.unm.edu/?p=asm.gi
Hey Geoff,
This sort of feedback and code recommendations is exactly what I was
hoping for.
Geoff writes:
> Hey Eric
> I did something similar for handling unsigned types. I think it's
> simpler and probably faster, not that I've checked. Here's a gist of
> it https://gist.github.com/767887
>
On Wed, Jan 5, 2011 at 5:13 PM, Ken Wesson wrote:
> On Wed, Jan 5, 2011 at 4:40 PM, rainerh wrote:
>> Hello everybody,
>>
>> I'm trying to use clojure to parse web sites. Unfortunately there is
>> some problem with following code (used library is Apache Commons HTTP
>> Client):
>>
>> (defn reques
If someone is interested in some other statistics, please let me know and
I'll try to make it happen.
>
>
>>
> The most talkative person per session would be interesting :) though
> perhaps session time is a PITA to establish particularly across days
> boundaries.
>
Define "session" (a day? a su
Hi
On 6 January 2011 07:33, Tim Daly wrote:
[...]
> Take a look at http://daly.axiom-developer.org/clojure.pdf
I like it :)
Some simple corrections:
You have a typo on the front page:
"Based on Version 1.3.0-alphs4" (alphs4 instead of alpha4).
In the foreword, "This is a literate fork of Clo
> Looking at the source code I'm not sure if the patches were applied.
> Maybe there was a "regression". The symptoms seem consistent with what
> was supposed to have been fixed.
>
> Following the clojure.org api docs, I clicked through on the source code
> link on
>
> http://richhickey.github.c
On Thu, Jan 6, 2011 at 3:32 AM, Baishampayan Ghose wrote:
> Haha! Same here. I have used transients many times too, but I fell
> into the trap this time :)
now if only there were some kind of programming language technology
that could help us figure out when we're mis-applying operations to
thing
1st Boston Clojure Meetup
Date: Thursday, January 13th, 2011
Location: Akamai Technologies
8 Cambridge Center
Conference Room 200D
Cambridge, MA 02142
(Corner of Broadway and Galileo Galilei)
Akamai Technologies will be hosting the first Boston Clojure
Meetup on Thursday, January 13th. Th
On Thu, Jan 6, 2011 at 08:50, Miki wrote:
> If someone is interested in some other statistics, please let me know and
> I'll try to make it happen.
>>
>>
>>>
>> The most talkative person per session would be interesting :) though
>> perhaps session time is a PITA to establish particularly across
On Thu, Jan 6, 2011 at 1:08 PM, Raoul Duke wrote:
> On Thu, Jan 6, 2011 at 3:32 AM, Baishampayan Ghose wrote:
>> Haha! Same here. I have used transients many times too, but I fell
>> into the trap this time :)
>
> now if only there were some kind of programming language technology
> that could he
I'm also going to Boston Coding Dojo tonight. The Clojure Meetup is going
to be at Akamai, a week from tonight's dojo, which I'm looking forward to:
http://groups.google.com/group/clojure/browse_thread/thread/821248c3dd0b69b8
On Thu, Dec 30, 2010 at 9:34 PM, Alyssa Kwan wrote:
> Hi!
>
> You woul
On 1/6/2011 11:16 AM, Eric Schulte wrote:
Tim Daly writes:
On 1/6/2011 12:03 AM, Eric Schulte wrote:
Can you post examples of these? I'd love to see some other examples.
Sure thing, check out this old version of a file which tangles out into
the directory layout expected by lein.
http://gi
Hi,
I am trying to store into a map the frequency of each [a-z]+ word in a
file. When I run this code in the repl the resulting dictionary is
empty. How should I adapt my code to get this functionality right?.
Thank you in advance
(import (java.io BufferedReader FileReader))
(def dictionary {}
Hi,
on this page
http://singularityhub.com/2010/12/21/ray-kurzweil-the-mind-and-how-to-build-one-video/
you
can find a video in which Ray Kurzweil speaks about the "reverse
engineering" of the human brain.
At 39:25 Ray states that "... the cerebral cortex is a Lisp processor." and
explains that l
Shameless plug: or use http.async.client
http://neotyk.github.com/http.async.client/docs.html#sec-1_2_4_1
(let [resp (c/stream-seq :get url)]
(doseq [s (string resp)]
(println s)))
Cheers,
Hubert.
On Thu, Jan 6, 2011 at 5:34 PM, Aaron Cohen wrote:
> On Wed, Jan 5, 2011 at 5:13 PM, Ken We
On Jan 6, 2011, at 1:48 PM, Ken Wesson wrote:
> On Thu, Jan 6, 2011 at 1:08 PM, Raoul Duke wrote:
>> On Thu, Jan 6, 2011 at 3:32 AM, Baishampayan Ghose wrote:
>>> Haha! Same here. I have used transients many times too, but I fell
>>> into the trap this time :)
>>
>> now if only there were some
You're not capturing the output of the reduce anywhere; doseq is for
side-effects only.
If you wrapped the doseq in a "(def dictionary ...)" it would work,
but this is not recommended.
Instead, you should either use nested reductions, or produce a simple
list of tokens first (simpler):
(defn proc
I was typing up an answer, but Jason answered faster and better :)
The only thing I have to add is that 'frequencies' is also in clojure
core as of 1.2.
On Jan 6, 1:13 pm, Jason Wolfe wrote:
> You're not capturing the output of the reduce anywhere; doseq is for
> side-effects only.
>
> If you wr
On 1/6/2011 12:07 PM, Michael Wood wrote:
Hi
On 6 January 2011 07:33, Tim Daly wrote:
[...]
Take a look at http://daly.axiom-developer.org/clojure.pdf
I like it :)
Some simple corrections:
You have a typo on the front page:
"Based on Version 1.3.0-alphs4" (alphs4 instead of alpha4).
In
On Thu, Jan 6, 2011 at 1:49 PM, new2clojure wrote:
>
> Hi,
>
> I am trying to store into a map the frequency of each [a-z]+ word in a
> file. When I run this code in the repl the resulting dictionary is
> empty. How should I adapt my code to get this functionality right?.
>
> Thank you in advance
On Thu, Jan 6, 2011 at 10:49 AM, new2clojure wrote:
> I am trying to store into a map the frequency of each [a-z]+ word in a
> file. When I run this code in the repl the resulting dictionary is
> empty. How should I adapt my code to get this functionality right?.
Other people have offered up alte
Hi, everyone.
With the changes to dynamic symbols in 1.3.0-snapshot, a number of
modules of contrib/ seem unable to function. I'm trying to see if I
can get fnparse to run under the master branch, and it wants
contrib/monads, which in turn wants contrib/macro-utils.
The following error happens a
On Thu, Jan 6, 2011 at 2:33 AM, LauJensen wrote:
> Yes the two statements are equivalent. ClojureQL compiles everything
> to prepared
> statements, with every argument automatically paramterized.
Cool, that's what I'd hoped. But just to clarify...
If I have code that repeatedly calls this:
@(->
G'day Arie,
You have to be very careful about listening to things Ray Kurzweil
says when he's talking about the brain, etc.
I would think it would be better to listen to someone actually
conducting brain/AI research, for example, Jeff Hawkins. His company
Numenta seems to be making great progres
Sorry for the late response, but I haven't had time to play with
things in a couple days.
First discovery is that I probably cannot use the library path
variable, because some of the DLLs have to be loaded in a specific
order. Specifically, there is a "clientswig.dll" that has to be loaded
last. G
Hi Chris, we were happy to provide them. I'll see what we can do
synchronization-wise with the remaining videos.
Improving our technique around recording, editing, and releasing
videos is on the list of things we hope to do for the next Conj.
Alan
On Wed, Jan 5, 2011 at 1:48 PM, Chris Riddoch
I just watched about 10 minutes leading up to the comment Arie flagged and it
seems to me that Kurzweil is actually describing something very much like
Hawkins's HTM model *at* a certain level of abstraction. He makes some other
interesting comments about Lisp that might strike some here as biz
On Thu, Jan 6, 2011 at 7:33 PM, Sean Corfield wrote:
> On Thu, Jan 6, 2011 at 2:33 AM, LauJensen wrote:
>> Yes the two statements are equivalent. ClojureQL compiles everything
>> to prepared
>> statements, with every argument automatically paramterized.
>
> Cool, that's what I'd hoped. But just t
I've now had a quick look at this too.
Aside from the grammatical and spelling nitty-gritty, there are some
larger scale concerns, ones that unfortunately go to the heart of the
entire "literate programming" concept.
Namely, at the start it jumps very quickly into a red-black tree
implementation
Ah. But a new map is being created with the default :or operation. I
guess the ability to get this entire map with defaults is not
available directly from clojure destructuring binding.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this g
On 1/6/2011 9:15 PM, Ken Wesson wrote:
I've now had a quick look at this too.
Aside from the grammatical and spelling nitty-gritty, there are some
larger scale concerns, ones that unfortunately go to the heart of the
entire "literate programming" concept.
Namely, at the start it jumps very qu
On Thu, Jan 6, 2011 at 11:05 PM, Tim Daly wrote:
> On 1/6/2011 9:15 PM, Ken Wesson wrote:
>> And then of course the overarching purpose of Clojure itself isn't
>> even given, let alone why it has sorted-map, and why it's an immutable
>> sorted-map ...
>
> There is very little that needs to be said
On 1/6/2011 11:42 PM, Ken Wesson wrote:
On Thu, Jan 6, 2011 at 11:05 PM, Tim Daly wrote:
On 1/6/2011 9:15 PM, Ken Wesson wrote:
And then of course the overarching purpose of Clojure itself isn't
even given, let alone why it has sorted-map, and why it's an immutable
sorted-map ...
There is v
Rich has suggested the book "Spikes" ISBN 0-262-68108-0
which is about exploring the neural code. This was
mentioned in his Whitehead video.
On 1/6/2011 7:40 PM, Michael Aldred wrote:
G'day Arie,
You have to be very careful about listening to things Ray Kurzweil
says when he's talking about th
On Jan 7, 6:49 am, Ken Wesson wrote:
> On Thu, Jan 6, 2011 at 7:33 PM, Sean Corfield wrote:
> > On Thu, Jan 6, 2011 at 2:33 AM, LauJensen wrote:
> >> Yes the two statements are equivalent. ClojureQL compiles everything
> >> to prepared
> >> statements, with every argument automatically paramte
On Fri, Jan 7, 2011 at 12:07 AM, Tim Daly wrote:
> Hmmm. I may have misunderstood your point. I thought you were suggesting
> writing code that is not part of the distribution in order to get a
> minimal running system and then working from that. If that is not what
> you're suggesting then I'm co
On Fri, Jan 7, 2011 at 12:22 AM, Shantanu Kumar
wrote:
> On Jan 7, 6:49 am, Ken Wesson wrote:
>> I'd hope it has some kind of caching or memoization behind the scenes,
>> but if not, that'd be a great thing to add for version 1.1. I think a
>> typical database client app uses a finite variety of
No, no new map is created. The :or clause simply creates the local
binding for you if none existed in the map; there's no need for it to
create a second map to do this.
On Jan 6, 6:27 pm, Seth wrote:
> Ah. But a new map is being created with the default :or operation. I
> guess the ability to get
On Jan 7, 10:32 am, Ken Wesson wrote:
> On Fri, Jan 7, 2011 at 12:22 AM, Shantanu Kumar
>
> wrote:
> > On Jan 7, 6:49 am, Ken Wesson wrote:
> >> I'd hope it has some kind of caching or memoization behind the scenes,
> >> but if not, that'd be a great thing to add for version 1.1. I think a
> >
Hi,
The following case statement
#+begin_src clojure
(defn buggy-case [n]
(case (int n)
0 :null
1 :load
0x7000 :loproc))
#+end_src
throws the following error
No distinct mapping found
[Thrown class java.lang.IllegalAr
It looks like a problem in clojure.core/min-hash to me. case depends
on min-hash to generate ahead-of-time hashes of all the test clauses,
and while I can't easily follow what's going on, it seems to be trying
to find a shift/mask combination that is...somehow related to the
hashes of the test clau
57 matches
Mail list logo