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 deepe
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/clojure&script/ ; 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 goog.
Thanks to all! You have helped a lot!
Also I will consider reading "Practical Common Lisp".
On Oct 6, 9:42 am, Stefan Kamphausen 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 still hungry for
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 fr
On Oct 3, 9:27 pm, Stuart Halloway 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 to a block you ca
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
Not
>
> 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 wrote:
> I use Base64 encoding a lot
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 t
> 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/
>
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.m
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 cal
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 now
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{
is it ->record just a shortrand for record.?
2011/10/6 Aaron Bedra
> 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 (ma
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 :manufac
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])
(de
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
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:
(dotim
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")
(stu
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 availabl
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
Gro
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 th
On 6 October 2011 18:27, Aaron Bedra 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 could provide a
>
> 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 c
On Thu, Oct 6, 2011 at 4:39 AM, Meikel Brandmeyer (kotarak)
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
non-reflective
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 gro
I do
On Thu, Oct 6, 2011 at 2:32 PM, Simon Morgan 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 this?
>
> --
->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 wrote:
> This is what I'm
> 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
w
Master works like a charm now - Thanks!!
On Oct 4, 5:44 am, db wrote:
> Works for me. Thanks.
>
> On Oct 3, 10:15 am, Brenton wrote:
>
>
>
>
>
>
>
> > If you have been having problems the ClojureScript andOpenJDK, please
> > try the current master branch of ClojureScript.
>
> > I would be inte
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 t
clj-json uses Jackson and so does https://github.com/dakrone/cheshire
On Thu, Oct 6, 2011 at 8:07 PM, Tal Liron 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 it
> create Cloj
On Thu, Oct 6, 2011 at 5:07 PM, Tal Liron 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 already based on
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, t
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 kn
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 thi
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.
O
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 of
43 matches
Mail list logo