On Fri, Mar 30, 2012 at 11:01 AM, Larry Travis wrote:
> user=> (time (dotimes [i 10] (average1 mill-float-numbs)))
> "Elapsed time: 526.674 msecs"
>
> user=> (time (dotimes [i 10] (average2 mill-float-numbs)))
> "Elapsed time: 646.608 msecs"
>
> user=> (time (dotimes [i 10] (average3 mill-float-nu
fn* is a compiler intrinsic...it's pretty low-level, it doesn't
support destructuring,. So instead, core.clj creates a macro called fn
that adds all this other functionality and eventually spits out the
fn* in a format the compiler wants. Basically it's set up this way so
that you can write the maj
Recently, when looking into the clojure source code, core.clj in
particular,
I found multiple occurrence of 'fn*' instead of 'fn'.
Can anyone help explain what fn* is and the difference between fn and fn*
Thanks
Simon
--
You received this message because you are subscribed to the Google
Hi Rob,
Appreciate it, I like the code and explanation, great!
Simon
On Thursday, March 29, 2012 6:28:48 PM UTC+8, Rob Nagle wrote:
>
> You can reduce in one pass with a function that tracks both the sum
> and the count.
>
> (defn avg [coll]
> (apply / (reduce (fn [[sum n] x] [(+ sum x) (i
A quick comment on item 13 in the release.
I think that this sort causes some code that I have to fail.
The reason is that the code in question inserts js scripts into the header
of the page - when bootstrap loads.
Subsequent modules require this js to be present - but do not "depend" on
it.
Ex
Hi everyone,
Thanks to a patch from Justin Kramer, data.zip now works properly with the
updates to data.xml.
org.clojure
data.zip
0.1.1
or
[org.clojure/data.zip "0.1.1"]
Cheers,
Aaron
--
You received this message because you are subscribed to the Google
Groups "Clojure" gro
On Fri, Mar 30, 2012 at 6:17 PM, Lee Spector wrote:
>
> On Mar 30, 2012, at 5:11 PM, Cedric Greevey wrote:
>>
>> That opens a giant can of worms. How, for example, do we discover that
>> (partial * 2) and #(* % 2) and (fn [x] (* 2 x)) and #(+ %1 %1) are all
>> equal? Nevermind once we get into sit
2012/3/30 Vinzent :
> Counter-example: one could write if-authenticated macro, which will take
> fixed number of args, but should be indented as normal if.
OK, check the macro structure to see if any args are incorporated as
invokable forms -- so, in arguments in special forms and macros that
are
On Mar 30, 2012, at 5:11 PM, Cedric Greevey wrote:
>
> That opens a giant can of worms. How, for example, do we discover that
> (partial * 2) and #(* % 2) and (fn [x] (* 2 x)) and #(+ %1 %1) are all
> equal? Nevermind once we get into situations like #(reduce + (map
> (constantly 1) %) equals #(l
Awesome, I've been looking forward to this release.
The new release has made it out to the upstream maven repository. I just
pushed out lein-cljsbuild 0.1.4, which has the new 0.0-1006 dependency (as
well as some other features [1]. It works on my personal projects!
-Evan
[1]
https://github
I wanted to track a program and set a maximum runtime for it in a way
which is readable for the user. So I needed to write a time
tansformation which I could use in my track function.
First I wanted to use something like the 'defunits' macro from "Let
over Lambda" from Doug Hoyte, but I'm not so fi
Vinzent writes:
> Probably you slightly misunderstood what I mean. Consider this
> scenario:
> I've set up a project which uses a new library with non-standart
> indent. I've connected to swank and compiled it. Then I'm calling
> some clojure-mode-update-indent function, which walks through all
>
Counter-example: one could write if-authenticated macro, which will take
fixed number of args, but should be indented as normal if.
суббота, 31 марта 2012 г. 3:07:23 UTC+6 пользователь Cedric Greevey написал:
>
> On Fri, Mar 30, 2012 at 1:26 PM, Vinzent wrote:
> > Another idea is to put :indenta
Probably you slightly misunderstood what I mean. Consider this scenario:
I've set up a project which uses a new library with non-standart indent.
I've connected to swank and compiled it. Then I'm calling some
clojure-mode-update-indent function, which walks through all loaded
namespaces and coll
On Fri, Mar 30, 2012 at 2:48 PM, Nathan Matthews
wrote:
> Also it bothers me that
>
> (= (partial * 2) (partial * 2))
>
> is false. Logically it shouldn't be right? If we captured the function
> forms, that would enable better equality for functions.
That opens a giant can of worms. How, for ex
On Fri, Mar 30, 2012 at 1:26 PM, Vinzent wrote:
> Another idea is to put :indentation metadata on vars, so user-defined macros
> could be indented properly. Currently I have (define-clojure-indent ...)
> with a number of forms in my emacs config file, and it seems to be pretty
> common solution. I
On Mar 30, 7:35 am, David Jagoe wrote:
> G'day everyone
>
> I am increasingly relying on clojure and plan to use clojureclr and
> clojurescript in production too. I will soon need to hire a clojure
> developer and was hoping that someone could suggest a good place to post a
> job ad. I've never
Vinzent writes:
> I'm not sure how I feel about indentation rules
> changing depending on whether slime is active or not.
>
> What I was thinking, is that there'd be some function which would
> collect and save indentation metadata, so it can be used later. Thus,
> active slime connection
Nathan Matthews writes:
> I wrote some code which re-programmed the fn macro to capture the
> closures as well as the actual function form, and attach them as
> meta-data also on the actual function object.
Could you submit it as a patch to serializable-fn? It would be nice to
have everything in
Nice find.
Thanks,
'(Devin Walters)
On Friday, March 30, 2012 at 2:58 PM, David Nolen wrote:
> http://soft.vub.ac.be/SOUL/
>
> This project is worth looking at for directions that kibit might want to go.
> It's also a good resource for cool ideas on how to leverage core.logic -
> miniKanren
>
> I'm not sure how I feel about indentation rules
> changing depending on whether slime is active or not.
>
What I was thinking, is that there'd be some function which would collect
and save indentation metadata, so it can be used later. Thus, active slime
connection required only the first t
http://soft.vub.ac.be/SOUL/
This project is worth looking at for directions that kibit might want to
go. It's also a good resource for cool ideas on how to leverage core.logic
- miniKanren was designed from the get go to manipulate Lisp source.
David
--
You received this message because you are
Nathan Matthews writes:
> I wanted to serialise functions and send them over the network. The
> problem with serializable-fn is that it doesn't capture closures.
It's designed to capture closures; if it doesn't that would be an
(unsurprising) bug.
-Phil
--
You received this message because yo
This seems like a good place. Where's the job? :)
On Mar 30, 2012, at 7:35 AM, David Jagoe wrote:
> G'day everyone
>
> I am increasingly relying on clojure and plan to use clojureclr and
> clojurescript in production too. I will soon need to hire a clojure developer
> and was hoping that s
Hi,
I wanted to serialise functions and send them over the network. The problem
with serializable-fn is that it doesn't capture closures.
I wrote some code which re-programmed the fn macro to capture the closures as
well as the actual function form, and attach them as meta-data also on the
ac
I can confirm Mark Rathewell's note; that's part of what lein-cljsbuild is
meant to do.
With his configuration, the script1.js and script2.js files would both be
built, and each would only contain the code from the project1 or project2
directories, respectively (unless they require code from ou
On Thu, 2012-03-29 at 23:31 -0700, Benjamin Peter wrote:
> the sequence would have been traversed completely by the reduce call
> and therefore clojure could know it's size and provide a constant time
> count.
>
> Could this be implemented?
Yes. You could probably implement it yourself, as a wra
On Fri, Mar 30, 2012 at 8:18 AM, Devin Walters wrote:
> Try meetup.com and look for Clojure and/or Lispish groups. Contact them with
> details. I would be happy to put the word out in our group. Feel free to
> pass me details.
Also LinkedIn has a Clojure group and that has a Jobs section.
If you
David,
You might want to try posting at Functional Jobs; I've heard good
things about results from there:
http://functionaljobs.com/
FYI, I have no affiliation or connection with whoever runs the
service.
Of course, tweet the opening. I think we'd all be surprised by how
many jobs get fill
Vinzent writes:
> Phil, what do you think? Could it be experimentally implemented in
> clojure-mode?
No, clojure-mode determines indentation exclusively from static
heuristics. There is dynamic indentation support in slime, but I've
never looked into it; I'm not sure how I feel about indentation
I too think this is interesting because because it serves to illustrate
some important general aspects of Clojure with a very simple problem.
I wrote four Clojure programs contrasting different ways of solving the
problem, and then timed the application of each ten times to a
million-item sequ
I haven't tried yet, but lein-cljsbuild [1] is meant to support
multiple builds, and I believe something like the below config would
be what you are looking for:
:cljsbuild {
:builds
[{:source-path "src/cljs/project1"
:compiler {:output-to "resources/public/cljs/script1.js"
At Relevance we are working on a project with just this structure. The
project has a custom build script that produces mulitple
advanced-mode-compiled .js files.
We have not developed anything that would be generally reusable, but it's
not hard to create custom code to do this. The ClojureScrip
Just pushed to Sonatype. Will be sync'd to other repos within 24 hours.
Changes:
http://build.clojure.org/job/clojurescript-release/9/
--
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
Not
Another idea is to put :indentation metadata on vars, so user-defined
macros could be indented properly. Currently I have (define-clojure-indent
...) with a number of forms in my emacs config file, and it seems to be
pretty common solution. It'd be nice to replace this hack with an
IDE-independ
Hi,
The project I envision would consist of multiple completely independent
conglomerates of CLJS scripts compiled into several separate final
production .js with one single Clojure server.
The reason for that is:
1. Smaller size of .js to load at each stage
2. Each time a browser transitions fr
And like Sean mentioned, using Leiningen *really* helps. Especially when
you have Emacs with clojure set up as well.
On Fri, Mar 30, 2012 at 8:17 AM, Murphy McMahon wrote:
> Learning Clojure is the fun part. Setup and maintenance of the tools is a
> little less fun, IMO. But where there's a will
Yep, just make sure to mention that it's an offer and the location in the
subject to make it easy to spot.
On Fri, Mar 30, 2012 at 11:39 AM, David Powell wrote:
>
>
> On Fri, Mar 30, 2012 at 1:35 PM, David Jagoe wrote:
>
>> G'day everyone
>>
>> I am increasingly relying on clojure and plan to us
On Fri, Mar 30, 2012 at 1:35 PM, David Jagoe wrote:
> G'day everyone
>
> I am increasingly relying on clojure and plan to use clojureclr and
> clojurescript in production too. I will soon need to hire a clojure
> developer and was hoping that someone could suggest a good place to post a
> job ad.
On Friday, March 30, 2012 at 7:35 AM, David Jagoe wrote:
> G'day everyone
> I am increasingly relying on clojure and plan to use clojureclr and
> clojurescript in production too. I will soon need to hire a clojure developer
> and was hoping that someone could suggest a good place to post a job ad
On Thu, Mar 29, 2012 at 11:59 PM, Shantanu Kumar
wrote:
> The change needs to be least intrusive and doesn't justify exposing
> more surface area than it should. It's a trade off.
Injecting a version of defn that doesn't do anything different except
make a new thing available inside the function
G'day everyone
I am increasingly relying on clojure and plan to use clojureclr and
clojurescript in production too. I will soon need to hire a clojure
developer and was hoping that someone could suggest a good place to post a
job ad. I've never seen a job posted here but I would like to reach the
Learning Clojure is the fun part. Setup and maintenance of the tools is a
little less fun, IMO. But where there's a will (and a connection to
freenode), there's a way.
On Mar 30, 2012 9:09 AM, "Chris Webster" wrote:
> Thanks for the advice, guys.
>
> I think it must just have been some temporary
Hey All,
I'm trying to print the numbers 0-99 as fast as possible. In python,
this
for i in range(99):
print i
runs super fast.
In clojure, even with type hints, this is slow
(def ^java.io.PrintWriter outoutout (java.io.PrintWriter. *out*))
; yes, I know this one prints to infinity. I
Whoops! I'm sorry. I tried compiling my code into an uberjar and then ran
(defn print2 []
(dotimes [n 99] (.println outoutout n)))
from main
It's very very fast!! Wow!
On Thu, Mar 29, 2012 at 8:07 PM, sean neilan wrote:
> Hey All,
>
> I'm trying to print the numbers 0-99 as fast as po
Thanks for the advice, guys.
I think it must just have been some temporary problem on the site, as I
finally got it to download late last night. Now all I have to do is learn
Clojure, eh?
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to
Hi,
On Mar 29, 10:43 pm, Alan Malloy wrote:
> "Very likely" strikes me as a huge overstatement here. Most sequences
> that you want to average won't be source-code literals, they'll be
> lazy sequences, and those aren't counted.
I think this topic is interesting. My guess would be, that the
sequ
David Jagoe writes:
Hi David,
> Thanks! I had a nasty feeling that it could be done in a one-liner
> using partition-by or something similar. But of course you need to be
> able to look at previous elements...
Here's a slightly shorter variant.
--8<---cut here---start--
Here's a version with reduce. It returns your elements as sets, but you could
easily (map seq ,,,) if you really need lists.
user=> (reduce (fn [r e] (if ((last r) e) (conj r #{e}) (update-in r [(dec
(count r))] conj e))) [#{}] [1 2 2 3 4 4 1 6])
[#{1 2} #{2 3 4} #{1 4 6}]
Cheers, Jay
On M
On 29 March 2012 21:41, Cedric Greevey wrote:
>
> On Thu, Mar 29, 2012 at 4:18 PM, David Jagoe wrote:
> > Given a sequence like this: [1 2 1 2 1 1 2 1 2 2 2]
> >
> > partition it to get this: [(1 2) (1 2) (1) (1 2) (1 2) (2) (2)]
> >!
>
> (defn partition-distinct [s]
> (lazy-seq
> (loop [see
50 matches
Mail list logo