[ANN] clj-toml 0.2.0

2013-02-25 Thread Luca Antiga
Quick announcement: clj-toml 0.2.0 is available on 
Clojars
.

clj-toml  is a 
TOMLparser for Clojure. It was written on top 
of the 
Kern  library by Armando Blancas (kudos).

TOML is a minimalistic, human-readable format that maps to a hash (like 
INI, but more evolved).

Cheers,

Luca

-- 
-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[ANN] vectorz-clj 0.6.0

2013-02-25 Thread Mikera
Hi All,

Pleased to announce the latest release of vectorz-clj, a high performance 
vector and matrix math implementation for Clojure.

GitHub site: https://github.com/mikera/vectorz-clj
Clojars: https://clojars.org/net.mikera/vectorz-clj

Key features:

a) 100% pure JVM code (no native libraries required)
b) Supports a clean, functional, idiomatic style of vector and matrix maths 
in Clojure
c) Currently the most complete implementation of the "core.matrix" API for 
Clojure numerics
d) Very fast - designed for games, simulations, machine learning 
applications etc.

For an idea of performance, it is worth comparing with regular Clojure 
vectors:

  (let [a [1 2 3 4 5 6 7 8 9 10]
b [1 2 3 4 5 6 7 8 9 10]]
(c/quick-bench (dotimes [i 1000] (vec (map clojure.core/+ a b)  
  ;; => Execution time mean per addition : 1221 ns

Using vectorz-clj to do the same additions is about 15-20x faster:

  (let [a (matrix :vectorz [1 2 3 4 5 6 7 8 9 10])
b (matrix :vectorz [1 2 3 4 5 6 7 8 9 10])]
(c/quick-bench (dotimes [i 1000] (+ a b
  ;; => Execution time mean per addition: 68 ns

If you are willing to abandon immutability and use mutable vectors, you can 
go faster still:

  (let [a (matrix :vectorz [1 2 3 4 5 6 7 8 9 10])
b (matrix :vectorz [1 2 3 4 5 6 7 8 9 10])]
(c/quick-bench (dotimes [i 1000] (add! a b
  ;; => Execution time mean per addition: 31 ns

This is all still very much in early development, so feedback / ideas / 
code contributions all very welcome!

  Mike.

-- 
-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [ANN] clj-toml 0.2.0

2013-02-25 Thread Baishampayan Ghose
Nice! I was thinking about writing a parser myself but you beat me to
the punch :) ~BG

On Mon, Feb 25, 2013 at 2:56 PM, Luca Antiga  wrote:
> Quick announcement: clj-toml 0.2.0 is available on Clojars.
>
> clj-toml is a TOML parser for Clojure. It was written on top of the Kern
> library by Armando Blancas (kudos).
>
> TOML is a minimalistic, human-readable format that maps to a hash (like INI,
> but more evolved).
>
> Cheers,
>
> Luca
>
> --
> --
> 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 group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
Baishampayan Ghose
b.ghose at gmail.com

-- 
-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [ANN] clj-toml 0.2.0

2013-02-25 Thread Luca Antiga
Ah :-) Nothing helps like being sick on a weekend...

Luca

On Monday, February 25, 2013 11:19:25 AM UTC+1, Baishampayan Ghose wrote:
>
> Nice! I was thinking about writing a parser myself but you beat me to 
> the punch :) ~BG 
>
> On Mon, Feb 25, 2013 at 2:56 PM, Luca Antiga 
> > 
> wrote: 
> > Quick announcement: clj-toml 0.2.0 is available on Clojars. 
> > 
> > clj-toml is a TOML parser for Clojure. It was written on top of the Kern 
> > library by Armando Blancas (kudos). 
> > 
> > TOML is a minimalistic, human-readable format that maps to a hash (like 
> INI, 
> > but more evolved). 
> > 
> > Cheers, 
> > 
> > Luca 
> > 
> > -- 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "Clojure" group. 
> > To post to this group, send email to clo...@googlegroups.com 
> > Note that posts from new members are moderated - please be patient with 
> your 
> > first post. 
> > To unsubscribe from this group, send email to 
> > clojure+u...@googlegroups.com  
> > For more options, visit this group at 
> > http://groups.google.com/group/clojure?hl=en 
> > --- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "Clojure" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to clojure+u...@googlegroups.com . 
> > For more options, visit https://groups.google.com/groups/opt_out. 
> > 
> > 
>
>
>
> -- 
> Baishampayan Ghose 
> b.ghose at gmail.com 
>

-- 
-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: suggest to have defn/new/throw/etc.. allow evaluating ...maybe?

2013-02-25 Thread AtKaaZ
Thank you very much Tim. I will use the eval one with "thrown?"


On Mon, Feb 25, 2013 at 6:49 AM, Tim Reinke  wrote:

> It's nice to see some input validation!
>
> It seems your problem, ultimately, is the testability of macros.
>
> You can wrap the call to the macro in an eval (this way the error is
> thrown by eval, not the compiler):
>
> (is (thrown? AssertionError  (eval '(dedefn (str "a" "b")
>
> This can get a little ugly if you need the eval form to capture variables.
>
> Alternatively, you can factor the heavy lifting out of the defmacro form
> and test your logic there:
>
> (defn defdefn* [z]
>  (assert (symbol? z))
>  `(defn ~z [x#] x#]
>
>  (defmacro dedefn [zsym]
> (defdefn* (eval zsym))
>
> On Saturday, February 23, 2013 11:24:26 PM UTC-8, AtKaaZ wrote:
>>
>> => *(defn (symbol (str "a" "b")) [x] x)*
>> IllegalArgumentException First argument to defn must be a symbol
>> clojure.core/defn (core.clj:277)
>>
>> maybe allow ~ like this:
>> =>* (defn ~(symbol (str "a" "b")) [x] x)*
>> IllegalArgumentException First argument to defn must be a symbol
>> clojure.core/defn (core.clj:277)
>>
>> to act like this:
>> => *(eval (backtick/template (defn ~(symbol (str "a" "b")) [x] x)))*
>> #'util.funxions/ab
>>
>> I know you'll want to suggest something like this instead:
>> => *(defmacro dedefn [zsym]
>>  `(defn ~(eval zsym) [x#] x#))*
>> #'util.funxions/dedefn
>> => *(dedefn (symbol (str "a" "b")))*
>> #'util.funxions/ab
>>
>> which is almost good, except if you want to place extra checks on the
>> input like so:
>> => *(defmacro dedefn [zsym]
>>  (let [z (eval zsym)
>>_ (assert (symbol? z))
>>]
>>`(defn ~z [x#] x#)
>>)
>>  )*
>> #'util.funxions/dedefn
>> => *(dedefn (symbol (str "a" "b")))*
>> #'util.funxions/ab
>> => *(dedefn (str "a" "b"))*
>> AssertionError Assert failed: (symbol? z)  util.funxions/dedefn
>> (NO_SOURCE_FILE:3)
>>
>> it works but you cannot test them since they happen at compile time, ie.
>> => *(clojure.test/is (thrown? AssertionError (dedefn (str "a" "b"*
>> CompilerException java.lang.AssertionError: Assert failed: (symbol? z),
>> compiling:(NO_SOURCE_PATH:1:**42)
>> => *(clojure.test/is (thrown? AssertionError (throw (new
>> AssertionError*
>> #
>> => *(clojure.test/is (thrown? AssertionError 1))*
>>
>> FAIL in clojure.lang.PersistentList$**EmptyList@1 (NO_SOURCE_FILE:1)
>> expected: (thrown? AssertionError 1)
>>   actual: nil
>> nil
>>
>> I guess there's no way to get rid of that eval that's happening there
>> outside of the ` in the macro, and it kinda makes sense to be that way.
>>
>> I have a feeling there's a workaround to be able to catch the exception
>> but I haven't explored it yet...
>>
>> Any thoughts?
>>
>> --
>> Please correct me if I'm wrong or incomplete,
>> even if you think I'll subconsciously hate it.
>>
>>   --
> --
> 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 group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Please correct me if I'm wrong or incomplete,
even if you think I'll subconsciously hate it.

-- 
-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




was there a time when clojure empty seqs were falsy?

2013-02-25 Thread Jim - FooBar();
I found this code snippet [1] written by Rich but presumably using a 
very old version of Clojure.  The thing that stand out the most is this 
at the bottom (the 'correct' fn):


  (or  (known [word] *nwords*) (known (edits1 word) *nwords*)
(known-edits2 word *nwords*) [word])

It seems to me that Rich was using 'or' to test whether a seq is empty 
or not, wanting to keep the first non-empty one! Obviously this wouldn't 
work with current Clojure as an empty seq is still truthy. Consequently 
if I don't mess about with Rich's code I always get the empty set back 
as (known [word] *nwords*) returns something truthy (the empty set)...


so it seems that at the time Rich wrote this empty seqs evaluated to 
false...Is this true?


[1] 
http://en.wikibooks.org/wiki/Clojure_Programming/Examples/Norvig_Spelling_Corrector


Jim

--
--
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups "Clojure" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: was there a time when clojure empty seqs were falsy?

2013-02-25 Thread David Powell
Some time before the release of Clojure 1.0, there didn't used to be any
such thing as an empty sequence.  You either had a (lazy) sequence, or nil.
 This made it easy to use sequences as emptiness tests, but had the cost
that a lazy sequence wasn't fully lazy because anything that returned one
had to attempt to evaluate the first item in order to determine whether
there was anything to return or not.

[ There are some obsolete notes describing the change here:
http://clojure.org/lazy  for the historically curious.  Or perhaps here:
http://clojure.org/lazier (And the 'streams' referred to in those docs
refer to this failed experiment: http://clojure.org/streams).  Basically
lazy-cons was replaced by lazy-seq. ]

-- 
Dave

-- 
-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: was there a time when clojure empty seqs were falsy?

2013-02-25 Thread Jim - FooBar();

I see...
thanks a lot! :-)

Jim

On 25/02/13 12:34, David Powell wrote:
Some time before the release of Clojure 1.0, there didn't used to be 
any such thing as an empty sequence.  You either had a (lazy) 
sequence, or nil.  This made it easy to use sequences as emptiness 
tests, but had the cost that a lazy sequence wasn't fully lazy because 
anything that returned one had to attempt to evaluate the first item 
in order to determine whether there was anything to return or not.


[ There are some obsolete notes describing the change here: 
http://clojure.org/lazy  for the historically curious.  Or perhaps 
here: http://clojure.org/lazier (And the 'streams' referred to in 
those docs refer to this failed experiment: 
http://clojure.org/streams).  Basically lazy-cons was replaced by 
lazy-seq. ]


--
Dave

--
--
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google 
Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to clojure+unsubscr...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.




--
--
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups "Clojure" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: was there a time when clojure empty seqs were falsy?

2013-02-25 Thread Meikel Brandmeyer (kotarak)

I talked about the history of lazy-seq and friends at the EuroClojure 
2012: http://vimeo.com/channels/357487/45561410


Kind regards
Meikel

-- 
-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Clojure Performance For Expensive Algorithms

2013-02-25 Thread Geo
This is pretty neat. Thanks!

Yeah the swapping of prev and curr seems to be a stumbling block.

On Sunday, February 24, 2013 6:08:39 PM UTC-5, Aria Haghighi wrote:
>
> I have a solution (gist here https://gist.github.com/aria42/5026109, key 
> bits pasted below). It's pretty short (15 lines) and readable (I think) and 
> only 50% slower than the Java version on my machine (averaging over 25 runs 
> of your benchmark function). 
>
> Generally, I've found it's really easy when you just translate Java code 
> like this into Clojure, the Clojure will read worse than the original Java; 
> to boot it will also be  slower! And not to be insulting, but I think the 
> other Clojure solutions I saw in this thread seem to have this property. 
> You usually have to pull out some abstraction in order to regain on the 
> readability and concentrate on performance there. Here, I think it's a 
> macro you'll probably use all over the place, arr-max, which will find the 
> largest value of an expression looping over an array's index and values. 
> Then lcs is just nested uses of arr-max that I think is pretty reasonable. 
> The thing which clutters the remaining code are the prev/cur swapping which 
> I don't have a slick way of handling.   
>
> (defmacro arr-max 
>   "return maximum value of `expr` over the indices
>and values of array `arr`, where `idx-symb` and `val-symb`
>are bound to index and values of `arr`"
>   [arr idx-symb val-symb expr]
>   `(let [arr# ~arr
>  n# (alength arr#)]
>  (loop [~idx-symb 0 max-val# java.lang.Long/MIN_VALUE]
>(if (= ~idx-symb n#)
>  max-val#
>  (let [~val-symb (aget arr# ~idx-symb)
>val# ~expr]
>(recur (inc ~idx-symb)
>   (if (> val# max-val#)
> val# max-val#)))
>  
> (defn lcs [^objects a1 ^objects a2]
>   (let [prev-ref (atom (long-array (inc (alength a2
> cur-ref (atom (long-array (inc (alength a2]
> (arr-max a1 i v1
>(let [^longs prev @prev-ref
>  ^longs cur @cur-ref
>  max-len (arr-max a2 j v2
>  (let [match-len (if (.equals v1 v2)
>(inc (aget prev j))
>0)]
>(aset cur (inc j) match-len)
>match-len))]
>  (reset! prev-ref cur)
>  (reset! cur-ref prev)
>  (long max-len)
>  
>
>
> On Sunday, February 24, 2013 12:45:18 PM UTC-8, Marko Topolnik wrote:
>>
>>
>>
>> On Sunday, February 24, 2013 9:15:45 PM UTC+1, puzzler wrote:
>>>
>>>
>>> As I mentioned before, I'm generally happy with Clojure's performance, 
>>> but the few times I've had performance problems, I ended up rewriting the 
>>> code at least three different ways in order to try to find the magic 
>>> combination that would boost performance. 
>>>
>>
>> Lately I've leaned towards going full monty the first time out: stop 
>> guessing and optimize everything past the entry point to the critical 
>> section. It sounds like more work up front, but in the end it's the "smart" 
>> approach that results in more total effort.
>>  
>>
>>> Fortunately, dropping down to Java is relatively painless.  But I still 
>>> wonder whether there might be some benefit to having a "low-level DSL" 
>>> within Clojure, a mode that lets you choose to write your code in a way 
>>> where the semantics are closer to the underlying platform.
>>>
>>
>> Just one feature would make a huge difference: reassignable locals.
>>  
>>
>>> I haven't used Clojurescript much, but I get the impression that 
>>> Clojurescript is already a step in that direction, with a simpler story 
>>> regarding how mutation, arrays, and primitives are translated to the 
>>> underlying platform, arguably making it easier to get good performance when 
>>> you need it.
>>>
>>
>> The gap between Clojure and JavaScript is far less than Java because both 
>> are dynamic. I think that plays a big part in why ClojureScript can be more 
>> transparent.
>>  
>>
>

-- 
-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




ClojureScript js->clj not converting

2013-02-25 Thread Mike Longworth
I've updated to 0.0-1586 build #22 from a much older release: 0.0-1450

I'm now geting a problem with (js->clj token) not converting the object

I don't think the problem is with js->clj:

(println (expose token true)) gives:

access_token = ya29.AHES6ZSgnk3Ws5bB-2aDx41Bbr335hKugjZJfcNAs83d121S306fxy64
token_type = Bearer
expires_in = 3600
client_id = 52351124085.apps.googleusercontent.com
scope = 
https://www.googleapis.com/auth/drive.file,https://www.googleapis.com/auth/drive.metadata.readonly,https://www.googleapis.com/auth/drive.readonly
g_user_cookie_policy = undefined
cookie_policy = undefined
issued_at = 1361807171
expires_at = 1361810771

This looks ok.

however 
> token

gives:

"Error evaluating:" token :as "esef.client.evidence.token"
#
TypeError: Object [object Object] has no method 'toString'

> (type token)

gives a blank line. I think this is why js->clj isn't converting.

> (alength token)

gives a blank line.

(.-token_type token)

Correctly gives 
ya29.AHES6ZSgnk3Ws5bB-2aDx41Bbr335hKugjZJfcNAs83d121S306fxy64

Any ideas?  Thanks Mike.





-- 
-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: ClojureScript js->clj not converting

2013-02-25 Thread David Nolen
Are you expecting token to get converted into a ClojureScript map?


On Mon, Feb 25, 2013 at 11:23 AM, Mike Longworth
wrote:

> I've updated to 0.0-1586 build #22 from a much older release: 0.0-1450
>
> I'm now geting a problem with (js->clj token) not converting the object
>
> I don't think the problem is with js->clj:
>
> (println (expose token true)) gives:
>
> access_token =
> ya29.AHES6ZSgnk3Ws5bB-2aDx41Bbr335hKugjZJfcNAs83d121S306fxy64
> token_type = Bearer
> expires_in = 3600
> client_id = 52351124085.apps.googleusercontent.com
> scope =
> https://www.googleapis.com/auth/drive.file,https://www.googleapis.com/auth/drive.metadata.readonly,https://www.googleapis.com/auth/drive.readonly
> g_user_cookie_policy = undefined
> cookie_policy = undefined
> issued_at = 1361807171
> expires_at = 1361810771
>
> This looks ok.
>
> however
> > token
>
> gives:
>
> "Error evaluating:" token :as "esef.client.evidence.token"
> #
> TypeError: Object [object Object] has no method 'toString'
>
> > (type token)
>
> gives a blank line. I think this is why js->clj isn't converting.
>
> > (alength token)
>
> gives a blank line.
>
> (.-token_type token)
>
> Correctly gives
> ya29.AHES6ZSgnk3Ws5bB-2aDx41Bbr335hKugjZJfcNAs83d121S306fxy64
>
> Any ideas?  Thanks Mike.
>
>
>
>
>
>  --
> --
> 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 group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




ANN Titanium 1.0.0-alpha2 is released

2013-02-25 Thread Michael Klishin
Titanium [1] is a powerful Clojure graph library that is built on top of
Aurelius Titan. It combines a Clojure-friendly API and graph processing DSL
with the power of Titan.

alpha2 release notes:
http://blog.clojurewerkz.org/blog/2013/02/25/titanium-1-dot-0-0-alpha2-is-released/

1. http://titanium.clojurewerkz.org
-- 
MK

http://github.com/michaelklishin
http://twitter.com/michaelklishin

-- 
-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [ANN] clj-toml 0.2.0

2013-02-25 Thread Armando Blancas
Glad to see Kern being useful. Your parser uses those combinators quite 
effectively.

On Monday, February 25, 2013 1:26:26 AM UTC-8, Luca Antiga wrote:
>
> Quick announcement: clj-toml 0.2.0 is available on 
> Clojars
> .
>
> clj-toml  is a 
> TOMLparser for Clojure. It was written on 
> top of the 
> Kern  library by Armando Blancas (kudos).
>
> TOML is a minimalistic, human-readable format that maps to a hash (like 
> INI, but more evolved).
>
> Cheers,
>
> Luca
>

-- 
-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Support for pmap?

2013-02-25 Thread MC Andre
Does ClojureScript support pmap?

-- 
-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




ClojureScript browser REPL goes bonkers after it evals

2013-02-25 Thread Bobby Wang
Hi,

Sometimes when I start the CLJS browser REPL and evaluate something like 
js/alert, the alert runs fine, but after a few seconds it goes into an 
infinite loop while repeatedly printing "*ClojureScript:cljs.user> 
java.io.IOException: Write end dead*".

The same thing happens on ClojureScript One, which I think uses older 
dependencies.

Any idea what might be wrong?

My setup:

* clojure 1.4.0
* clojurescript 0.0-1586
* lein-cljsbuild 0.3.0
* Mac OS X 10.8.2
* Java 1.6.0_41 that came with OS X
* Also tried to install Oracle's Java 7, but it doesn't seem to work out of 
box yet

Much appreciated,

Bobby

-- 
-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Clojure Performance For Expensive Algorithms

2013-02-25 Thread bernardH

Hi,

Nice solution, but don't we need to distinguish between the array types ? 
(cf. inline comment below )

Cheers,

B.

On Monday, February 25, 2013 12:08:39 AM UTC+1, Aria Haghighi wrote:
>
> […] Here, I think it's a macro you'll probably use all over the place, 
> arr-max, which will find the largest value of an expression looping over an 
> array's index and values. Then lcs is just nested uses of arr-max that I 
> think is pretty reasonable. The thing which clutters the remaining code are 
> the prev/cur swapping which I don't have a slick way of handling.   
>
> (defmacro arr-max 
>   "return maximum value of `expr` over the indices
>and values of array `arr`, where `idx-symb` and `val-symb`
>are bound to index and values of `arr`"
>   [arr idx-symb val-symb expr]
>   `(let [arr# ~arr
>  n# (alength arr#)]
>  (loop [~idx-symb 0 max-val# java.lang.Long/MIN_VALUE]
>
>
Shouldn't we select java.lang.Double/NEGATIVE_INFINITY for arrays of 
Doubles ?

   (if (= ~idx-symb n#)
>  max-val#
>  (let [~val-symb (aget arr# ~idx-symb)
>val# ~expr]
>(recur (inc ~idx-symb)
>   (if (> val# max-val#)
> val# max-val#)))
>  
>
>

-- 
-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Support for pmap?

2013-02-25 Thread David Nolen
Not sure how we could given JS is single threaded.

On Monday, February 25, 2013, MC Andre wrote:

> Does ClojureScript support pmap?
>
> --
> --
> 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 'clojure@googlegroups.com');>
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com  'clojure%2bunsubscr...@googlegroups.com');>
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com  'clojure%2bunsubscr...@googlegroups.com');>.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: ClojureScript browser REPL goes bonkers after it evals

2013-02-25 Thread Bobby Wang
Update: this seems to only happen if I start the CLJS REPL inside a CLJ 
REPL. If I start straight from the command line (ie. lein trampoline 
cljsbuild repl-listen) it's fine.

On Monday, 25 February 2013 19:22:06 UTC-5, Bobby Wang wrote:
>
> Hi,
>
> Sometimes when I start the CLJS browser REPL and evaluate something like 
> js/alert, the alert runs fine, but after a few seconds it goes into an 
> infinite loop while repeatedly printing "*ClojureScript:cljs.user> 
> java.io.IOException: Write end dead*".
>
> The same thing happens on ClojureScript One, which I think uses older 
> dependencies.
>
> Any idea what might be wrong?
>
> My setup:
>
> * clojure 1.4.0
> * clojurescript 0.0-1586
> * lein-cljsbuild 0.3.0
> * Mac OS X 10.8.2
> * Java 1.6.0_41 that came with OS X
> * Also tried to install Oracle's Java 7, but it doesn't seem to work out 
> of box yet
>
> Much appreciated,
>
> Bobby
>

-- 
-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.