Hi.
You might consider reading Peter Seibel's excellent Practical Common Lisp
which has some nice macro-work in it. If after that you're still hungry for
more, consider Let Over Lambda by Doug Hoyte.
Admitted, both cover Common Lisp, but the differences will not keep you from
getting a
Hmm, I think the maven convention will start to make sense, somehow :
src/main/java/
-
src/main/java/
src/main/clojure/ ; clojure only code (jvm that is)
src/main/clojurescript/ ; clojurescript only code
src/main/clojurescript/ ; shared by clojure or clojurescript : no
bounty, but better name
I managed to do it.
The problem is that we need to use the function set in a goog.net.Cookies
object.
There is already such an object, which is called goog.net.cookies, see the
bottom of the source file:
/**
* A static default instance.
* @type {goog.net.Cookies}
*/
goog.net.cookies = new
Thanks to all! You have helped a lot!
Also I will consider reading Practical Common Lisp.
On Oct 6, 9:42 am, Stefan Kamphausen ska2...@googlemail.com wrote:
Hi.
You might consider reading Peter Seibel's excellent Practical Common Lisp
which has some nice macro-work in it. If after that you're
I use Base64 encoding a lot and the slow implementation is hurting a
lot. It's slower than Sun misc encoder/decoder
and that one is very very slow. I was using Sun's implementation a bit
and it took 80 seconds to encode a 56 MB file.
Then I found this: http://migbase64.sourceforge.net/
It loaded
On Oct 3, 9:27 pm, Stuart Halloway stuart.hallo...@gmail.com wrote:
Catching checked exceptions seems to work fine. Try e.g.
(try (throw (java.io.IOException.)) (catch java.io.IOException _ caught!))
I suspect something else is going wrong in the GAE example. Can you narrow
the code down
It does.
user= (defn f [] (Class/forName nonexistant))
#'user/f
user= (try (f) (catch ClassNotFoundException e caught!))
caught!
--
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
thus enable all Clojure developers to have lightning
fast Base64 encoding/decoding?
This is already possible, if you're using leiningen:
put the file in src/util/ and compile, you can now call it as usual.
On Thu, Oct 6, 2011 at 11:16 AM, Rok Lenarcic rok.lenar...@gmail.comwrote:
I use
Hi,
may I ask an heretic question?
When there is a fast migbase64... why not just use that one?
It was always promoted to use existing Java libraries where it made sense.
Or is clojurescript now changing this stance?
Sincerely
Meikel
--
You received this message because you are subscribed
I use Base64 encoding a lot and the slow implementation is hurting a
lot. It's slower than Sun misc encoder/decoder
and that one is very very slow. I was using Sun's implementation a bit
and it took 80 seconds to encode a 56 MB file.
Then I found this: http://migbase64.sourceforge.net/
It
On Oct 6, 2011, at 4:44 AM, Jonathan Fischer Friberg wrote:
thus enable all Clojure developers to have lightning
fast Base64 encoding/decoding?
This is already possible, if you're using leiningen:
put the file in src/util/ and compile, you can now call it as usual.
I've used the sun.misc
Thanks Jonathan! That's it exactly. I had seen goog.net.cookies
(lowercase) and didn't realize it was an object on which to make the
set call. I thought in was another namespace in which to make the
function call, thus I had been writing:
.. (:use [goog.net.cookies :as cookie]) ...
and was
This actually introduces an opportunity for a much larger set of utilities.
clojure.data.crypto
base64 is part of this idea anyways, and putting it in place along with
nice wrappers around the messy java crypto bits I think could provide a
significant win. I have had to do this several times
Hi,
I want to instantiate a record, but having the record type as value at
runtime.
Example:
(defrecord car [year manufacturere])
(defrecord bike [year manufacturere])
(defrecord boat [year manufacturer])
I want to do (new stuff 1982 Mercedes), but having the record type
kept in the variable
Assuming you want to do things with the record later, why not just
create it in the let binding
(let [foo (-car 1982 Mercedes)]
...)
or
(let [foo (car. 1982 Mercedes)]
...)
or even
(let [foo (map-car {:year 1982 :manufacturer Mercedes})]
...)
or if you must
(let [foo #user.car{:year
is it -record just a shortrand for record.?
2011/10/6 Aaron Bedra aaron.be...@gmail.com
Assuming you want to do things with the record later, why not just
create it in the let binding
(let [foo (-car 1982 Mercedes)]
...)
or
(let [foo (car. 1982 Mercedes)]
...)
or even
(let [foo
Wow, that was fast. Thanks.
This could work but only partially.
(let [stuff car]
(new stuff 1982 Mercedes)
(new stuff 2001 Seat)
...)
I could take advantage of the fact that records are maps:
(let [stuff (car. 1982 Mercedes)]
... use Mercedes...
(assoc stuff :year 2001 :manufacturer
Just wanted to add the Apache commons codec has a base64
encoder/decoder. With a quick test I was able to encode a ~100MB file
in 2.3sec. Example code below:
In leiningen: [commons-codec 1.4]
(require '[clojure.java.io :as io])
(import '[org.apache.commons.codec.binary Base64OutputStream])
Hi,
use the factory function.
Clojure 1.3.0
user= (defrecord car [year manufacturer])
user.car
user= (defn create [stuff] (stuff 1982 Mercedes Benz))
#'user/create
user= (create -car)
#user.car{:year 1982, :manufacturer Mercedes Benz}
You can't pass car. around at runtime because it is a class.
The clojure.contrib.base64 discussion has inspired me (sorry!) to
write this.. I would very much like to see a faster JSON parser be in
contrib. clj-json can beat clojure.data.json by up to a factor of 140x
when reading/parsing and 5x when creating a JSON string.
clojure.data.json reading:
This is what I'm looking for. Thanks. I have not seen this kind of
expression before: -foo. Is is created by defrecord or is it
implemented at reader level?
I realize now that I can also keep a generating function in the
variable stuff:
(let [stuff #(car. %1 %2)]
(stuff 1982 Mercedes)
(stuff
Sure, I can use that file. This DIY attitude doesn't benefit the
beginners. I can add and use that java, but 90% of clojure users will
use the clojure contrib function and 9% will use faster sun encoder,
because people don't know that Sun's implementations are slow and that
better ones are
When using clojure.org does anybody else quite frequently get the
Wikispaces homepage instead? This seems to happen most often when I
start Firefox because I always have a clojure.org tab open. Any idea
what's causing this?
--
You received this message because you are subscribed to the Google
I threw a base64 encoder together a while ago when playing with the new
primitive stuff. Interesting to note that it is faster than the one in
Apache commons-codec.
https://github.com/ataggart/codec/blob/master/src/codec/base64.clj
--
You received this message because you are subscribed to
On 6 October 2011 18:27, Aaron Bedra aaron.be...@gmail.com wrote:
This actually introduces an opportunity for a much larger set of utilities.
clojure.data.crypto
base64 is part of this idea anyways, and putting it in place along with
nice wrappers around the messy java crypto bits I think
I threw a base64 encoder together a while ago when playing with the new
primitive stuff. Interesting to note that it is faster than the one in
Apache commons-codec.
https://github.com/ataggart/codec/blob/master/src/codec/base64.clj
Do you want to make this the basis for an improved
On Thu, Oct 6, 2011 at 4:39 AM, Meikel Brandmeyer (kotarak) m...@kotka.de
wrote:
It does.
user= (defn f [] (Class/forName nonexistant))
#'user/f
user= (try (f) (catch ClassNotFoundException e caught!))
caught!
the problem is in Reflector.java and the call to Class/forName is
Sure, I'll start working on it. Do you want it to be worked on in a contrib
project or just submit it once it's functional? Also, I assume you'd want
this to work with 1.2, right?
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this
I do
On Thu, Oct 6, 2011 at 2:32 PM, Simon Morgan s...@spamcop.net wrote:
When using clojure.org does anybody else quite frequently get the
Wikispaces homepage instead? This seems to happen most often when I
start Firefox because I always have a clojure.org tab open. Any idea
what's causing
-foo is new in 1.3. I'm surprised so many people are recommending it
without mentioning that. -foo is like foo., except that it's a real
clojure function and as such can be passed as a function; you can call
apply on it; and so forth.
On Oct 6, 11:05 am, Razvan Rotaru razvan.rot...@gmail.com
Sure, I'll start working on it. Do you want it to be worked on in a contrib
project or just submit it once it's functional?
Whatever works best for you.
Also, I assume you'd want this to work with 1.2, right?
I won't personally need that. Plus, this is the kind of lib where the code
Master works like a charm now - Thanks!!
On Oct 4, 5:44 am, db donald.bl...@gmail.com wrote:
Works for me. Thanks.
On Oct 3, 10:15 am, Brenton bashw...@gmail.com wrote:
If you have been having problems the ClojureScript andOpenJDK, please
try the current master branch of
Do you know if that solution will extend to sharing clojure core libraries
where that makes sense (a lot of copy-n-pasted code in
[core|set|string|walk|zip].cljs)?
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to
Hi!
Issue #287 [1] seems related to this.
I've posted a description of a possible use of unquote in defproject
for doing things like
(defproject ...
;; private-repo-info comes from ~/.lein/init.clj
:repositories ~(user/private-repo-info))
as a comment on the issue.
Sincerely,
Michał
[1]
An excellent JVM library to use as base is Jackson:
http://jackson.codehaus.org/
It would be wonderful to see a Clojure-friendly version of it: having it
create Clojure-specific structures from JSON, and also recognizing Clojure
deftypes for serialization. The streaming API is friendly enough
clj-json uses Jackson and so does https://github.com/dakrone/cheshire
On Thu, Oct 6, 2011 at 8:07 PM, Tal Liron tal.li...@gmail.com wrote:
An excellent JVM library to use as base is Jackson:
http://jackson.codehaus.org/
It would be wonderful to see a Clojure-friendly version of it: having
On Thu, Oct 6, 2011 at 5:07 PM, Tal Liron tal.li...@gmail.com wrote:
An excellent JVM library to use as base is Jackson:
http://jackson.codehaus.org/
It would be wonderful to see a Clojure-friendly version of it
Both clj-json and cheshire (https://github.com/dakrone/cheshire) are
actually
Cheshire looks great, thanks for the tip!
I wonder, then, what's the OP's problem? I think it's good to have a
lightweight, 100% Clojure version of JSON in contrib. A lighter weight is
often a higher priority than performance. I think both approaches have their
place.
In the Java world, too,
As I mentioned in my previous email, my problem isn't really picking a
JSON implementation for my own needs, but rather when I use a library
that uses a slower implementation. If I wanted to use clutch for
couchdb access and didn't pay too much attention as to what leiningen
pulls in, I wouldn't
fair enough.
Is there any support for this at the moment?
My only comment would be that it is quite handy to know that you have
imported code that might be platform specific.
It also seems reasonable that pure clojure code might be used by the .net
version.
Cheers
Dave
--
You received
I don't see why not, in principle.
However, from my perspective when compiling at the moment, these are already
taken care of.
So I have not looked into this side of things.
I think that it would need some thought to get the best solution.
Cheers
D
--
You received this message because you
In my opinion, the situation is not clear cut:
I might want a slower but more portable library if porting clutch to
clojurescript.
(I read that someone has this working...)
I might just want a lib that works if moving to .net in the short term but
optimise with a faster library later.
Hi,
slf4j comes to mind. Have a standard API which is provided by the different
libraries. If you were targeting clojurescript you'd specify the portable
library. For a server application running on the JVM you'd specify a fast
Jackson-based implementation. This leaves the choice to the user
43 matches
Mail list logo