This is great stuff: thank you! I can totally see this being the kind
of thing like destructuring, where once you've used it you won't want
to go back :)
--
Peter
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to cl
Thank you for making this available!
On 10 August 2011 02:53, Filip de Waard wrote:
> I'm working on Vix, which is a document repository and content
> management system written in Clojure with a CouchDB backend. After the
> announcement on July 23 I immediately got excited about ClojureScript
> a
On Tue, Aug 9, 2011 at 9:39 AM, Shoeb Bhinderwala <
shoeb.bhinderw...@gmail.com> wrote:
> With these options added the Clojure code runs just about as fast as
> Java. I set the fetch size to 1000 for both of them.
>
> Average run times to load 69,000 records:
>
> Java = 2.67 seconds
> Clojure =
you should considering looking at clojure.contrib.lazy-seqs/primes to get an
idea it is implemented there..
Sunil.
On Wed, Aug 10, 2011 at 1:48 AM, Chouser wrote:
> On Tue, Aug 9, 2011 at 12:50 PM, Kevin Sookocheff
> wrote:
> > Hi,
> >
> > I have a question regarding the map data structure. I'm
Thanks. Worked great.
--
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 from this grou
I'm working on Vix, which is a document repository and content
management system written in Clojure with a CouchDB backend. After the
announcement on July 23 I immediately got excited about ClojureScript
and the Google Closure toolkit, so I dropped the existing Backbone.js
and jQuery code and rewro
On Tue, Aug 9, 2011 at 8:09 PM, Daniel Ribeiro wrote:
> Hi,
>
> When starting the clojurscript from a clojure repl:
>
> clojurescript $ script/repl
> Clojure 1.2.1
> user=> (require '[cljs.compiler :as comp])
> java.lang.IllegalArgumentException: Wrong number of args (4) passed to:
> core$assert
Hi,
When starting the clojurscript from a clojure repl:
clojurescript $ script/repl
Clojure 1.2.1
user=> (require '[cljs.compiler :as comp])
java.lang.IllegalArgumentException: Wrong number of args (4) passed to:
core$assert (core.clj:63)
user=>
The jdk version:
java -version
java version "1.6
> unfamiliar with my resume (nobody at Google knew what was on it
> even though they had a copy at the interview). The whole idea of
> such approaches shows (a) a lack of respect for the individual and
> (b) an arrogant attitude of "you should feel LUCKY that we even
> CONSIDERED talking to you"...
For the sieve, if performance matters, clojure's native data structures may
not be the best choice.
A mutable array of boolean primitives could be more apropos.
(defn prime-sieve [^long n]
(let [^booleans sieve (make-array Boolean/TYPE (inc n))]
...)
... using aset/aget to write/read sieve
Okay, that's the impression I got from poking around but I just wanted
to make sure I wasn't missing anything.
Thanks Stuart.
On Aug 9, 1:46 pm, Stuart Sierra wrote:
> It's not currently possible to refer macros without a namespace prefix:
> ClojureScript does not have `refer` or `use`. There hav
It's not currently possible to refer macros without a namespace prefix:
ClojureScript does not have `refer` or `use`. There have been some
discussions around this, don't have a link handy.
-Stuart Sierra
clojure.com
--
You received this message because you are subscribed to the Google
Groups "
On Tue, Aug 9, 2011 at 1:08 PM, Chris Granger wrote:
> FWIW, I've already done what Brenton describes (jar'ing the compiler
> and such) for noir-cljs (https://github.com/ibdknox/noir-cljs) which
> adds compilation as middleware.
This is actually really really great. Though a little specific to no
On Tue, 2011-08-09 at 10:42 -0400, Robert Levy wrote:
>
>
>
> Another likely factor is that Google (where Norvig works)
> supports
> Python but not Lisp.
>
>
> With some exceptions I guess?
>
> http://www.itasoftware.com/
> http://en.wikipedia.org/wiki/Google_A
On Tue, Aug 9, 2011 at 12:50 PM, Kevin Sookocheff
wrote:
> Hi,
>
> I have a question regarding the map data structure. I'm trying to program a
> Sieve of Eratosthenes using the algorithm at Wikipedia:
>
> Input: an integer n > 1
>
> Let A be an array of bool values, indexed by integers 2 to n,
> i
Thanks Marko! However, I am looking at using this for a new project
and I am going to try to treat javascript as nothing more the
assembler for the browser. That being the case I am really going to
try to avoid worrying too much about how Clojurescript compiles to
Javascript.
The other side of tha
On Tue, Aug 9, 2011 at 9:25 AM, Brenton wrote:
> There isn't an official way to do this now but you can package a
> ClojureScript library (of .cljs files) into a jar and add it to the
> classpath. Once on the classpath, the namespaces in the library can
> then be required and used just as you woul
(zipmap (range 2 (inc n)) (repeat true))
--
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 unsubsc
If you looks here, http://aima.cs.berkeley.edu/code.html, you can see
that the data/code is provided in formats for Java, Lisp, Python, and
just some plaintext as well. Here is his rationale, and other info,
about why he switched: http://norvig.com/python-lisp.html
Personally, I plan on giving it a
FWIW, I've already done what Brenton describes (jar'ing the compiler
and such) for noir-cljs (https://github.com/ibdknox/noir-cljs) which
adds compilation as middleware. I've also gone the route of jar'ing up
my clojurescript stuff and that has worked really well. It seems to me
that there's no rea
Nice work getting to the bottom of this.
Sent from my iPad
On 9 Aug 2011, at 17:39, Shoeb Bhinderwala wrote:
> Hi Sean –
>
> With these options added the Clojure code runs just about as fast as
> Java. I set the fetch size to 1000 for both of them.
>
> Average run times to load 69,000 records:
user=> (def n 5)
#'user/n
user=> (zipmap (range 2 (inc n)) (repeat true))
{5 true, 4 true, 3 true, 2 true}
user=>
As a start...
On Aug 9, 10:50 am, Kevin Sookocheff
wrote:
> Hi,
>
> I have a question regarding the map data structure. I'm trying to program a
> Sieve of Eratosthenes using the algo
Hi,
I have a question regarding the map data structure. I'm trying to program a
Sieve of Eratosthenes using the algorithm at Wikipedia:
*Input*: an integer *n* > 1
Let *A* be an array of bool values, indexed by integers 2 to *n*,
initially all set to *true*.
*for* *i* = 2, 3, 4, ..., *while*
Hi Sean –
With these options added the Clojure code runs just about as fast as
Java. I set the fetch size to 1000 for both of them.
Average run times to load 69,000 records:
Java = 2.67 seconds
Clojure = 2.72 seconds
Thanks
Shoeb
On Aug 9, 12:54 am, Sean Corfield wrote:
> On Mon, Aug 8,
On Tue, Aug 9, 2011 at 1:49 AM, David Nolen wrote:
> Ambrose and I have been working on a high performance pattern matching
> library for Clojure. There's much left to do but it's already in a place
> where it's fun to play around with and we think some of you might even find
> it useful even in
On Tue, Aug 9, 2011 at 4:42 AM, Philipp Steinwender
wrote:
> sorry i didn't check the result. with --batch something went wrong. the
> indentation gets weird.
The --batch flag causes it to skip your personal dotfiles, so you will
have to explicitly load clojure-mode.
-Phil
--
You received this
On Aug 9, 2011, at 10:01 AM, David Nolen wrote:
> On Sat, Aug 6, 2011 at 5:30 PM, Rich Hickey wrote:
> Why all the attention to :use - I thought everyone agreed using it is a bad
> idea?
>
> I like pairing :use with :only especially between files that belong to the
> same library.
Agreed. Be
Another likely factor is that Google (where Norvig works) supports
> Python but not Lisp.
With some exceptions I guess?
http://www.itasoftware.com/
http://en.wikipedia.org/wiki/Google_App_Inventor
http://groups.google.com/group/clojure/browse_thread/thread/156da03edd630046?pli=1
> I
If you mark your public functions with ^:export, even advanced optimization
will keep those functions intact.
You can campile your library into js, and distribute that file.
You can use this compiled file just as any other Closure compatible
javascript library.
Regards,
Marko
--
You received t
There isn't an official way to do this now but you can package a
ClojureScript library (of .cljs files) into a jar and add it to the
classpath. Once on the classpath, the namespaces in the library can
then be required and used just as you would currently use clojure.set
or clojure.string.
ClojureS
On Sat, Aug 6, 2011 at 5:30 PM, Rich Hickey wrote:
> In Clojure, namespaces are different from the host's packages, in
> ClojureScript they are the same (insofar as they match the Google Closure
> approach).
>
Makes sense.
> Why all the attention to :use - I thought everyone agreed using it is
Hi,
Am Dienstag, 9. August 2011 15:14:25 UTC+2 schrieb Ambrose
Bonnaire-Sergeant:
>
> On Tue, Aug 9, 2011 at 7:39 PM, David Nolen wrote:
>
>> Think about code for dealing with macros.
>>
>> (defmacro foo [& forms]
>> (match [forms]
>> [(a [x] :else & rest)] ...
>> [(a [x b] :else & r
On 08/09/2011 05:35 AM, Shantanu Kumar wrote:
>
>
> On Aug 9, 12:22 pm, mmwaikar wrote:
>> Hi,
>>
>> Assuming there are some DB credentials specified in a project.clj file as a
>> map, how should I read those credentials in my clojure code -
>>
>> 1) should I use slurp and then parse that text?
On Tue, Aug 9, 2011 at 7:39 PM, David Nolen wrote:
> Think about code for dealing with macros.
>
> (defmacro foo [& forms]
> (match [forms]
> [(a [x] :else & rest)] ...
> [(a [x b] :else & rest)] ...))
>
>
Wow, that is cool!
--
You received this message because you are subscribed to
On Tue, Aug 9, 2011 at 2:27 AM, Thomas CORDIVAL wrote:
> Hello everybody,
> I ran across a nice feature the Firefox and Webkit developers are currently
> working on: the possibility of mapping the javascript source code executed
> by the VM and another file of source code, for example written in
>
Hi,
On Tuesday, August 9, 2011 12:09:58 PM UTC+2, Sunil Nandihalli wrote:
>
>
> would associate the source of the function with the function as its meta
> data you are defining
>
actually I really do think that it would be great to have the orignal defn
add the source to the metadata.
Then on
Hello everybody,
I ran across a nice feature the Firefox and Webkit developers are currently
working on: the possibility of mapping the javascript source code executed
by the VM and another file of source code, for example written in
clojurescript or coffeescript. This feature is already implement
Hello All,
Are there any thoughts yet on distributing ClojureScript libraries?
ClojureScript does whole program optimization, it needs the
sources. Copying the sources into your main project isn't really a
solution, not a long term solution at the very least.
At the very least it would be nice of
On Aug 7, 10:50 pm, Phil Hagelberg wrote:
> I think your best bet is to use Emacs from the command-line. Even if
> people edit outside Emacs, it's easy to invoke for indentation
> purposes:
>
> $ emacs --eval "(progn (find-file \"badly_indented.clj\")
> (indent-region (point-min) (point-max))
Hmm, I tried this with a v8 shell, and I still get...
> load('out/goog/base.js');
> load('out/goog/deps.js');
> load('bkeeping.js');
> bkeeping.fubar("thing");
*(shell):1: ReferenceError: bkeeping is not defined*
*bkeeping.fubar("thing");*
*^*
Where "cat bkeeping.cljs" gives...
*(ns bkeeping*
On Tue, Aug 9, 2011 at 6:34 AM, Ambrose Bonnaire-Sergeant <
abonnaireserge...@gmail.com> wrote:
> For those browsing the source, I'll give a quick run through of what's
> going on.
This means that the machinery is already exposed. There's a bit of code
cleanup to do but the pattern matcher is m
sorry i didn't check the result. with --batch something went wrong. the
indentation gets weird.
--
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 moderat
On Tue, Aug 9, 2011 at 3:50 AM, Sam Aaron wrote:
> Exciting stuff!
>
> Do you happen to have any simple descriptions/examples of where and how we
> might use this stuff in our daily programming repertoires? I for one am sure
> I'm not educated enough as to the value and utility of pattern matchin
Wonderful. Baishampayan and Ambrose thanks so much for your fantastically lucid
examples.
I can totally see myself using this stuff. David and Ambrose, it's remarkable
work - well done!
Sam
---
http://sam.aaron.name
--
You received this message because you are subscribed to the Google
Groups
For those browsing the source, I'll give a quick run through of what's going
on.
1. A "pattern matrix" is built using the given variables and pattern rows. A
Pattern row is a pair of matches and a result.
Example:
match.core=> (build-matrix [x y]
[1 0] 0
Thanks from me as well. This very question was my very next challenge.
I would like to reuse Clojure functions from ClojureScript to achieve
consistent back- and front-end password quality validation.
One potential wrinkle may be the issue of the size of the bloom filter I'm
using for the diction
thanks for that lars.
it works better. emacs does restart for each file, but it is faster than
before because it only evaluates the code without ui.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegr
Hey,
This may be not be the answer you are expecting but here it goes anyways..
(defmacro fnd [& rest]
`(with-meta (fn ~@rest) {:source '~&form}))
would associate the source of the function with the function as its meta
data you are defining and you can extract any subset of it for whatever yo
> On Tue, Aug 9, 2011 at 5:43 PM, Baishampayan Ghose
> wrote:
>>
>> A sample implementation of the `defm` macro used above could be
>> something like this (UNTESTED!) -
>> *snip*
>
> `defm` is already at `match.core/defmatch`. Pretty neat :)
Lol! I realised that while looking into the match.core
Hi BG,
On Tue, Aug 9, 2011 at 5:43 PM, Baishampayan Ghose wrote:
> A sample implementation of the `defm` macro used above could be
> something like this (UNTESTED!) -
> *snip*
`defm` is already at `match.core/defmatch`. Pretty neat :)
> I personally believe that David and Ambrose are doing so
Hello,
Is there any chance to get a list of args like it is for functions
defined by defn ?
I would like to use (count (first (:argslist (meta (fn[ a ] (println
a)) for my function which would return wrapper which can accept
optional arguments. Optional args would be decelerated not by caller
Hi Sam,
On Tue, Aug 9, 2011 at 3:50 PM, Sam Aaron wrote:
>
>
> Do you happen to have any simple descriptions/examples of where and how we
> might use this stuff in our daily programming repertoires?
Think of pattern matching sugar for nested conditionals.
For example
(match [x y]
[1 0
That's a great explanation Baishampayan, thanks !
Edmund
On 09/08/2011 10:43, Baishampayan Ghose wrote:
>> Do you happen to have any simple descriptions/examples of where and
>> how we might use this stuff in our daily programming repertoires? I
>> for one am sure I'm not educated enough as to t
> Do you happen to have any simple descriptions/examples of where and how we
> might use this stuff in our daily programming repertoires? I for one am sure
> I'm not educated enough as to the value and utility of pattern matching - at
> the moment I just think "that looks cool" rather than "I'm
On Aug 9, 12:22 pm, mmwaikar wrote:
> Hi,
>
> Assuming there are some DB credentials specified in a project.clj file as a
> map, how should I read those credentials in my clojure code -
>
> 1) should I use slurp and then parse that text?
> 2) should I (use 'leiningen.core) and then (load-file "p
Exciting stuff!
Do you happen to have any simple descriptions/examples of where and how we
might use this stuff in our daily programming repertoires? I for one am sure
I'm not educated enough as to the value and utility of pattern matching - at
the moment I just think "that looks cool" rather t
Hi,
Assuming there are some DB credentials specified in a project.clj file as a
map, how should I read those credentials in my clojure code -
1) should I use slurp and then parse that text?
2) should I (use 'leiningen.core) and then (load-file "project.clj")
3) or something else
Please let me k
57 matches
Mail list logo