Re: question about clojure.lang.LazySeq.toString()

2013-03-21 Thread Cedric Greevey
Eh. Not just any collisions, but only ones where the succession of tails
are equal-as-seqs but not identical as objects (.equals, but not ==) for
"sufficiently long". So seqs that differ after only a trillion items would
blow up. So would equal ones sharing no tail structure. Putting (iterate
inc 0) and (range) into a hashset together would fail, and (concat (range
10) [3]) and (concat (range 10) [4]) dropped in together
would either fail or make things really, really sloow, depending on
whether anything held onto the head of either seq.


On Fri, Mar 22, 2013 at 2:37 AM, Cedric Greevey  wrote:

> Hrm. Sounds like getting the hash of an infinite sequence will hang or
> cause OOME.
>
> On the one hand, *most* uses of the hash are followed by .equals if the
> hashes match, and .equals on an infinite seq can't work, since if it gives
> up and says "equal" after some large number N of elements, the seqs might
> still differ at position N + 1, and there's no *general* way to determine
> in an analytic manner whether two seqs will produce identical output, or
> even whether they're infinite (even given the generating code, those're
> equivalent to the halting problem).
>
> On the other hand, the above use of the hash does *not* require equals to
> work. Hash could be changed to use only the first N elements of the seq, at
> most, for some N, and would then work for such uses as in the generic
> .toString.
>
> On the gripping hand, a) doing this would make infinite seqs *mostly* work
> in associative data structures, but with intermittent failures (when there
> were collisions), instead of failing promptly every time, and b) .toString
> for LazySeq might more productively just produce "(the seq)", if it's going
> to fail on infinite seqs anyway.
>
>
>
> On Fri, Mar 22, 2013 at 2:29 AM, Nelson Morris 
> wrote:
>
>> If I'm reading everything correctly:
>>
>> 1. Object 's .toString uses .hashCode()
>> 2. LazySeq 's .hashCode() uses seq() which realizes a seq.
>> 3. LazySeq 's .hashCode() calls .hashCode() on the realized seq
>> 3. (map ..) creates a LazySeq with a fn to create (cons val (lazy-seq
>> (map f rest)))
>> 4. (cons ... ...) creates a Cons
>> 5. Cons uses Aseq's .hashcode() which traverses each object in the seq
>> and merges the hashcodes together.
>>
>> A similar thing happens with a (range) as it builds a ChunkedCons
>> which also uses Aseq's hashcode.
>>
>> On Fri, Mar 22, 2013 at 12:53 AM, Marko Topolnik
>>  wrote:
>> > I am deeply puzzled abouth the behavior of .toString invocation on a
>> lazy
>> > sequence.
>> >
>> > ==> (.getClass (map println (range 100)))
>> > clojure.lang.LazySeq
>> > ==> (.toString (map println (range 100)))
>> > ;; integers 0..100 printed
>> > "clojure.lang.LazySeq@590b4b81"
>> >
>> > It should be obvious from the output, but for the record: LazySeq
>> doesn't
>> > override toString, so just the basic Java method is called. How can this
>> > possibly cause the sequence to be realized?
>> >
>> > Beyond my curiosity, however, what possible purpose could such behavior
>> > serve?
>> >
>> > -marko
>> >
>> >
>> >
>> > On Thursday, March 21, 2013 7:54:39 PM UTC+1, Razvan Rotaru wrote:
>> >>
>> >> Hi,
>> >>
>> >> I'm curious, why doesn't toString of clojure.lang.LazySeq return the
>> >> entire sequence as a String, and returns the Java pointer instead? I
>> find it
>> >> annoying when I do this:
>> >>
>> >>
>> >> user> (str (map + [1 2 3]))
>> >> "clojure.lang.LazySeq@7861"
>> >>
>> >>
>> >> What's the reason behind this decision? Shouldn't toString trigger the
>> >> evaluation of the sequence? Doesn't it do that for other values, like
>> >> numbers and vectors?
>> >>
>> >> Is there an alternative to the code above (preferably simple and
>> elegant),
>> >> which will return the etire sequence?
>> >>
>> >>
>> >> Thanks,
>> >> Răzvan
>> >
>> > --
>> > --
>> > 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...@goog

Re: Clojure - CLR - JS - Visual Studio Extension

2013-03-21 Thread Devin Garner
I've added beta support for ClojureScript to vsClojure on the visual studio 
gallery for vs2012. Please try it out and let me know how it works.

You can see more details about the post on the ClojureCLR group at 
 http://gplus.to/clojureclr

Thanks,
Devin


On Thursday, March 21, 2013 9:42:52 PM UTC-6, Ambrose Bonnaire-Sergeant 
wrote:
>
> I'm using Mono on Ubuntu, and I have these errors/failures (including 
> project.clj at the bottom):
>
> https://gist.github.com/frenchy64/5218783
>
> This is with commit 3b387f914815e389313897977eb02a9fba89dea2
>
> Is this to do with my environment?
>
> Thanks,
> Ambrose
>
> On Fri, Mar 22, 2013 at 11:09 AM, Ambrose Bonnaire-Sergeant <
> abonnair...@gmail.com > wrote:
>
>> Hi David,
>>
>> Excellent work so far!
>>
>> I'll have a dig around and see what I find.
>>
>> Thanks,
>> Ambrose
>>
>>
>> On Fri, Mar 22, 2013 at 10:53 AM, dmiller 
>> > wrote:
>>
>>> Last update on this here:
>>>
>>>
>>> The port of core.logic to ClojureCLR that resides here:  
>>> https://github.com/**dmiller/clr.core.logic
>>>   
>>> the datomic piece is not ported.
>>>
>>> All tests run EXCEPT:
>>>
>>> test-binding-map-*
>>> test-binding-map-as-1
>>> test-binding-map-constraints-1
>>> test-unifier-constraints-*
>>> test-flatteno
>>> test-unifier-anon-constraints-3
>>> test-36-unifier-behavior
>>>
>>> These tests mostly involve clojure.core.logic.unifier/unify and 
>>> .../unifier.
>>> It is rather daunting to just jump into core.logic and debug this kind 
>>> of thing, so it might take a while for me to solve this.
>>> I invite anyone interested in ClojureCLR + core.logic to take a look.
>>>
>>> -David
>>>
>>> -- 
>>> -- 
>>> 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.
>>>  
>>>  
>>>
>>
>>
>

-- 
-- 
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: question about clojure.lang.LazySeq.toString()

2013-03-21 Thread Cedric Greevey
Hrm. Sounds like getting the hash of an infinite sequence will hang or
cause OOME.

On the one hand, *most* uses of the hash are followed by .equals if the
hashes match, and .equals on an infinite seq can't work, since if it gives
up and says "equal" after some large number N of elements, the seqs might
still differ at position N + 1, and there's no *general* way to determine
in an analytic manner whether two seqs will produce identical output, or
even whether they're infinite (even given the generating code, those're
equivalent to the halting problem).

On the other hand, the above use of the hash does *not* require equals to
work. Hash could be changed to use only the first N elements of the seq, at
most, for some N, and would then work for such uses as in the generic
.toString.

On the gripping hand, a) doing this would make infinite seqs *mostly* work
in associative data structures, but with intermittent failures (when there
were collisions), instead of failing promptly every time, and b) .toString
for LazySeq might more productively just produce "(the seq)", if it's going
to fail on infinite seqs anyway.



On Fri, Mar 22, 2013 at 2:29 AM, Nelson Morris wrote:

> If I'm reading everything correctly:
>
> 1. Object 's .toString uses .hashCode()
> 2. LazySeq 's .hashCode() uses seq() which realizes a seq.
> 3. LazySeq 's .hashCode() calls .hashCode() on the realized seq
> 3. (map ..) creates a LazySeq with a fn to create (cons val (lazy-seq
> (map f rest)))
> 4. (cons ... ...) creates a Cons
> 5. Cons uses Aseq's .hashcode() which traverses each object in the seq
> and merges the hashcodes together.
>
> A similar thing happens with a (range) as it builds a ChunkedCons
> which also uses Aseq's hashcode.
>
> On Fri, Mar 22, 2013 at 12:53 AM, Marko Topolnik
>  wrote:
> > I am deeply puzzled abouth the behavior of .toString invocation on a lazy
> > sequence.
> >
> > ==> (.getClass (map println (range 100)))
> > clojure.lang.LazySeq
> > ==> (.toString (map println (range 100)))
> > ;; integers 0..100 printed
> > "clojure.lang.LazySeq@590b4b81"
> >
> > It should be obvious from the output, but for the record: LazySeq doesn't
> > override toString, so just the basic Java method is called. How can this
> > possibly cause the sequence to be realized?
> >
> > Beyond my curiosity, however, what possible purpose could such behavior
> > serve?
> >
> > -marko
> >
> >
> >
> > On Thursday, March 21, 2013 7:54:39 PM UTC+1, Razvan Rotaru wrote:
> >>
> >> Hi,
> >>
> >> I'm curious, why doesn't toString of clojure.lang.LazySeq return the
> >> entire sequence as a String, and returns the Java pointer instead? I
> find it
> >> annoying when I do this:
> >>
> >>
> >> user> (str (map + [1 2 3]))
> >> "clojure.lang.LazySeq@7861"
> >>
> >>
> >> What's the reason behind this decision? Shouldn't toString trigger the
> >> evaluation of the sequence? Doesn't it do that for other values, like
> >> numbers and vectors?
> >>
> >> Is there an alternative to the code above (preferably simple and
> elegant),
> >> which will return the etire sequence?
> >>
> >>
> >> Thanks,
> >> Răzvan
> >
> > --
> > --
> > 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.
>
>
>

-- 
-- 
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
ht

Re: question about clojure.lang.LazySeq.toString()

2013-03-21 Thread Nelson Morris
Found a post on clojure-dev about this
https://groups.google.com/forum/?fromgroups=#!topic/clojure-dev/F68GRPrbfWo

On Fri, Mar 22, 2013 at 1:29 AM, Nelson Morris  wrote:
> If I'm reading everything correctly:
>
> 1. Object 's .toString uses .hashCode()
> 2. LazySeq 's .hashCode() uses seq() which realizes a seq.
> 3. LazySeq 's .hashCode() calls .hashCode() on the realized seq
> 3. (map ..) creates a LazySeq with a fn to create (cons val (lazy-seq
> (map f rest)))
> 4. (cons ... ...) creates a Cons
> 5. Cons uses Aseq's .hashcode() which traverses each object in the seq
> and merges the hashcodes together.
>
> A similar thing happens with a (range) as it builds a ChunkedCons
> which also uses Aseq's hashcode.
>
> On Fri, Mar 22, 2013 at 12:53 AM, Marko Topolnik
>  wrote:
>> I am deeply puzzled abouth the behavior of .toString invocation on a lazy
>> sequence.
>>
>> ==> (.getClass (map println (range 100)))
>> clojure.lang.LazySeq
>> ==> (.toString (map println (range 100)))
>> ;; integers 0..100 printed
>> "clojure.lang.LazySeq@590b4b81"
>>
>> It should be obvious from the output, but for the record: LazySeq doesn't
>> override toString, so just the basic Java method is called. How can this
>> possibly cause the sequence to be realized?
>>
>> Beyond my curiosity, however, what possible purpose could such behavior
>> serve?
>>
>> -marko
>>
>>
>>
>> On Thursday, March 21, 2013 7:54:39 PM UTC+1, Razvan Rotaru wrote:
>>>
>>> Hi,
>>>
>>> I'm curious, why doesn't toString of clojure.lang.LazySeq return the
>>> entire sequence as a String, and returns the Java pointer instead? I find it
>>> annoying when I do this:
>>>
>>>
>>> user> (str (map + [1 2 3]))
>>> "clojure.lang.LazySeq@7861"
>>>
>>>
>>> What's the reason behind this decision? Shouldn't toString trigger the
>>> evaluation of the sequence? Doesn't it do that for other values, like
>>> numbers and vectors?
>>>
>>> Is there an alternative to the code above (preferably simple and elegant),
>>> which will return the etire sequence?
>>>
>>>
>>> Thanks,
>>> Răzvan
>>
>> --
>> --
>> 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: question about clojure.lang.LazySeq.toString()

2013-03-21 Thread Nelson Morris
If I'm reading everything correctly:

1. Object 's .toString uses .hashCode()
2. LazySeq 's .hashCode() uses seq() which realizes a seq.
3. LazySeq 's .hashCode() calls .hashCode() on the realized seq
3. (map ..) creates a LazySeq with a fn to create (cons val (lazy-seq
(map f rest)))
4. (cons ... ...) creates a Cons
5. Cons uses Aseq's .hashcode() which traverses each object in the seq
and merges the hashcodes together.

A similar thing happens with a (range) as it builds a ChunkedCons
which also uses Aseq's hashcode.

On Fri, Mar 22, 2013 at 12:53 AM, Marko Topolnik
 wrote:
> I am deeply puzzled abouth the behavior of .toString invocation on a lazy
> sequence.
>
> ==> (.getClass (map println (range 100)))
> clojure.lang.LazySeq
> ==> (.toString (map println (range 100)))
> ;; integers 0..100 printed
> "clojure.lang.LazySeq@590b4b81"
>
> It should be obvious from the output, but for the record: LazySeq doesn't
> override toString, so just the basic Java method is called. How can this
> possibly cause the sequence to be realized?
>
> Beyond my curiosity, however, what possible purpose could such behavior
> serve?
>
> -marko
>
>
>
> On Thursday, March 21, 2013 7:54:39 PM UTC+1, Razvan Rotaru wrote:
>>
>> Hi,
>>
>> I'm curious, why doesn't toString of clojure.lang.LazySeq return the
>> entire sequence as a String, and returns the Java pointer instead? I find it
>> annoying when I do this:
>>
>>
>> user> (str (map + [1 2 3]))
>> "clojure.lang.LazySeq@7861"
>>
>>
>> What's the reason behind this decision? Shouldn't toString trigger the
>> evaluation of the sequence? Doesn't it do that for other values, like
>> numbers and vectors?
>>
>> Is there an alternative to the code above (preferably simple and elegant),
>> which will return the etire sequence?
>>
>>
>> Thanks,
>> Răzvan
>
> --
> --
> 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: question about clojure.lang.LazySeq.toString()

2013-03-21 Thread Marko Topolnik
I am deeply puzzled abouth the behavior of *.toString* invocation on a lazy 
sequence.

==> (.getClass (map println (range 100)))
clojure.lang.LazySeq
==> (.toString (map println (range 100)))
*;;* *integers 0..100 printed*
"clojure.lang.LazySeq@590b4b81"

It should be obvious from the output, but for the record: *LazySeq* doesn't 
override *toString*, so just the basic Java method is called. How can this 
possibly cause the sequence to be realized?

Beyond my curiosity, however, what possible purpose could such behavior 
serve?

-marko



On Thursday, March 21, 2013 7:54:39 PM UTC+1, Razvan Rotaru wrote:
>
> Hi,
>
> I'm curious, why doesn't toString of clojure.lang.LazySeq return the 
> entire sequence as a String, and returns the Java pointer instead? I find 
> it annoying when I do this:
>
>
> user> (str (map + [1 2 3]))
> "clojure.lang.LazySeq@7861"
>
>
> What's the reason behind this decision? Shouldn't toString trigger the 
> evaluation of the sequence? Doesn't it do that for other values, like 
> numbers and vectors?
>
> Is there an alternative to the code above (preferably simple and elegant), 
> which will return the etire sequence?
>
>
> Thanks,
> Răzvan
>

-- 
-- 
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 - CLR - JS - Visual Studio Extension

2013-03-21 Thread Ambrose Bonnaire-Sergeant
I'm using Mono on Ubuntu, and I have these errors/failures (including
project.clj at the bottom):

https://gist.github.com/frenchy64/5218783

This is with commit 3b387f914815e389313897977eb02a9fba89dea2

Is this to do with my environment?

Thanks,
Ambrose

On Fri, Mar 22, 2013 at 11:09 AM, Ambrose Bonnaire-Sergeant <
abonnaireserge...@gmail.com> wrote:

> Hi David,
>
> Excellent work so far!
>
> I'll have a dig around and see what I find.
>
> Thanks,
> Ambrose
>
>
> On Fri, Mar 22, 2013 at 10:53 AM, dmiller  wrote:
>
>> Last update on this here:
>>
>>
>> The port of core.logic to ClojureCLR that resides here:
>> https://github.com/**dmiller/clr.core.logic
>>
>> the datomic piece is not ported.
>>
>> All tests run EXCEPT:
>>
>> test-binding-map-*
>> test-binding-map-as-1
>> test-binding-map-constraints-1
>> test-unifier-constraints-*
>> test-flatteno
>> test-unifier-anon-constraints-3
>> test-36-unifier-behavior
>>
>> These tests mostly involve clojure.core.logic.unifier/unify and
>> .../unifier.
>> It is rather daunting to just jump into core.logic and debug this kind of
>> thing, so it might take a while for me to solve this.
>> I invite anyone interested in ClojureCLR + core.logic to take a look.
>>
>> -David
>>
>> --
>> --
>> 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: Clojure - CLR - JS - Visual Studio Extension

2013-03-21 Thread Ambrose Bonnaire-Sergeant
Hi David,

Excellent work so far!

I'll have a dig around and see what I find.

Thanks,
Ambrose

On Fri, Mar 22, 2013 at 10:53 AM, dmiller  wrote:

> Last update on this here:
>
>
> The port of core.logic to ClojureCLR that resides here:
> https://github.com/**dmiller/clr.core.logic
>
> the datomic piece is not ported.
>
> All tests run EXCEPT:
>
> test-binding-map-*
> test-binding-map-as-1
> test-binding-map-constraints-1
> test-unifier-constraints-*
> test-flatteno
> test-unifier-anon-constraints-3
> test-36-unifier-behavior
>
> These tests mostly involve clojure.core.logic.unifier/unify and
> .../unifier.
> It is rather daunting to just jump into core.logic and debug this kind of
> thing, so it might take a while for me to solve this.
> I invite anyone interested in ClojureCLR + core.logic to take a look.
>
> -David
>
> --
> --
> 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: Clojure - CLR - JS - Visual Studio Extension

2013-03-21 Thread dmiller
Last update on this here:


The port of core.logic to ClojureCLR that resides here:  
https://github.com/dmiller/clr.core.logic  
the datomic piece is not ported.

All tests run EXCEPT:

test-binding-map-*
test-binding-map-as-1
test-binding-map-constraints-1
test-unifier-constraints-*
test-flatteno
test-unifier-anon-constraints-3
test-36-unifier-behavior

These tests mostly involve clojure.core.logic.unifier/unify and .../unifier.
It is rather daunting to just jump into core.logic and debug this kind of 
thing, so it might take a while for me to solve this.
I invite anyone interested in ClojureCLR + core.logic to take a look.

-David

-- 
-- 
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: Native library not found after upgrade to leiningen 2.0

2013-03-21 Thread xumingmingv
Have a look at this: 
http://nakkaya.com/2010/04/05/managing-native-dependencies-with-leiningen/

在 2013-3-22,上午6:55,Dave Snowdon  写道:

> I just upgraded from leiningen version 1.5.2 to 2.0.0 and noticed that the 
> native library path no longer seems to be set correctly.
> 
> Here is my project file:
> 
> (defproject naojure "0.1.0-SNAPSHOT"
>   :description "Clojure wrapper for Aldebaran Robotics java NAOQI binding. 
> Depends on the Aldebaran jar file being installed in a local repo and the 
> shared library being in the dynamic library load path"
>   :url "https://github.com/davesnowdon/naojure";
>   :repositories {"local" ~(str (.toURI (java.io.File. "maven_repository")))}
>   :native-path "native"
>   :dependencies [[org.clojure/clojure "1.4.0"] [com.aldebaran/jnaoqi 
> "1.14.0"]])
> 
> The native library is in a folder "native" at the top-level of the project 
> and the corresponding jar in a local repo also contained within the leiningen 
> project.
> 
> If I run lein1 repl (I renamed the old leiningen script before upgrading) 
> then I can create instances of native classes from the repl, If I run lein 
> repl (leiningen 2.0.0) then I get the following error:
> 
> CompilerException java.lang.UnsatisfiedLinkError: no jnaoqi in 
> java.library.path, compiling:(NO_SOURCE_PATH:1) 
> 
> Here are the exact values reported by lein version (running on Linux - Fedora 
> Core 14)
> Leiningen 1.5.2 on Java 1.6.0_20 OpenJDK 64-Bit Server VM
> &
> Leiningen 2.0.0 on Java 1.6.0_20 OpenJDK 64-Bit Server VM
> 
> I've looked online for issues related to leiningen and native path handling 
> but the bugs I found all related to leiningen 1 and have been supposedly 
> fixed.
> 
> Can anyone suggest why the native library is not being located?
> 
> thanks
> 
> 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: ClassNotFoundException when using fetch RPC from cljs

2013-03-21 Thread Steve Buikhuizen
Thanks for the support gents. Ever since Noir was deprecated I've been 
planning to switch to compojure and shoreleave.

However I'm still in prototype mode and "it ain't broke" so I'm delaying 
that work until I need the next level of stability.

Nice to know I'm on the right track though.

-- 
-- 
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.




Google Summer of Code 2013: It's started!

2013-03-21 Thread Daniel Solano Gómez
Hello, all,

The window for mentoring organizations to apply to this year's summer of 
code began on Monday and wraps up at 19:00 UTC on March 29th.  The most 
important things we need to do ensure the success of our application 
include:


   1. Posting ideas on the Project 
Ideas. 
*This is the most important part of our application.*
   2. Help fill out the answers to our 
application
   .

We had a great Google Summer of Code unsession at Clojure/West, and we had 
a lot of good ideas to put up on the page.

Thank you all very much for your help.

Sincerely,

Daniel

-- 
-- 
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: question about clojure.lang.LazySeq.toString()

2013-03-21 Thread Mark Engelberg
On Thu, Mar 21, 2013 at 11:54 AM, Razvan Rotaru wrote:

> Is there an alternative to the code above (preferably simple and elegant),
> which will return the etire sequence?
>

(pr-str (map + [1 2 3]))
or
(print-str (map + [1 2 3]))

There are subtle differences between pr-str and print-str, (which I can
never remember) but either one works for this scenario.  They build a
string for how it prints (using either pr or print respectively).

-- 
-- 
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.




Native library not found after upgrade to leiningen 2.0

2013-03-21 Thread Dave Snowdon
I just upgraded from leiningen version 1.5.2 to 2.0.0 and noticed that the
native library path no longer seems to be set correctly.

Here is my project file:

(defproject naojure "0.1.0-SNAPSHOT"
  :description "Clojure wrapper for Aldebaran Robotics java NAOQI binding.
Depends on the Aldebaran jar file being installed in a local repo and the
shared library being in the dynamic library load path"
  :url "https://github.com/davesnowdon/naojure";
  :repositories {"local" ~(str (.toURI (java.io.File. "maven_repository")))}
  :native-path "native"
  :dependencies [[org.clojure/clojure "1.4.0"] [com.aldebaran/jnaoqi
"1.14.0"]])

The native library is in a folder "native" at the top-level of the project
and the corresponding jar in a local repo also contained within the
leiningen project.

If I run lein1 repl (I renamed the old leiningen script before upgrading)
then I can create instances of native classes from the repl, If I run lein
repl (leiningen 2.0.0) then I get the following error:

CompilerException java.lang.UnsatisfiedLinkError: no jnaoqi in
java.library.path, compiling:(NO_SOURCE_PATH:1)

Here are the exact values reported by lein version (running on Linux -
Fedora Core 14)
Leiningen 1.5.2 on Java 1.6.0_20 OpenJDK 64-Bit Server VM
&
Leiningen 2.0.0 on Java 1.6.0_20 OpenJDK 64-Bit Server VM

I've looked online for issues related to leiningen and native path handling
but the bugs I found all related to leiningen 1 and have been supposedly
fixed.

Can anyone suggest why the native library is not being located?

thanks

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.




[ANN] Leiningen 2.1.1 released

2013-03-21 Thread Phil Hagelberg

Hello folks.

I've just pushed out version 2.1.1 of Leiningen, which contains a
handful of bug fixes from 2.1.0.

* Add `:test-paths` to directories shared by checkout deps. (Phil Hagelberg)
* Allow `run` task to function outside projects. (Phil Hagelberg)
* Fix a bug preventing `with-profiles` working outside projects. (Colin Jones)
* Fix a bug in trampolined `repl`. (Colin Jones)
* Fix a bug in `update-in` task causing stack overflow. (David Powell)
* Fix a bug in `lein upgrade`. (Phil Hagelberg)

This should address a few issues people came across in 2.1.0, but
there's nothing terribly exciting.

That is all.

-Phil

-- 
-- 
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.




core.logic -- logic programming pickle

2013-03-21 Thread JvJ
It's a bit difficult what I'm trying to do, but I'll try my best to explain 
it.  I'd like to take an arbitrary predicate, and find which facts could be 
entered in the database that could make it true.

I'm working on a computer game dialogue framework that allows communication 
between agents (i.e. NPCs) to take the form of logical expressions.  I'd 
like different agents to have 

Suppose there are a number of relations that could be said to be true of a 
person.

(defrel mother x y) ;; x is mother of y

(defrel isPretty x)
(defrel isFat x)
(defrel isUgly x)

(defrel bad f)
(defrel good f)


And we have some facts defined:
(facts mother '[[Anna Jimmy]]) ;; Anna is Jimmy's mom

(facts bad [[isFat] [isUgly]]) ;; isFat and isUgly are considered bad
(facts good [[isPretty]]) ;; isPretty is considered good


And there's a rule that says if the following is true, then Jimmy is unhapy:

(fresh [m p]
(mother m 'Jimmy)
(isBad p)
(project [p] (p m)))


Now, there's another agent Dick who is a meanie.  He wants Jimmy to be 
unhappy.

I'm wondering if there's a way I could analyze the above relation to 
determine that by
entering the fact (isUgly 'Anna) or (isFat 'Anna), it would be true.

I hope that's not too confusing.  Does anyone have any ideas about this?

Thanks.


-- 
-- 
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/West 2013 videos?

2013-03-21 Thread John Gabriele
On Thursday, March 21, 2013 12:29:04 PM UTC-4, Ben Mabey wrote:
>
> On 3/21/13 10:08 AM, John Gabriele wrote: 
> > Are there any videos available of the talks recently given at 
> Clojure/West? 
> > 
> > Is there a central location where these will most likely be found at 
> some point? 
> > 
> Alex can confirm this but my guess is that they will be released on 
> infoq slowly over time.  This is how Strangeloop and the first 
> ClojureWest conference was done.
>

Thanks, Ben. Will look for them at .

-- 
-- 
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: question about clojure.lang.LazySeq.toString()

2013-03-21 Thread Brian Marick

On Mar 21, 2013, at 2:30 PM, Brian Marick  wrote:

> If you don't mind brackets

Or, if you do mind brackets:

user=> (str (apply list (map inc [1 2 3])))
"(2 3 4)"

I'll stop now.


Looking for employment as a Clojure programmer
Latest book: /Functional Programming for the Object-Oriented Programmer/
https://leanpub.com/fp-oo

-- 
-- 
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: question about clojure.lang.LazySeq.toString()

2013-03-21 Thread Brian Marick

On Mar 21, 2013, at 2:20 PM, Brian Marick  wrote:
> I don't know if it's elegant, but:
> 
> user=> (str (list* (map + [1 2 3])))
> "(1 2 3)"


I wrote too soon. `list*` returns a lazy sequence, not a list, so I guess you 
shouldn't rely on it. If you don't mind brackets even though lazy sequences 
usually print as lists, you could do:

user=> (str (vec (map inc [1 2 3])))
"[2 3 4]"


Looking for employment as a Clojure programmer
Latest book: /Functional Programming for the Object-Oriented Programmer/
https://leanpub.com/fp-oo

-- 
-- 
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: question about clojure.lang.LazySeq.toString()

2013-03-21 Thread Brian Marick

On Mar 21, 2013, at 1:54 PM, Razvan Rotaru  wrote:

> I'm curious, why doesn't toString of clojure.lang.LazySeq return the entire 
> sequence as a String, and returns the Java pointer instead?

I don't know, but perhaps it's to avoid problems with infinite sequences? 
(Although it's interesting that `(range)` produces a lazy sequence and `(str 
(range))` runs out of heap.)

> Is there an alternative to the code above (preferably simple and elegant), 
> which will return the etire sequence?

I don't know if it's elegant, but:

user=> (str (list* (map + [1 2 3])))
"(1 2 3)"


Looking for employment as a Clojure programmer
Latest book: /Functional Programming for the Object-Oriented Programmer/
https://leanpub.com/fp-oo

-- 
-- 
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: Illegal Argument podcast on Typed Clojure

2013-03-21 Thread Mark Derricutt
No worries - we enjoyed recording this one. I think it's up there with 
our episode with James Ladd on Redline Smalltalk [1] for deep technical 
content and a great conversation.


[1] http://illegalargument.com/illegal-argument-78-smalltalking-on-the-jvm

Jim foo.bar wrote:

thanks guys! I enjoyed this.. :)


--
--
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: ClassNotFoundException when using fetch RPC from cljs

2013-03-21 Thread Max Penet
+1 

fetch also has some bugs that will bite you sooner or later, it's not 
maintained anymore (and I don't think anyone took over).

On Thursday, March 21, 2013 4:34:44 PM UTC+1, Paul deGrandis wrote:
>
> If you're up for the challenge, I'd encourage you to migrate from Noir to 
> Compojure+Ring and from Fetch to Shoreleave remotes.
>
> I have much appreciation for Chris and his works,
> but the recent additions of the EDN reader are in the latter stack 
> combination.  You also get benefits like CSRF and XSS protections in you 
> CLJ/CLJS app.
>
> For an example application to see how you might cut things over:
> https://github.com/shoreleave/shoreleave-baseline/tree/kitchen-sink
>
> All links to marg docs can be found here:
> https://github.com/ohpauleez/shoreleave#wheres-the-code
>
> Cheers,
> Paul
>
>

-- 
-- 
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.




question about clojure.lang.LazySeq.toString()

2013-03-21 Thread Razvan Rotaru
Hi,

I'm curious, why doesn't toString of clojure.lang.LazySeq return the entire 
sequence as a String, and returns the Java pointer instead? I find it 
annoying when I do this:


user> (str (map + [1 2 3]))
"clojure.lang.LazySeq@7861"


What's the reason behind this decision? Shouldn't toString trigger the 
evaluation of the sequence? Doesn't it do that for other values, like 
numbers and vectors?

Is there an alternative to the code above (preferably simple and elegant), 
which will return the etire sequence?


Thanks,
Răzvan

-- 
-- 
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: Get difference between two lists with java objects of same class

2013-03-21 Thread Marko Topolnik
On Thursday, March 21, 2013 5:21:53 PM UTC+1, Ryan wrote:

> Thanks Marko. I do have couple more q's for you just to ensure I got 
> everything right:
>
> (comp keyset-b key-fn)
>> This results in a function that first applies *key-fn*, then *keyset-b*. 
>> So it's like #(keyset-b (key-fn %)). Let's call this function *predicate*
>> .
>
>
> 1. What exactly happens when an item is passed to #(keyset-b (key-fn %)) ? 
> Does 
> keyset-b looks up itself (because collections are functions) for the item 
> which contains *:id X *and returns true/false?
>

It returns the argument if it contains it, and otherwise 
nil.
 

> 2. Isn't it more idiomatic to write #((key-fn %) keyset-b) ?
>

No, because it doesn't work :) An arbitrary object cannot be applied as a 
function.
 

> 3. Does remove loops list-a internally and applies the predicate to each 
> item? (if the answer is no my head will definitely explode)
>

*remove* is just like *filter*, only with reversed logic. Its 
implementation in fact is literally

(filter (complement pred) 
coll))
 

> On Thursday, March 21, 2013 6:09:42 PM UTC+2, Marko Topolnik wrote:
>
>> Personal preference. It causes less mental load because it more obviously 
>> spells out what you are doing.
>>
>> On Thursday, March 21, 2013 4:58:08 PM UTC+1, Ryan wrote:
>>>
>>> Thanks a lot Marko. Much better now :)
>>>
>>> I also wanted to ask you why did you mention in a previous post that you 
>>> prefer using *remove *than *filter + complement*. Is there a reason for 
>>> this or just a personal preference?
>>>
>>> Ryan
>>>
>>> On Thursday, March 21, 2013 5:37:33 PM UTC+2, Marko Topolnik wrote:

 First we build a set of all the keys in *list-b*: 

 (into #{} (map key-fn list-b))

 Let's call that set *keyset-b. *Then we use *keyset-b* as a function 
 which returns truthy (non-nil) for any key that is contained in it, and 
 compose it with our *key-fn*:

 (comp keyset-b key-fn)

 This results in a function that first applies *key-fn*, then *keyset-b*. 
 So it's like #(keyset-b (key-fn %)). Let's call this function *
 predicate*.

 Finally, we use *predicate* to *remove* any member of *list-a* for 
 which it is truthy:

 (remove predicate list-a)

 -marko

 On Thursday, March 21, 2013 4:14:46 PM UTC+1, Ryan wrote:

> Marko,
>
> Can you please do me a favor and break down the function you suggested 
> me? I understand partially how it works but I am having trouble to fully 
> get it.
>
> (remove (comp (into #{} (map key-fn list-b)) key-fn) list-a)
>>
>

-- 
-- 
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.




If there is no nil values, why do I get null pointer exception?

2013-03-21 Thread larry google groups

I am getting a null pointer exception in the line where I conj into the 
vector. I added the pprint so I could see what was going on. I am confused 
by the outcome:

(defn convert-json-to-xml [json-as-flat-maps]
  (reduce
   (fn [vector-of-strings next-movie-as-map]
 (println "next move as map: ")
 (println (pp/pprint next-movie-as-map))
 (if (seq next-movie-as-map)
   (conj vector-of-strings (xml/emit-str (xml/map->Element 
next-movie-as-map)))
   vector-of-strings))
   []
   json-as-flat-maps))

The pprint is showing me this: 

{:film_64209.9096316473 "513e67e3c07f5dd74551",
 :cast_member_64209.9096316473 "5148c50dc07f5db4233a",
 :title_64209.9096316473 "Sound design",
 :director "",
 :runtime "5",
 :movie-id "513e67e3c07f5dd74551",
 :title "Two Islands",
 :thumb
 
"https://s3.amazonaws.com/tribeca_cms_production/uploads/uploads/film/photo_1/513e67e3c07f5dd74551/small_TWO_ISLANDS_2_pubs.jpg";,
 :categories ["Documentary"],
 :youtube_url "",
 :website_url "",
 :name_64209.9096316473 "Svante Colérus",
 :description
 "Two Islands is film about two enormous waste dumps in New York City. The 
first was once the largest dump in the world. The other, a cemetery of 
unknowns, is still in use. Two Islands bluntly asks, what does the 
existence of these two huge mountains of economic and social waste and 
rejected surplus tell us about our civilization and the so-called richest 
nation in the world? What kind of legacy will future archaeologists see?"}


Any thoughts about what triggers a null pointer exception? I am using this 
XML library: 

http://clojure.github.com/data.xml/






-- 
-- 
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 - CLR - JS - Visual Studio Extension

2013-03-21 Thread dmiller
I started a port of core.logic to ClojureCLR.
Repo: https://github.com/dmiller/clr.core.logic

It is not finished yet.  All files load with two exceptions.
(1) I have not ported clojure.core.logic.datomic
(2) there is a problem in the finite domain code with extending fd to the 
integer types.  Specifically, the calls 
in 
https://github.com/dmiller/clr.core.logic/blob/master/src/clojure/core/logic/fd.clj#L231
 
ff.  to macro extend-to-fd defined 
at 
https://github.com/dmiller/clr.core.logic/blob/master/src/clojure/core/logic/fd.clj#L181
 
do not work, causing many, many tests to fail.  I suspect the fix is 
trivial, but did not have time to go bug-hunting this morning. 

-David



On Wednesday, March 20, 2013 10:43:40 AM UTC-5, dmiller wrote:
>
> core.logic should be trivial to port to ClojureCLR.
> Based on a quick scan, a few changes to JVM lib calls, mostly .write => 
> .Write, a few type hints, UUID => GUID.
> Could be done in short order.
>
> This would be an easy example to play with a common source for 
>  Clojure(JVM | CLR).
>
> -David
>
>
> On Tuesday, March 19, 2013 5:24:34 PM UTC-5, Martin Jul wrote:
>>
>>
>>> I have made experiments with compiling ClojureScript to .NET code using 
>> the Microsoft.JScript JavaScript compiler and for a Hello World application 
>> it had a few hiccups in relation to compiling the Google closure-library 
>> (the use of future reserved keywords like "require" and "namespace" for 
>> variables/functions).
>>
>> I don't think getting ClojureScript to compile on the CLR it is 
>> insurmountable, but some work is needed. 
>>
>> My end goal is to have core.logic accessible from .NET code, either by 
>> running the ClojureScript version on .NET or by porting it to Clojure CLR. 
>> If you would be wonderful if you would help.
>>
>> Cheers,
>> Martin
>>
>>

-- 
-- 
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/West 2013 videos?

2013-03-21 Thread Ben Mabey

On 3/21/13 10:08 AM, John Gabriele wrote:

Are there any videos available of the talks recently given at Clojure/West?

Is there a central location where these will most likely be found at some point?

Alex can confirm this but my guess is that they will be released on 
infoq slowly over time.  This is how Strangeloop and the first 
ClojureWest conference was done.  I wish infoq would publish all of them 
at once but I understand why they want to let them trickle out (so they 
always have "fresh" content).  They tend to release the keynotes first.


-Ben

--
--
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: Get difference between two lists with java objects of same class

2013-03-21 Thread Ryan
Thanks Marko. I do have couple more q's for you just to ensure I got 
everything right:

(comp keyset-b key-fn)
> This results in a function that first applies *key-fn*, then *keyset-b*. 
> So it's like #(keyset-b (key-fn %)). Let's call this function *predicate*.


1. What exactly happens when an item is passed to #(keyset-b (key-fn %)) ? Does 
keyset-b looks up itself (because collections are functions) for the item 
which contains *:id X *and returns true/false?
2. Isn't it more idiomatic to write #((key-fn %) keyset-b) ?
3. Does remove loops list-a internally and applies the predicate to each 
item? (if the answer is no my head will definitely explode)

Thanks again for your patience :)

Ryan

On Thursday, March 21, 2013 6:09:42 PM UTC+2, Marko Topolnik wrote:
>
> Personal preference. It causes less mental load because it more obviously 
> spells out what you are doing.
>
> On Thursday, March 21, 2013 4:58:08 PM UTC+1, Ryan wrote:
>>
>> Thanks a lot Marko. Much better now :)
>>
>> I also wanted to ask you why did you mention in a previous post that you 
>> prefer using *remove *than *filter + complement*. Is there a reason for 
>> this or just a personal preference?
>>
>> Ryan
>>
>> On Thursday, March 21, 2013 5:37:33 PM UTC+2, Marko Topolnik wrote:
>>>
>>> First we build a set of all the keys in *list-b*: 
>>>
>>> (into #{} (map key-fn list-b))
>>>
>>> Let's call that set *keyset-b. *Then we use *keyset-b* as a function 
>>> which returns truthy (non-nil) for any key that is contained in it, and 
>>> compose it with our *key-fn*:
>>>
>>> (comp keyset-b key-fn)
>>>
>>> This results in a function that first applies *key-fn*, then *keyset-b*. 
>>> So it's like #(keyset-b (key-fn %)). Let's call this function *predicate
>>> *.
>>>
>>> Finally, we use *predicate* to *remove* any member of *list-a* for 
>>> which it is truthy:
>>>
>>> (remove predicate list-a)
>>>
>>> -marko
>>>
>>> On Thursday, March 21, 2013 4:14:46 PM UTC+1, Ryan wrote:
>>>
 Marko,

 Can you please do me a favor and break down the function you suggested 
 me? I understand partially how it works but I am having trouble to fully 
 get it.

 (remove (comp (into #{} (map key-fn list-b)) key-fn) list-a)
>


-- 
-- 
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: Get difference between two lists with java objects of same class

2013-03-21 Thread Marko Topolnik
Personal preference. It causes less mental load because it more obviously 
spells out what you are doing.

On Thursday, March 21, 2013 4:58:08 PM UTC+1, Ryan wrote:
>
> Thanks a lot Marko. Much better now :)
>
> I also wanted to ask you why did you mention in a previous post that you 
> prefer using *remove *than *filter + complement*. Is there a reason for 
> this or just a personal preference?
>
> Ryan
>
> On Thursday, March 21, 2013 5:37:33 PM UTC+2, Marko Topolnik wrote:
>>
>> First we build a set of all the keys in *list-b*: 
>>
>> (into #{} (map key-fn list-b))
>>
>> Let's call that set *keyset-b. *Then we use *keyset-b* as a function 
>> which returns truthy (non-nil) for any key that is contained in it, and 
>> compose it with our *key-fn*:
>>
>> (comp keyset-b key-fn)
>>
>> This results in a function that first applies *key-fn*, then *keyset-b*. 
>> So it's like #(keyset-b (key-fn %)). Let's call this function *predicate*
>> .
>>
>> Finally, we use *predicate* to *remove* any member of *list-a* for which 
>> it is truthy:
>>
>> (remove predicate list-a)
>>
>> -marko
>>
>> On Thursday, March 21, 2013 4:14:46 PM UTC+1, Ryan wrote:
>>
>>> Marko,
>>>
>>> Can you please do me a favor and break down the function you suggested 
>>> me? I understand partially how it works but I am having trouble to fully 
>>> get it.
>>>
>>> (remove (comp (into #{} (map key-fn list-b)) key-fn) list-a)

>>>

-- 
-- 
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.




Clojure/West 2013 videos?

2013-03-21 Thread John Gabriele
Are there any videos available of the talks recently given at Clojure/West?

Is there a central location where these will most likely be found at some point?

-- 
-- 
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: Get difference between two lists with java objects of same class

2013-03-21 Thread Ryan
Thanks a lot Marko. Much better now :)

I also wanted to ask you why did you mention in a previous post that you 
prefer using *remove *than *filter + complement*. Is there a reason for 
this or just a personal preference?

Ryan

On Thursday, March 21, 2013 5:37:33 PM UTC+2, Marko Topolnik wrote:
>
> First we build a set of all the keys in *list-b*: 
>
> (into #{} (map key-fn list-b))
>
> Let's call that set *keyset-b. *Then we use *keyset-b* as a function 
> which returns truthy (non-nil) for any key that is contained in it, and 
> compose it with our *key-fn*:
>
> (comp keyset-b key-fn)
>
> This results in a function that first applies *key-fn*, then *keyset-b*. 
> So it's like #(keyset-b (key-fn %)). Let's call this function *predicate*.
>
> Finally, we use *predicate* to *remove* any member of *list-a* for which 
> it is truthy:
>
> (remove predicate list-a)
>
> -marko
>
> On Thursday, March 21, 2013 4:14:46 PM UTC+1, Ryan wrote:
>
>> Marko,
>>
>> Can you please do me a favor and break down the function you suggested 
>> me? I understand partially how it works but I am having trouble to fully 
>> get it.
>>
>> (remove (comp (into #{} (map key-fn list-b)) key-fn) list-a)
>>>
>>

-- 
-- 
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: Get difference between two lists with java objects of same class

2013-03-21 Thread Marko Topolnik
First we build a set of all the keys in *list-b*: 

(into #{} (map key-fn list-b))

Let's call that set *keyset-b. *Then we use *keyset-b* as a function which 
returns truthy (non-nil) for any key that is contained in it, and compose 
it with our *key-fn*:

(comp keyset-b key-fn)

This results in a function that first applies *key-fn*, then *keyset-b*. So 
it's like #(keyset-b (key-fn %)). Let's call this function *predicate*.

Finally, we use *predicate* to *remove* any member of *list-a* for which it 
is truthy:

(remove predicate list-a)

-marko

On Thursday, March 21, 2013 4:14:46 PM UTC+1, Ryan wrote:

> Marko,
>
> Can you please do me a favor and break down the function you suggested me? 
> I understand partially how it works but I am having trouble to fully get it.
>
> (remove (comp (into #{} (map key-fn list-b)) key-fn) list-a)
>>
>

-- 
-- 
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: ClassNotFoundException when using fetch RPC from cljs

2013-03-21 Thread Paul deGrandis
If you're up for the challenge, I'd encourage you to migrate from Noir to 
Compojure+Ring and from Fetch to Shoreleave remotes.

I have much appreciation for Chris and his works,
but the recent additions of the EDN reader are in the latter stack 
combination.  You also get benefits like CSRF and XSS protections in you 
CLJ/CLJS app.

For an example application to see how you might cut things over:
https://github.com/shoreleave/shoreleave-baseline/tree/kitchen-sink

All links to marg docs can be found here:
https://github.com/ohpauleez/shoreleave#wheres-the-code

Cheers,
Paul

-- 
-- 
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: Immutant - NPE when deploying

2013-03-21 Thread adrians
Done - issue 41 

On Thursday, March 21, 2013 11:15:46 AM UTC-4, Toby Crawley wrote:
>
> Can you file an issue at 
> https://github.com/immutant/lein-immutant/issues? No one on the Immutant 
> team uses windows on a daily basis, so the plugin doesn't get tested 
> there as often as it should. 
>

-- 
-- 
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: Immutant - NPE when deploying

2013-03-21 Thread Toby Crawley
Can you file an issue at
https://github.com/immutant/lein-immutant/issues? No one on the Immutant
team uses windows on a daily basis, so the plugin doesn't get tested
there as often as it should.

adrians writes:

> I was trying to deploy a project using plugin 0.17.1 and incremental build 
> 808 from the directory above the project. This resulted in the following 
> NPE:
>
> C:\Users\adi>lein immutant deploy foobar
> java.lang.NullPointerException
> at leiningen.immutant.common$verify_root_arg.invoke(common.clj:87)
...
> Deploying from within the project directory worked. This is under Windows 7.

-- 
Toby Crawley
http://immutant.org | http://torquebox.org

-- 
-- 
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: Get difference between two lists with java objects of same class

2013-03-21 Thread Ryan
Marko,

Can you please do me a favor and break down the function you suggested me? 
I understand partially how it works but I am having trouble to fully get it.

Thank you for your time.

On Monday, March 11, 2013 11:05:47 PM UTC+2, Marko Topolnik wrote:
>
> Another approach, preserving the order of list-a, would be
>
> (remove (comp (into #{} (map key-fn list-b)) key-fn) list-a)
>

-- 
-- 
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: ClassNotFoundException when using fetch RPC from cljs

2013-03-21 Thread Steve Buikhuizen
I found the solution and it's a bit of a noob mistake.

Because I'm using fetch, the server side of the RPC is defined in a noir 
host page.

I added a :require of the view model ns to that page so that the classes 
are loaded above read-string call in the stack. 

This made it work immediately. Doh.

-- 
-- 
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.




Immutant - NPE when deploying

2013-03-21 Thread adrians


I was trying to deploy a project using plugin 0.17.1 and incremental build 
808 from the directory above the project. This resulted in the following 
NPE:

C:\Users\adi>lein immutant deploy foobar
java.lang.NullPointerException
at leiningen.immutant.common$verify_root_arg.invoke(common.clj:87)
at leiningen.immutant.deploy$deploy.invoke(deploy.clj:54)
at clojure.lang.AFn.applyToHelper(AFn.java:167)
at clojure.lang.AFn.applyTo(AFn.java:151)
at clojure.core$apply.invoke(core.clj:617)
at 
leiningen.immutant$subtask_with_resolved_project.invoke(immutant.c
at leiningen.immutant$immutant.doInvoke(immutant.clj:55)
at clojure.lang.RestFn.invoke(RestFn.java:442)
at clojure.lang.Var.invoke(Var.java:423)
at clojure.lang.AFn.applyToHelper(AFn.java:167)
at clojure.lang.Var.applyTo(Var.java:532)
at clojure.core$apply.invoke(core.clj:619)
at leiningen.core.main$resolve_task$fn__1833.doInvoke(main.clj:186)
at clojure.lang.RestFn.applyTo(RestFn.java:139)
at clojure.lang.AFunction$1.doInvoke(AFunction.java:29)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:619)
at leiningen.core.main$apply_task.invoke(main.clj:226)
at leiningen.core.main$_main$fn__1900.invoke(main.clj:291)
at leiningen.core.main$_main.doInvoke(main.clj:280)
at clojure.lang.RestFn.invoke(RestFn.java:436)
at clojure.lang.Var.invoke(Var.java:423)
at clojure.lang.AFn.applyToHelper(AFn.java:167)
at clojure.lang.Var.applyTo(Var.java:532)
at clojure.core$apply.invoke(core.clj:617)
at clojure.main$main_opt.invoke(main.clj:335)
at clojure.main$main.doInvoke(main.clj:440)
at clojure.lang.RestFn.invoke(RestFn.java:482)
at clojure.lang.Var.invoke(Var.java:431)
at clojure.lang.AFn.applyToHelper(AFn.java:178)
at clojure.lang.Var.applyTo(Var.java:532)
at clojure.main.main(main.java:37)

Deploying from within the project directory worked. This is under Windows 7.

Cheers

-- 
-- 
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: Immutant and ClojureScript

2013-03-21 Thread David Frese
Thanks,
I tried the newest build 808 and it looks good - ClojureScript compiled 
something.


On Wednesday, March 20, 2013 5:45:45 PM UTC+1, Toby Crawley wrote:
>
>
> I've exposed findResource and findResources in ImmutantClassLoader, and 
> this change is available in incremental build 803 or newer[1]. Give that 
> a try and let us know if it doesn't work for you. 
>
> - Toby 
>
> [1]:http://immutant.org/builds/ 
>
> Tatu Tarvainen writes: 
>
> > So, is that a bug in ClojureScript? 
> >> Does anybody have an idea for a workaround (I have little experience 
> with 
> >> all of this, including classloaders)? 
> >> 
> >> 
> >> Stacktrace: 
> >> 23:06:01,247 ERROR [stderr] (http-/127.0.0.1:8080-1) Exception: 
> >> java.lang.IllegalArgumentException: No matching method found: 
> findResources 
> >> for class org.immutant.core.ImmutantClassLoader 
> >> 23:06:01,247 ERROR [stderr] (http-/127.0.0.1:8080-1)   
> 
> >>Reflector.java:53 clojure.lang.Reflector.invokeMatchingMethod 
> >> 23:06:01,247 ERROR [stderr] (http-/127.0.0.1:8080-1)   
> 
> >>Reflector.java:28 clojure.lang.Reflector.invokeInstanceMethod 
> >> 23:06:01,247 ERROR [stderr] (http-/127.0.0.1:8080-1)   
> 
> >>  closure.clj:849 cljs.closure/get-upstream-deps* 
> >> 
> > 
> > I ran into this same error in another environment with a custom 
> classloader. 
> > It seems to be related to Clojure's default classloader extending from 
> > URLClassLoader which has a public findResources method. 
> > The custom classloader in my case was extending the default Java 
> > ClassLoader (where the findResources method is protected). 
> > 
> > Changing the findResources in ImmutantClassLoader to public should fix 
> it. 
> > 
> > -- 
>
>
> -- 
> Toby Crawley 
> http://immutant.org | http://torquebox.org 
>

-- 
-- 
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: Illegal Argument podcast on Typed Clojure

2013-03-21 Thread Jim foo.bar

thanks guys! I enjoyed this.. :)

Jim


On 21/03/13 08:32, Mark Derricutt wrote:

Hey all,

We couldn't let everyone at Clojure/West have all the fun so our 
latest podcast is an awesome chat with Ambrose Bonnaire Sergeant all 
about Typed Clojure.


http://illegalargument.com/illegal-argument-episode-98-typed-clojure

Enjoy.

--
--
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: Illegal Argument podcast on Typed Clojure

2013-03-21 Thread Mark Derricutt

Hey all,

We couldn't let everyone at Clojure/West have all the fun so our latest 
podcast is an awesome chat with Ambrose Bonnaire Sergeant all about 
Typed Clojure.


  http://illegalargument.com/illegal-argument-episode-98-typed-clojure

Enjoy.

--
--
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: Exception propagation design in Clojure web APIs.

2013-03-21 Thread Marko Topolnik
On Wednesday, March 20, 2013 11:29:55 PM UTC+1, James Reeves wrote:

> On 20 March 2013 16:41, Marko Topolnik 
> > wrote:
>
>> On Wednesday, March 20, 2013 4:34:32 PM UTC+1, James Reeves wrote:
>>
>>>
>>> If validation happens "all around", that implies there is no one 
>>> function that can test whether a value of data is valid for a given data 
>>> store. This strikes me as a somewhat shaky foundation for a system.
>>>
>>
>> The idea is that all validation functions share the same contract to call 
>> the appropriate *add-failure* function that registers the validation 
>> result.
>>
>
> I don't see why that would be necessary. Why not put all the validation 
> logic in one place?
>

Indeed, why not. If the requirements allow it, it is definitely preferred.
 

>  
>
>>  There may be instances where it makes sense to use exceptions as a 
>>> control flow mechanism, but I wonder whether it wouldn't be better to use 
>>> something like CPS in those instances.
>>>
>>
>> I can't picture how such a mechanism would work, and what benefit it 
>> would bring over the exceptions mechanism. CPS in Clojure means 
>> trampolining, which is quite an unwieldy, and I'd say "cheap" tack-on. A 
>> validating function would then be supposed to return a common, 
>> globally-defined "continuation", in fact just a simple function, that would 
>> redirect the flow towards the validation failure-handling case.
>>
>
> I wasn't thinking of validation when I suggested CPS, because I don't see 
> a need for any unusual control flow when validating data.
>

That's enterely use case-dependent. In some project validation was 
specified as fail-fast, and it happened in the middle of business logic 
because the validation status couldn't be determined without computing some 
interim results. Throwing an exception from a function three-four levels 
down was the perfect choice in that case.

-marko 

-- 
-- 
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.