Re: memorize-clj

2013-04-29 Thread Chris Ford
Jorge, reinventing the wheel is a very worthwhile pursuit. Maybe you'll
come up with something new, and certainly you'll learn something.

Thanks for sharing.

Chris


On 29 April 2013 08:23, Baishampayan Ghose  wrote:

> One more reason to read Clojure's source code. Trust me, it's surprisingly
> easy to understand.
>
> Sent from phone. Please excuse brevity.
> On 29 Apr 2013 09:29, "Jorge Urdaneta"  wrote:
>
>>  Thank you. Shame on me
>>
>> On 28/04/13 23:28, Gary Trakhman wrote:
>>
>> Clojure has the http://clojuredocs.org/clojure_core/clojure.core/memoize 
>> function
>> built-in, as well as https://github.com/clojure/core.memoize for more
>> complicated stuff.
>>
>>
>> On Sun, Apr 28, 2013 at 11:51 PM, Jorge Urdaneta <
>> jorge.urdan...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I started a library called memorize-clj
>>> https://github.com/jorgeu/memorize-clj
>>> It provides a function "memorize" that take a function and cache its
>>> results using
>>> guava cache. Of course the function must be pure and the parameters
>>> should be
>>> easy to compare and get a hashcode.
>>>
>>> Maybe I'm reinventing the wheel here but it was fun to build anyway.
>>> I saw this feature in Groovy and couldn't found anything equivalent for
>>> Clojure.
>>>
>>> --
>>> Jorge Urdaneta
>>>
>>> --
>>> --
>>> 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.
>>
>>
>>
>>
>>
>> --
>> Jorge Urdaneta
>>
>>  --
>> --
>> 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
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,

Connascence (from: Explain, don't document.)

2013-04-29 Thread Rich Morin
A clean, if short (32 minute) version of Jim Weirich's talk on connascence
is again online at Confreaks (Thanks,  Coby!).  See:

  The Building Blocks of Modularity, aka
  The Grand Unified Theory of Software Development
  http://confreaks.com/videos/77-mwrc2009-the-building-blocks-of-modularity

Just as some of Glenford Myers' work in "Composite/Structured Design" fails
to match some aspects of OO development, some of Meilir Page-Jones work in
"What every programmer should know about Object-Oriented Design" fails to
match some aspects of Clojure, FP, etc.

For example, Clojure's handling of identity and value certainly speaks to
the question of "Connascence of Identity".  I'm not sure how much effect
immutability has on connascence.  Certainly, "using the data as the API"
(as Stuart Sierra recommends) differs markedly from OO best practices.

However, the basic notion of identifying forms of coupling and thinking
about their dangers (and benefits) is still very relevant.  If you want
a good introduction to the topic, this is a good video to watch.

-r

 -- 
http://www.cfcl.com/rdmRich Morin
http://www.cfcl.com/rdm/resume r...@cfcl.com
http://www.cfcl.com/rdm/weblog +1 650-873-7841

Software system design, development, and documentation


-- 
-- 
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: Now *there*'s a machine made for Clojure.

2013-04-29 Thread Marko Topolnik
The benefit of Clojure are its built-in data and programming models, which 
are well-suited for the concise expression of concurrent computations. 
Since fighting the incidental complexity is, along many others, a very 
important concern in building concurrent apps, Clojure has an edge there 
over plain Java---but that's where its advantages stop. All the down-below 
issues of concurrent performance (and there are many) are shared with Java.

-marko

On Sunday, April 28, 2013 4:51:04 AM UTC+2, Cedric Greevey wrote:
>
> https://en.wikipedia.org/wiki/Intel_MIC
>
> 50+ cores?! Clojure will leave every other language in the dust on 
> something like that, thanks to its inherently scaleable concurrency 
> constructs. Try writing a 50-threaded Java application without getting 
> deadlocks all over the place, or cheating and using very coarse-grained 
> locks (have fun with the task manager showing 2% CPU utilization when your 
> app is running full-bore!).
>
> If big, 32-bit addressing spaces were what made automatic memory 
> management really begin to come into its own (and with it, Java), then it's 
> doubtless 50-core machines that will make automatic concurrency management 
> really begin to come into its own.
>
>

-- 
-- 
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: Now *there*'s a machine made for Clojure.

2013-04-29 Thread Baishampayan Ghose
A dated but relevant discussion between Rich Hickey and Dr. Cliff Click,
ex-CTO Azul Systems -
http://www.azulsystems.com/blog/cliff/2008-05-27-clojure-stms-vs-locks

Sent from phone. Please excuse brevity.
On 28 Apr 2013 10:04, "Timothy Baldridge"  wrote:

> E-mail thread had less to do with issues of Clojure per se, but more with
> issues the JVM had running on a 48-way machine. Or am I missing something?
>
> IIRC the Azul people played with Clojure a bit, I wonder if their suped-up
> JVM allows Clojure to perform any better.
>
> Timothy
>
>
> On Sat, Apr 27, 2013 at 9:36 PM, Lee Spector wrote:
>
>>
>> I don't want to be too much of a downer, but our experience running
>> Clojure on 48-core machines was pretty depressing, with our speedups often
>> being near zero or even negative (that is, running on 48 cores can be
>> slower than running on 1, for a task that would seem to be a good candidate
>> for parallelization, and with what would seem to be good techniques for
>> doing the parallelization). Several people tried to help us diagnose/fix
>> the problems (see this thread:
>> https://groups.google.com/forum/?fromgroups=#!topic/clojure/48W2eff3caU),
>> but I don't think that there has been a definitive resolution.
>>
>>  -Lee
>>
>>
>> On Apr 27, 2013, at 11:23 PM, Yves S. Garret wrote:
>>
>> > I'll take a blind stab at this and say that Erlang might actually do
>> > more poorly, unless the chip's interchip message passing is taken
>> > advantage of by Erlang.  If there's a separate piece of hardware
>> > taking on the role of being the messenger, having to waste computer
>> > cycles to send a message isn't terribly efficient.
>> >
>> >
>> > On Sat, Apr 27, 2013 at 11:17 PM, Cedric Greevey 
>> wrote:
>> > On Sat, Apr 27, 2013 at 11:13 PM, Yves S. Garret <
>> yoursurrogate...@gmail.com> wrote:
>> > How would this compare to Erlang?
>> >
>> >
>> > On Sat, Apr 27, 2013 at 10:51 PM, Cedric Greevey 
>> wrote:
>> > https://en.wikipedia.org/wiki/Intel_MIC
>> >
>> > 50+ cores?! Clojure will leave every other language in the dust on
>> something like that, thanks to its inherently scaleable concurrency
>> constructs. Try writing a 50-threaded Java application without getting
>> deadlocks all over the place, or cheating and using very coarse-grained
>> locks (have fun with the task manager showing 2% CPU utilization when your
>> app is running full-bore!).
>> >
>> > If big, 32-bit addressing spaces were what made automatic memory
>> management really begin to come into its own (and with it, Java), then it's
>> doubtless 50-core machines that will make automatic concurrency management
>> really begin to come into its own.
>> >
>> > Erlang might also do well on such a machine. The actor model likely
>> involves more communication among the cores to get full utilization, but
>> then, the page describes some sort of message-passing system among the
>> cores on MIC, so ...
>> >
>> >
>> > --
>> > --
>> > 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.
>> >
>> >
>>
>> --
>> Lee Spector, Professor of Computer Science
>> Cognitive Science, Hampshire College
>> 893 West Street, Amherst, MA 01002-3359
>> lspec...@hampshire.edu, http://hampshire.edu/lspector/
>> Phone: 413-559-5352, Fax: 413-559-5438
>>
>> --
>> --
>> 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
>> yo

Failed to import java.text.Normalizer.Form

2013-04-29 Thread Hoàng Minh Thắng
I want to work with `java.text.Normalizer/normalize` which require some
constansts named NFD, NFC etc. I could import java.text.Normalizer
with this:
```
(import java.text.Normalizer)
```
but couldn't figure how to import and use the constansts from
http://docs.oracle.com/javase/6/docs/api/java/text/Normalizer.Form.html#NFC
Using `(import 'java.text.Normalizer.Form)` yelled an
`ClassNotFoundException`.
Sorry if the question is stupid. I know nothing about Java.


signature.asc
Description: PGP signature


Re: Failed to import java.text.Normalizer.Form

2013-04-29 Thread Meikel Brandmeyer (kotarak)
Subclasses are accessed with $. java.text.Normalizer$Form/NFD Should do the 
trick. Or (import 'java.text.Normalizer$Form) and Normalizer$Form/NFD.

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: Now *there*'s a machine made for Clojure.

2013-04-29 Thread Phillip Lord
Cedric Greevey  writes:
> 50+ cores?! Clojure will leave every other language in the dust on
> something like that, thanks to its inherently scaleable concurrency
> constructs. Try writing a 50-threaded Java application without getting
> deadlocks all over the place, or cheating and using very coarse-grained
> locks (have fun with the task manager showing 2% CPU utilization when your
> app is running full-bore!).


Clojure is a java app. 

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.




Re: Now *there*'s a machine made for Clojure.

2013-04-29 Thread Dmitry Groshev
An Erlang fanboy here.

There is very prevalent opinion that Erlang is about multicore and 
scalability and such. The truth is that it's completely wrong. Erlang 
wasn't even multithreaded until early 2000s (if I recall correctly); all 
it's "green threads" and "message passing" and such are designed to handle 
and isolate errors (there is a even a joke that Erlang means ERror handLing 
lANGuage), not to provide multicore scalability. It just happens that the 
combination of actor model and share-nothing memory model allows to run a 
lot of "schedulers" (actual processes that execute "green threads") in 
parallel. There are *a lot* of drawbacks in this approach; for example, 
it's really hard to build something like reducers/fold in Erlang due to 
strict isolation of threads and quite expensive (when we are talking about 
number crunching at least) message passing. Moreover, Erlang VM (or BEAM as 
it's named) is comparably slower than JVM in terms of computational 
throughput (number of factorials counter, or numbers added, or strings 
concatenated per second). There are a lot of clever tricks there to 
mitigate isolation problems, and it was actually shown that current BEAM 
scales almost linearly for up to 64 cores at typical Erlang code (and it 
will scale even better in near future thanks to EU-funded RELEASE project), 
but please keep in mind that despite all this scalability it's not about 
raw performance. It's about huge companies like Ericsson running Erlang 
software due to it's superb error handling abilities and simplicity and 
almost-real-time response time distribution and legacy at massive scale and 
being able to reduce hardware costs to run it. When it comes to things like 
multiplying matrices or cleverly mutating shared state or parsing huge CSV 
files Erlang will be beaten by Clojure in no time despite "scalability".

On Sunday, April 28, 2013 6:51:04 AM UTC+4, Cedric Greevey wrote:
>
> https://en.wikipedia.org/wiki/Intel_MIC
>
> 50+ cores?! Clojure will leave every other language in the dust on 
> something like that, thanks to its inherently scaleable concurrency 
> constructs. Try writing a 50-threaded Java application without getting 
> deadlocks all over the place, or cheating and using very coarse-grained 
> locks (have fun with the task manager showing 2% CPU utilization when your 
> app is running full-bore!).
>
> If big, 32-bit addressing spaces were what made automatic memory 
> management really begin to come into its own (and with it, Java), then it's 
> doubtless 50-core machines that will make automatic concurrency management 
> really begin to come into its own.
>
>

-- 
-- 
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: Connascence (from: Explain, don't document.)

2013-04-29 Thread AtKaaZ
Thank you very much.


On Mon, Apr 29, 2013 at 10:42 AM, Rich Morin  wrote:

> A clean, if short (32 minute) version of Jim Weirich's talk on connascence
> is again online at Confreaks (Thanks,  Coby!).  See:
>
>   The Building Blocks of Modularity, aka
>   The Grand Unified Theory of Software Development
>
> http://confreaks.com/videos/77-mwrc2009-the-building-blocks-of-modularity
>
> Just as some of Glenford Myers' work in "Composite/Structured Design" fails
> to match some aspects of OO development, some of Meilir Page-Jones work in
> "What every programmer should know about Object-Oriented Design" fails to
> match some aspects of Clojure, FP, etc.
>
> For example, Clojure's handling of identity and value certainly speaks to
> the question of "Connascence of Identity".  I'm not sure how much effect
> immutability has on connascence.  Certainly, "using the data as the API"
> (as Stuart Sierra recommends) differs markedly from OO best practices.
>
> However, the basic notion of identifying forms of coupling and thinking
> about their dangers (and benefits) is still very relevant.  If you want
> a good introduction to the topic, this is a good video to watch.
>
> -r
>
>  --
> http://www.cfcl.com/rdmRich Morin
> http://www.cfcl.com/rdm/resume r...@cfcl.com
> http://www.cfcl.com/rdm/weblog +1 650-873-7841
>
> Software system design, development, and documentation
>
>
> --
> --
> 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: Now *there*'s a machine made for Clojure.

2013-04-29 Thread Michiel Overtoom

On Apr 28, 2013, at 05:36, Lee Spector wrote:

> our experience running Clojure on 48-core machines was pretty depressing, 
> with our speedups often being near zero or even negative

Did you also do a test on that hardware with Python w/ multiprocessing?

Greetings,

-- 
Test your knowledge of flowers! http://www.learn-the-flowers.com
or http://www.leer-de-bloemen.nl for the Dutch version.



-- 
-- 
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: Now *there*'s a machine made for Clojure.

2013-04-29 Thread Lee Spector

On Apr 29, 2013, at 8:15 AM, Michiel Overtoom wrote:
> On Apr 28, 2013, at 05:36, Lee Spector wrote:
> 
>> our experience running Clojure on 48-core machines was pretty depressing, 
>> with our speedups often being near zero or even negative
> 
> Did you also do a test on that hardware with Python w/ multiprocessing?

No, we didn't try Python or any other language. Our interest is in getting 
multicore speedups in Clojure or possibly in some other Lisp (although with our 
current code base it'd be best if we could do this in Clojure).

 -Lee

-- 
-- 
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 special forms

2013-04-29 Thread David Simmons
Hi

I am just setting out to learn Clojure (my 2nd attempt) and am starting to 
feel more comfortable with the language (and very excited about the 
possibilities).

However, I'm reading Clojure Programming (Emerick, Carper and Grand) and 
read that Special forms are the primitive building blocks on which the rest 
of the language is built. I therefore thought that every function defined 
in Clojure.core would be defined in terms of the specials forms in some 
way. So I looked at the source for reduce to see that it actually makes a 
call to java ". reduce". This would imply that the special forms are not 
quite what I understood.

Am I right in thinking that certain Lisps do indeed define all of their 
higher level functions in terms of a very small subset of special forms or 
have I completely misunderstood.

Kind Regards

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: Now *there*'s a machine made for Clojure.

2013-04-29 Thread Jonathan Fischer Friberg
You could always give https://github.com/halgari/clojure-py a spin, might
not be so easy to get everything working though. :)

Jonathan




On Mon, Apr 29, 2013 at 2:48 PM, Lee Spector  wrote:

>
> On Apr 29, 2013, at 8:15 AM, Michiel Overtoom wrote:
> > On Apr 28, 2013, at 05:36, Lee Spector wrote:
> >
> >> our experience running Clojure on 48-core machines was pretty
> depressing, with our speedups often being near zero or even negative
> >
> > Did you also do a test on that hardware with Python w/ multiprocessing?
>
> No, we didn't try Python or any other language. Our interest is in getting
> multicore speedups in Clojure or possibly in some other Lisp (although with
> our current code base it'd be best if we could do this in Clojure).
>
>  -Lee
>
> --
> --
> 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 special forms

2013-04-29 Thread Baishampayan Ghose
So reduce here is actually written in Java, hence the call to the
.reduce method. It's perfectly possible to write reduce in pure
Clojure today but it's probably not done that way because of
performance reasons.

For the real special forms you will have to look at the Clojure
compiler source starting from here -
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L39

Regards,
BG

On Mon, Apr 29, 2013 at 6:21 PM, David Simmons  wrote:
> Hi
>
> I am just setting out to learn Clojure (my 2nd attempt) and am starting to
> feel more comfortable with the language (and very excited about the
> possibilities).
>
> However, I'm reading Clojure Programming (Emerick, Carper and Grand) and
> read that Special forms are the primitive building blocks on which the rest
> of the language is built. I therefore thought that every function defined in
> Clojure.core would be defined in terms of the specials forms in some way. So
> I looked at the source for reduce to see that it actually makes a call to
> java ". reduce". This would imply that the special forms are not quite what
> I understood.
>
> Am I right in thinking that certain Lisps do indeed define all of their
> higher level functions in terms of a very small subset of special forms or
> have I completely misunderstood.
>
> Kind Regards
>
> 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.
>
>



-- 
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: Clojure special forms

2013-04-29 Thread Michael Klishin
2013/4/29 Baishampayan Ghose 

> For the real special forms you will have to look at the Clojure
> compiler source starting from here -
>
> https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L39
>

or http://clojure-doc.org/articles/language/macros.html#special_forms :)
-- 
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: Clojure special forms

2013-04-29 Thread Baishampayan Ghose
Absolutely! Thanks Michael.

Sent from phone. Please excuse brevity.
On 29 Apr 2013 18:36, "Michael Klishin"  wrote:

>
> 2013/4/29 Baishampayan Ghose 
>
>> For the real special forms you will have to look at the Clojure
>> compiler source starting from here -
>>
>> https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L39
>>
>
> or http://clojure-doc.org/articles/language/macros.html#special_forms :)
> --
> 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.
>
>
>

-- 
-- 
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: Now *there*'s a machine made for Clojure.

2013-04-29 Thread Lee Spector

On Apr 29, 2013, at 9:01 AM, Jonathan Fischer Friberg wrote:

> You could always give https://github.com/halgari/clojure-py a spin, might not 
> be so easy to get everything working though. :)

It might be worth it, if we could still write in Clojure and get good multicore 
utilization and good performance overall for our application.

Is there evidence that code written/run this way will perform particularly well?

Thanks,

 -Lee

-- 
-- 
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: Now *there*'s a machine made for Clojure.

2013-04-29 Thread Jim

On 29/04/13 14:09, Lee Spector wrote:

It might be worth it, if we could still write in Clojure and get good multicore 
utilization and good performance overall for our application.


You would of course write in Clojure...the question then is to what 
extend CljureJVM's concurrency constructs you need, have been 
implemented/ported to clojure-py...My guess would be not all of them have...


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: Image analysis library recommendations

2013-04-29 Thread Stathis Sideris
There is a Clojure wrapper for OpenCV: http://nakkaya.com/vision.html

On Tuesday, 23 April 2013 19:54:20 UTC+1, Nils Blum-Oeste wrote:
>
> Hi,
>
> I would like to do some image analysis with clojure. So I am looking for 
> good libraries for that.
>
> Most important would be a good support for image segmentation. 
> Tresholding, histogram based methods, edge detection and region growing are 
> among the things I would like to have. Support for real time image analysis 
> is not needed, I want to transform static image files.
> Furthermore I am looking for a nice image import/export. This does not 
> have to be the same library, but would be great if things work together 
> nicely.
>
> Of course a pure clojure thing would be awesome, but using java interop 
> would be okay too.
> I have some background in image analysis and don't need to have all the 
> matrix stuff abstracted away. However, I don't want to rebuild all the 
> necessary algorithms myself, but focus on getting the parametrization right 
> and figuring out the best segmenation strategy instead.
>
> Currently I am evaluating incanter (also interested in this is a general 
> data analysis tool) and I wanted to have a look at OpenCV.
>
> If someone could recommend good libraries would be great. I really 
> appreciate any hints, recommendations and shared experience.
>
> Thanks and cheers
> Nils
>

-- 
-- 
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: Now *there*'s a machine made for Clojure.

2013-04-29 Thread Timothy Baldridge
Switching to python wouldn't really give much of a benefit. IIRC, if you
read the thread that Lee posted, you will see that the JVM and Clojure
performs just fine with 1 JVM per CPU. This is the same programming model
as python with multiprocessing.

Timothy


On Mon, Apr 29, 2013 at 7:17 AM, Jim  wrote:

> On 29/04/13 14:09, Lee Spector wrote:
>
>> It might be worth it, if we could still write in Clojure and get good
>> multicore utilization and good performance overall for our application.
>>
>
> You would of course write in Clojure...the question then is to what extend
> CljureJVM's concurrency constructs you need, have been implemented/ported
> to clojure-py...My guess would be not all of them have...
>
> 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+unsubscribe@**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+unsubscribe@**googlegroups.com
> .
> For more options, visit 
> https://groups.google.com/**groups/opt_out
> .
>
>
>


-- 
“One of the main causes of the fall of the Roman Empire was that–lacking
zero–they had no way to indicate successful termination of their C
programs.”
(Robert Firth)

-- 
-- 
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: Failed to import java.text.Normalizer.Form

2013-04-29 Thread Hoàng Minh Thắng
On Monday, April 29, 2013 6:04:41 PM UTC+7, Meikel Brandmeyer (kotarak) 
wrote:
>
> Subclasses are accessed with $. java.text.Normalizer$Form/NFD Should do 
> the trick. Or (import 'java.text.Normalizer$Form) and Normalizer$Form/NFD.
>
> Kind regards
> Meikel
>
> Great help. Thanks a lot

-- 
-- 
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: Now *there*'s a machine made for Clojure.

2013-04-29 Thread Konrad Hinsen
--On 29 avril 2013 09:09:27 -0400 Lee Spector  
wrote:



On Apr 29, 2013, at 9:01 AM, Jonathan Fischer Friberg wrote:


You could always give https://github.com/halgari/clojure-py a spin,
might not be so easy to get everything working though. :)


It might be worth it, if we could still write in Clojure and get good
multicore utilization and good performance overall for our application.

Is there evidence that code written/run this way will perform
particularly well?


No. The Python VM has a global interpreter lock that prevents parallel 
execution of Python bytecode. If you want to parallel processing in Python 
(more precisely, the CPython implementation), you must either port 
CPU-intensive stuff to C or Cython, or run multiple communicating CPython 
instances.


Konrad.

--
--
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 special forms

2013-04-29 Thread David Simmons
Hi Both.

Thank you for your prompt replies. Maybe I'm being purist but if one of the 
special forms is the dot you have all of Java to play with so presumably 
you could produce any of the other clojure functions. I thought that the 
special forms enabled you to produce all other elements of the language 
with just the special forms. Isn't having the dot cheating a bit :-).

cheers

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.




testing for nil may not be enough

2013-04-29 Thread AtKaaZ
How do you guys handle the cases when the var is unbound? I mean
specifically in the cases where you just test if the var is nil.

=> (def a)
#'clojurewerkz.titanium.graph-test/a

=> a
#

=> (nil? a)
false

=> (bound? a)
ClassCastException clojure.lang.Var$Unbound cannot be cast to
clojure.lang.Var  clojure.core/bound?/fn--4837 (core.clj:4954)

=> (bound? #'a)
false

ok imagine the following sample :))

=> (defn decorate [input]
 (when (not (nil? input)) (str "prefix:" input ":suffix")))
#'clojurewerkz.titanium.graph-test/decorate

=> (decorate "1")
"prefix:1:suffix"

=> (decorate a)
"prefix:Unbound: #'clojurewerkz.titanium.graph-test/a:suffix"

so... fix?
 but more importantly does anyone need to add checks for is-the-var-bound
in their code where they checked for nil ?

-- 
-- 
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: Now *there*'s a machine made for Clojure.

2013-04-29 Thread Lee Spector


On Apr 29, 2013, at 11:25 AM, Konrad Hinsen wrote:
>> Is there evidence that code written/run this way will perform
>> particularly well?
> 
> No. The Python VM has a global interpreter lock that prevents parallel 
> execution of Python bytecode. If you want to parallel processing in Python 
> (more precisely, the CPython implementation), you must either port 
> CPU-intensive stuff to C or Cython, or run multiple communicating CPython 
> instances.

Ah. Well we could do that in Clojure without dealing with Python, and our tests 
show that we'd get the multicore speedups that we want. But I'm not eager to 
re-engineer everything to launch and use and deal with multiple JVM instances 
and the necessary intercommunication. I'd like to use the built-in Clojure 
concurrency support, which is elegant but isn't giving us reasonable multicore 
utilization.

Thanks,

 -Lee 

-- 
-- 
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: testing for nil may not be enough

2013-04-29 Thread Jim - FooBar();
I 've found that whenever I get a var-unbound exception it is almost 
always my fault and my fault only...why would you do (def a) anyway?


Jim


On 29/04/13 16:32, AtKaaZ wrote:
How do you guys handle the cases when the var is unbound? I mean 
specifically in the cases where you just test if the var is nil.


=> (def a)
#'clojurewerkz.titanium.graph-test/a

=> a
#

=> (nil? a)
false

=> (bound? a)
ClassCastException clojure.lang.Var$Unbound cannot be cast to 
clojure.lang.Var  clojure.core/bound?/fn--4837 (core.clj:4954)


=> (bound? #'a)
false

ok imagine the following sample :))

=> (defn decorate [input]
 (when (not (nil? input)) (str "prefix:" input ":suffix")))
#'clojurewerkz.titanium.graph-test/decorate

=> (decorate "1")
"prefix:1:suffix"

=> (decorate a)
"prefix:Unbound: #'clojurewerkz.titanium.graph-test/a:suffix"

so... fix?
 but more importantly does anyone need to add checks for 
is-the-var-bound in their code where they checked for nil ?


--
--
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: testing for nil may not be enough

2013-04-29 Thread AtKaaZ
I'm thinking something like (def ^:dynamic *a*) where it would make more
sense that it's unbound at first


On Mon, Apr 29, 2013 at 7:00 PM, Jim - FooBar(); wrote:

> I 've found that whenever I get a var-unbound exception it is almost
> always my fault and my fault only...why would you do (def a) anyway?
>
> Jim
>
>
>
> On 29/04/13 16:32, AtKaaZ wrote:
>
>> How do you guys handle the cases when the var is unbound? I mean
>> specifically in the cases where you just test if the var is nil.
>>
>> => (def a)
>> #'clojurewerkz.titanium.graph-**test/a
>>
>> => a
>> #
>>
>> => (nil? a)
>> false
>>
>> => (bound? a)
>> ClassCastException clojure.lang.Var$Unbound cannot be cast to
>> clojure.lang.Var  clojure.core/bound?/fn--4837 (core.clj:4954)
>>
>> => (bound? #'a)
>> false
>>
>> ok imagine the following sample :))
>>
>> => (defn decorate [input]
>>  (when (not (nil? input)) (str "prefix:" input ":suffix")))
>> #'clojurewerkz.titanium.graph-**test/decorate
>>
>> => (decorate "1")
>> "prefix:1:suffix"
>>
>> => (decorate a)
>> "prefix:Unbound: #'clojurewerkz.titanium.graph-**test/a:suffix"
>>
>> so... fix?
>>  but more importantly does anyone need to add checks for is-the-var-bound
>> in their code where they checked for nil ?
>>
>> --
>> --
>> 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+unsubscribe@**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+unsubscribe@**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+unsubscribe@**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+unsubscribe@**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: testing for nil may not be enough

2013-04-29 Thread Gary Trakhman
Why not make the root binding nil?  If your decorate function is supposed
to handle all vars, then they have to deal with the unbound case as that's
part of the contract of vars.

If it's a generic thing, then maybe make a multimethod or protocol for it.


On Mon, Apr 29, 2013 at 12:17 PM, AtKaaZ  wrote:

> I'm thinking something like (def ^:dynamic *a*) where it would make more
> sense that it's unbound at first
>
>
> On Mon, Apr 29, 2013 at 7:00 PM, Jim - FooBar(); wrote:
>
>> I 've found that whenever I get a var-unbound exception it is almost
>> always my fault and my fault only...why would you do (def a) anyway?
>>
>> Jim
>>
>>
>>
>> On 29/04/13 16:32, AtKaaZ wrote:
>>
>>> How do you guys handle the cases when the var is unbound? I mean
>>> specifically in the cases where you just test if the var is nil.
>>>
>>> => (def a)
>>> #'clojurewerkz.titanium.graph-**test/a
>>>
>>> => a
>>> #
>>>
>>> => (nil? a)
>>> false
>>>
>>> => (bound? a)
>>> ClassCastException clojure.lang.Var$Unbound cannot be cast to
>>> clojure.lang.Var  clojure.core/bound?/fn--4837 (core.clj:4954)
>>>
>>> => (bound? #'a)
>>> false
>>>
>>> ok imagine the following sample :))
>>>
>>> => (defn decorate [input]
>>>  (when (not (nil? input)) (str "prefix:" input ":suffix")))
>>> #'clojurewerkz.titanium.graph-**test/decorate
>>>
>>> => (decorate "1")
>>> "prefix:1:suffix"
>>>
>>> => (decorate a)
>>> "prefix:Unbound: #'clojurewerkz.titanium.graph-**test/a:suffix"
>>>
>>> so... fix?
>>>  but more importantly does anyone need to add checks for
>>> is-the-var-bound in their code where they checked for nil ?
>>>
>>> --
>>> --
>>> 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+unsubscribe@**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+unsubscribe@**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+unsubscribe@**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+unsubscribe@**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
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: testing for nil may not be enough

2013-04-29 Thread AtKaaZ
Seems like a good idea to have the root binding be nil. How would you make
it check for bound inside the function? do we need some kind of macro?


On Mon, Apr 29, 2013 at 7:23 PM, Gary Trakhman wrote:

> Why not make the root binding nil?  If your decorate function is supposed
> to handle all vars, then they have to deal with the unbound case as that's
> part of the contract of vars.
>
> If it's a generic thing, then maybe make a multimethod or protocol for it.
>
>
> On Mon, Apr 29, 2013 at 12:17 PM, AtKaaZ  wrote:
>
>> I'm thinking something like (def ^:dynamic *a*) where it would make more
>> sense that it's unbound at first
>>
>>
>> On Mon, Apr 29, 2013 at 7:00 PM, Jim - FooBar(); wrote:
>>
>>> I 've found that whenever I get a var-unbound exception it is almost
>>> always my fault and my fault only...why would you do (def a) anyway?
>>>
>>> Jim
>>>
>>>
>>>
>>> On 29/04/13 16:32, AtKaaZ wrote:
>>>
 How do you guys handle the cases when the var is unbound? I mean
 specifically in the cases where you just test if the var is nil.

 => (def a)
 #'clojurewerkz.titanium.graph-**test/a

 => a
 #

 => (nil? a)
 false

 => (bound? a)
 ClassCastException clojure.lang.Var$Unbound cannot be cast to
 clojure.lang.Var  clojure.core/bound?/fn--4837 (core.clj:4954)

 => (bound? #'a)
 false

 ok imagine the following sample :))

 => (defn decorate [input]
  (when (not (nil? input)) (str "prefix:" input ":suffix")))
 #'clojurewerkz.titanium.graph-**test/decorate

 => (decorate "1")
 "prefix:1:suffix"

 => (decorate a)
 "prefix:Unbound: #'clojurewerkz.titanium.graph-**test/a:suffix"

 so... fix?
  but more importantly does anyone need to add checks for
 is-the-var-bound in their code where they checked for nil ?

 --
 --
 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+unsubscribe@**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+unsubscribe@**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+unsubscribe@**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+unsubscribe@**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
> 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

Re: testing for nil may not be enough

2013-04-29 Thread Gary Trakhman
If you're passing the var itself, I don't see why you'd need a macro.  If
you want to check the namespace for a var matching an unquoted symbol, you
could do that in a macro.


On Mon, Apr 29, 2013 at 12:29 PM, AtKaaZ  wrote:

> Seems like a good idea to have the root binding be nil. How would you make
> it check for bound inside the function? do we need some kind of macro?
>
>
> On Mon, Apr 29, 2013 at 7:23 PM, Gary Trakhman wrote:
>
>> Why not make the root binding nil?  If your decorate function is supposed
>> to handle all vars, then they have to deal with the unbound case as that's
>> part of the contract of vars.
>>
>> If it's a generic thing, then maybe make a multimethod or protocol for it.
>>
>>
>> On Mon, Apr 29, 2013 at 12:17 PM, AtKaaZ  wrote:
>>
>>> I'm thinking something like (def ^:dynamic *a*) where it would make more
>>> sense that it's unbound at first
>>>
>>>
>>> On Mon, Apr 29, 2013 at 7:00 PM, Jim - FooBar(); 
>>> wrote:
>>>
 I 've found that whenever I get a var-unbound exception it is almost
 always my fault and my fault only...why would you do (def a) anyway?

 Jim



 On 29/04/13 16:32, AtKaaZ wrote:

> How do you guys handle the cases when the var is unbound? I mean
> specifically in the cases where you just test if the var is nil.
>
> => (def a)
> #'clojurewerkz.titanium.graph-**test/a
>
> => a
> #
>
> => (nil? a)
> false
>
> => (bound? a)
> ClassCastException clojure.lang.Var$Unbound cannot be cast to
> clojure.lang.Var  clojure.core/bound?/fn--4837 (core.clj:4954)
>
> => (bound? #'a)
> false
>
> ok imagine the following sample :))
>
> => (defn decorate [input]
>  (when (not (nil? input)) (str "prefix:" input ":suffix")))
> #'clojurewerkz.titanium.graph-**test/decorate
>
> => (decorate "1")
> "prefix:1:suffix"
>
> => (decorate a)
> "prefix:Unbound: #'clojurewerkz.titanium.graph-**test/a:suffix"
>
> so... fix?
>  but more importantly does anyone need to add checks for
> is-the-var-bound in their code where they checked for nil ?
>
> --
> --
> 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+unsubscribe@**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+unsubscribe@**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+unsubscribe@**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+unsubscribe@**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 fr

Re: testing for nil may not be enough

2013-04-29 Thread Jim - FooBar();
funny you should mention that!!! that is exactly what I meant by 'my 
fault'...I've come to realise that dynamic scope is almost evil, thus I 
go to great lengths to avoid it completely...in the rare cases where I 
do use it I always make sure it is bound to a init/default value :)


Jim


On 29/04/13 17:17, AtKaaZ wrote:
I'm thinking something like (def ^:dynamic *a*) where it would make 
more sense that it's unbound at first



On Mon, Apr 29, 2013 at 7:00 PM, Jim - FooBar(); > wrote:


I 've found that whenever I get a var-unbound exception it is
almost always my fault and my fault only...why would you do (def
a) anyway?

Jim



On 29/04/13 16:32, AtKaaZ wrote:

How do you guys handle the cases when the var is unbound? I
mean specifically in the cases where you just test if the var
is nil.

=> (def a)
#'clojurewerkz.titanium.graph-test/a

=> a
#

=> (nil? a)
false

=> (bound? a)
ClassCastException clojure.lang.Var$Unbound cannot be cast to
clojure.lang.Var  clojure.core/bound?/fn--4837 (core.clj:4954)

=> (bound? #'a)
false

ok imagine the following sample :))

=> (defn decorate [input]
 (when (not (nil? input)) (str "prefix:" input ":suffix")))
#'clojurewerkz.titanium.graph-test/decorate

=> (decorate "1")
"prefix:1:suffix"

=> (decorate a)
"prefix:Unbound: #'clojurewerkz.titanium.graph-test/a:suffix"

so... fix?
 but more importantly does anyone need to add checks for
is-the-var-bound in their code where they checked for nil ?

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

Re: testing for nil may not be enough

2013-04-29 Thread AtKaaZ
I'm thinking of a hacky way of doing it...
(def a nil)
(def b)

=> (defn x [in]
 (when (not (nil? in)) (.v in)))
#'clojurewerkz.titanium.graph-test/x

=> (x b)
#'clojurewerkz.titanium.graph-test/b

=> (x a)
nil



On Mon, Apr 29, 2013 at 7:31 PM, Gary Trakhman wrote:

> If you're passing the var itself, I don't see why you'd need a macro.  If
> you want to check the namespace for a var matching an unquoted symbol, you
> could do that in a macro.
>
>
> On Mon, Apr 29, 2013 at 12:29 PM, AtKaaZ  wrote:
>
>> Seems like a good idea to have the root binding be nil. How would you
>> make it check for bound inside the function? do we need some kind of macro?
>>
>>
>> On Mon, Apr 29, 2013 at 7:23 PM, Gary Trakhman 
>> wrote:
>>
>>> Why not make the root binding nil?  If your decorate function is
>>> supposed to handle all vars, then they have to deal with the unbound case
>>> as that's part of the contract of vars.
>>>
>>> If it's a generic thing, then maybe make a multimethod or protocol for
>>> it.
>>>
>>>
>>> On Mon, Apr 29, 2013 at 12:17 PM, AtKaaZ  wrote:
>>>
 I'm thinking something like (def ^:dynamic *a*) where it would make
 more sense that it's unbound at first


 On Mon, Apr 29, 2013 at 7:00 PM, Jim - FooBar(); 
 wrote:

> I 've found that whenever I get a var-unbound exception it is almost
> always my fault and my fault only...why would you do (def a) anyway?
>
> Jim
>
>
>
> On 29/04/13 16:32, AtKaaZ wrote:
>
>> How do you guys handle the cases when the var is unbound? I mean
>> specifically in the cases where you just test if the var is nil.
>>
>> => (def a)
>> #'clojurewerkz.titanium.graph-**test/a
>>
>> => a
>> #
>>
>> => (nil? a)
>> false
>>
>> => (bound? a)
>> ClassCastException clojure.lang.Var$Unbound cannot be cast to
>> clojure.lang.Var  clojure.core/bound?/fn--4837 (core.clj:4954)
>>
>> => (bound? #'a)
>> false
>>
>> ok imagine the following sample :))
>>
>> => (defn decorate [input]
>>  (when (not (nil? input)) (str "prefix:" input ":suffix")))
>> #'clojurewerkz.titanium.graph-**test/decorate
>>
>> => (decorate "1")
>> "prefix:1:suffix"
>>
>> => (decorate a)
>> "prefix:Unbound: #'clojurewerkz.titanium.graph-**test/a:suffix"
>>
>> so... fix?
>>  but more importantly does anyone need to add checks for
>> is-the-var-bound in their code where they checked for nil ?
>>
>> --
>> --
>> 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+unsubscribe@**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+unsubscribe@**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+unsubscribe@**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+unsubscribe@**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

Re: testing for nil may not be enough

2013-04-29 Thread AtKaaZ
oh right, you mean that I should pass the var like (decorate #'a), I didn't
get that when I first read it. But suppose I'm just passing the
whatever-that-is (value?) like (decorate a) do I need to use a macro inside
the decorate function to check if the passed thing is an unbound var?


On Mon, Apr 29, 2013 at 7:31 PM, Gary Trakhman wrote:

> If you're passing the var itself, I don't see why you'd need a macro.  If
> you want to check the namespace for a var matching an unquoted symbol, you
> could do that in a macro.
>
>
> On Mon, Apr 29, 2013 at 12:29 PM, AtKaaZ  wrote:
>
>> Seems like a good idea to have the root binding be nil. How would you
>> make it check for bound inside the function? do we need some kind of macro?
>>
>>
>> On Mon, Apr 29, 2013 at 7:23 PM, Gary Trakhman 
>> wrote:
>>
>>> Why not make the root binding nil?  If your decorate function is
>>> supposed to handle all vars, then they have to deal with the unbound case
>>> as that's part of the contract of vars.
>>>
>>> If it's a generic thing, then maybe make a multimethod or protocol for
>>> it.
>>>
>>>
>>> On Mon, Apr 29, 2013 at 12:17 PM, AtKaaZ  wrote:
>>>
 I'm thinking something like (def ^:dynamic *a*) where it would make
 more sense that it's unbound at first


 On Mon, Apr 29, 2013 at 7:00 PM, Jim - FooBar(); 
 wrote:

> I 've found that whenever I get a var-unbound exception it is almost
> always my fault and my fault only...why would you do (def a) anyway?
>
> Jim
>
>
>
> On 29/04/13 16:32, AtKaaZ wrote:
>
>> How do you guys handle the cases when the var is unbound? I mean
>> specifically in the cases where you just test if the var is nil.
>>
>> => (def a)
>> #'clojurewerkz.titanium.graph-**test/a
>>
>> => a
>> #
>>
>> => (nil? a)
>> false
>>
>> => (bound? a)
>> ClassCastException clojure.lang.Var$Unbound cannot be cast to
>> clojure.lang.Var  clojure.core/bound?/fn--4837 (core.clj:4954)
>>
>> => (bound? #'a)
>> false
>>
>> ok imagine the following sample :))
>>
>> => (defn decorate [input]
>>  (when (not (nil? input)) (str "prefix:" input ":suffix")))
>> #'clojurewerkz.titanium.graph-**test/decorate
>>
>> => (decorate "1")
>> "prefix:1:suffix"
>>
>> => (decorate a)
>> "prefix:Unbound: #'clojurewerkz.titanium.graph-**test/a:suffix"
>>
>> so... fix?
>>  but more importantly does anyone need to add checks for
>> is-the-var-bound in their code where they checked for nil ?
>>
>> --
>> --
>> 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+unsubscribe@**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+unsubscribe@**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+unsubscribe@**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+unsubscribe@**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

Re: testing for nil may not be enough

2013-04-29 Thread Gary Trakhman
You would only need a macro if you want to pass in 'a' and mean #'a.
 Syntactic abstraction.  Like I said, I'd make the implementation
polymorphic on that value via a protocol so you're not special-casing it
within the function itself.  Protocols are open for extension so someone
else could come along and provide an implementation for something you
haven't thought of doing.


On Mon, Apr 29, 2013 at 12:44 PM, AtKaaZ  wrote:

> oh right, you mean that I should pass the var like (decorate #'a), I
> didn't get that when I first read it. But suppose I'm just passing the
> whatever-that-is (value?) like (decorate a) do I need to use a macro inside
> the decorate function to check if the passed thing is an unbound var?
>
>
> On Mon, Apr 29, 2013 at 7:31 PM, Gary Trakhman wrote:
>
>> If you're passing the var itself, I don't see why you'd need a macro.  If
>> you want to check the namespace for a var matching an unquoted symbol, you
>> could do that in a macro.
>>
>>
>> On Mon, Apr 29, 2013 at 12:29 PM, AtKaaZ  wrote:
>>
>>> Seems like a good idea to have the root binding be nil. How would you
>>> make it check for bound inside the function? do we need some kind of macro?
>>>
>>>
>>> On Mon, Apr 29, 2013 at 7:23 PM, Gary Trakhman 
>>> wrote:
>>>
 Why not make the root binding nil?  If your decorate function is
 supposed to handle all vars, then they have to deal with the unbound case
 as that's part of the contract of vars.

 If it's a generic thing, then maybe make a multimethod or protocol for
 it.


 On Mon, Apr 29, 2013 at 12:17 PM, AtKaaZ  wrote:

> I'm thinking something like (def ^:dynamic *a*) where it would make
> more sense that it's unbound at first
>
>
> On Mon, Apr 29, 2013 at 7:00 PM, Jim - FooBar();  > wrote:
>
>> I 've found that whenever I get a var-unbound exception it is almost
>> always my fault and my fault only...why would you do (def a) anyway?
>>
>> Jim
>>
>>
>>
>> On 29/04/13 16:32, AtKaaZ wrote:
>>
>>> How do you guys handle the cases when the var is unbound? I mean
>>> specifically in the cases where you just test if the var is nil.
>>>
>>> => (def a)
>>> #'clojurewerkz.titanium.graph-**test/a
>>>
>>> => a
>>> #
>>>
>>> => (nil? a)
>>> false
>>>
>>> => (bound? a)
>>> ClassCastException clojure.lang.Var$Unbound cannot be cast to
>>> clojure.lang.Var  clojure.core/bound?/fn--4837 (core.clj:4954)
>>>
>>> => (bound? #'a)
>>> false
>>>
>>> ok imagine the following sample :))
>>>
>>> => (defn decorate [input]
>>>  (when (not (nil? input)) (str "prefix:" input ":suffix")))
>>> #'clojurewerkz.titanium.graph-**test/decorate
>>>
>>> => (decorate "1")
>>> "prefix:1:suffix"
>>>
>>> => (decorate a)
>>> "prefix:Unbound: #'clojurewerkz.titanium.graph-**test/a:suffix"
>>>
>>> so... fix?
>>>  but more importantly does anyone need to add checks for
>>> is-the-var-bound in their code where they checked for nil ?
>>>
>>> --
>>> --
>>> 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+unsubscribe@**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+unsubscribe@**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+unsubscribe@**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+unsubscribe@**googlegroups.com
>> .
>> For more options, visit 
>> https://groups.google.com/**groups/opt_out

Re: testing for nil may not be enough

2013-04-29 Thread AtKaaZ
thank you, I'll look into protocols


On Mon, Apr 29, 2013 at 7:54 PM, Gary Trakhman wrote:

> You would only need a macro if you want to pass in 'a' and mean #'a.
>  Syntactic abstraction.  Like I said, I'd make the implementation
> polymorphic on that value via a protocol so you're not special-casing it
> within the function itself.  Protocols are open for extension so someone
> else could come along and provide an implementation for something you
> haven't thought of doing.
>
>
> On Mon, Apr 29, 2013 at 12:44 PM, AtKaaZ  wrote:
>
>> oh right, you mean that I should pass the var like (decorate #'a), I
>> didn't get that when I first read it. But suppose I'm just passing the
>> whatever-that-is (value?) like (decorate a) do I need to use a macro inside
>> the decorate function to check if the passed thing is an unbound var?
>>
>>
>> On Mon, Apr 29, 2013 at 7:31 PM, Gary Trakhman 
>> wrote:
>>
>>> If you're passing the var itself, I don't see why you'd need a macro.
>>>  If you want to check the namespace for a var matching an unquoted symbol,
>>> you could do that in a macro.
>>>
>>>
>>> On Mon, Apr 29, 2013 at 12:29 PM, AtKaaZ  wrote:
>>>
 Seems like a good idea to have the root binding be nil. How would you
 make it check for bound inside the function? do we need some kind of macro?


 On Mon, Apr 29, 2013 at 7:23 PM, Gary Trakhman >>> > wrote:

> Why not make the root binding nil?  If your decorate function is
> supposed to handle all vars, then they have to deal with the unbound case
> as that's part of the contract of vars.
>
> If it's a generic thing, then maybe make a multimethod or protocol for
> it.
>
>
> On Mon, Apr 29, 2013 at 12:17 PM, AtKaaZ  wrote:
>
>> I'm thinking something like (def ^:dynamic *a*) where it would make
>> more sense that it's unbound at first
>>
>>
>> On Mon, Apr 29, 2013 at 7:00 PM, Jim - FooBar(); <
>> jimpil1...@gmail.com> wrote:
>>
>>> I 've found that whenever I get a var-unbound exception it is almost
>>> always my fault and my fault only...why would you do (def a) anyway?
>>>
>>> Jim
>>>
>>>
>>>
>>> On 29/04/13 16:32, AtKaaZ wrote:
>>>
 How do you guys handle the cases when the var is unbound? I mean
 specifically in the cases where you just test if the var is nil.

 => (def a)
 #'clojurewerkz.titanium.graph-**test/a

 => a
 #

 => (nil? a)
 false

 => (bound? a)
 ClassCastException clojure.lang.Var$Unbound cannot be cast to
 clojure.lang.Var  clojure.core/bound?/fn--4837 (core.clj:4954)

 => (bound? #'a)
 false

 ok imagine the following sample :))

 => (defn decorate [input]
  (when (not (nil? input)) (str "prefix:" input ":suffix")))
 #'clojurewerkz.titanium.graph-**test/decorate

 => (decorate "1")
 "prefix:1:suffix"

 => (decorate a)
 "prefix:Unbound: #'clojurewerkz.titanium.graph-**test/a:suffix"

 so... fix?
  but more importantly does anyone need to add checks for
 is-the-var-bound in their code where they checked for nil ?

 --
 --
 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+unsubscribe@**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+unsubscribe@**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+unsubscribe@**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 "Clo

Re: [ANN] Grojure, a Java/C# syntax atop Clojure using Kern

2013-04-29 Thread Armando Blancas
Nice work, Gavin. Grojure is a good example why Clojure is an excellent 
UNCOL for the JVM, so some of us will depend less on the ASM lib. Your 
parser illustrates how to use grammar actions for writing a very compact 
one-pass translator; pretty cool.

On Sunday, April 28, 2013 9:41:00 PM UTC-7, Gavin Grover wrote:
>
> Grojure is a Java/C#/Groovy-like syntax atop Clojure using the Kern parser 
> combinator library. It's also of interest as an example grammar for those 
> using Kern to build their own grammars.
>
> Available from https://github.com/gavingroovygrover/grojure
>
> Gavin "Groovy" Grover
>
>

-- 
-- 
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: testing for nil may not be enough

2013-04-29 Thread Sean Corfield
Try this:

user=> (def a)
#'user/a
user=> (bound? (var a))
false
user=> (def a nil)
#'user/a
user=> (bound? (var a))
true

Sean

On Mon, Apr 29, 2013 at 8:32 AM, AtKaaZ  wrote:
> How do you guys handle the cases when the var is unbound? I mean
> specifically in the cases where you just test if the var is nil.
>
> => (def a)
> #'clojurewerkz.titanium.graph-test/a
>
> => a
> #
>
> => (nil? a)
> false
>
> => (bound? a)
> ClassCastException clojure.lang.Var$Unbound cannot be cast to
> clojure.lang.Var  clojure.core/bound?/fn--4837 (core.clj:4954)
>
> => (bound? #'a)
> false
>
> ok imagine the following sample :))
>
> => (defn decorate [input]
>  (when (not (nil? input)) (str "prefix:" input ":suffix")))
> #'clojurewerkz.titanium.graph-test/decorate
>
> => (decorate "1")
> "prefix:1:suffix"
>
> => (decorate a)
> "prefix:Unbound: #'clojurewerkz.titanium.graph-test/a:suffix"
>
> so... fix?
>  but more importantly does anyone need to add checks for is-the-var-bound in
> their code where they checked for nil ?
>
> --
> --
> 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.
>
>



-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
-- 
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: testing for nil may not be enough

2013-04-29 Thread AtKaaZ
the pain with that is that it wouldn't work inside a function where a would
be the function parameter, ok it would work in a macro but inside a
function... that would be interesting to see


On Mon, Apr 29, 2013 at 9:01 PM, Sean Corfield wrote:

> Try this:
>
> user=> (def a)
> #'user/a
> user=> (bound? (var a))
> false
> user=> (def a nil)
> #'user/a
> user=> (bound? (var a))
> true
>
> Sean
>
> On Mon, Apr 29, 2013 at 8:32 AM, AtKaaZ  wrote:
> > How do you guys handle the cases when the var is unbound? I mean
> > specifically in the cases where you just test if the var is nil.
> >
> > => (def a)
> > #'clojurewerkz.titanium.graph-test/a
> >
> > => a
> > #
> >
> > => (nil? a)
> > false
> >
> > => (bound? a)
> > ClassCastException clojure.lang.Var$Unbound cannot be cast to
> > clojure.lang.Var  clojure.core/bound?/fn--4837 (core.clj:4954)
> >
> > => (bound? #'a)
> > false
> >
> > ok imagine the following sample :))
> >
> > => (defn decorate [input]
> >  (when (not (nil? input)) (str "prefix:" input ":suffix")))
> > #'clojurewerkz.titanium.graph-test/decorate
> >
> > => (decorate "1")
> > "prefix:1:suffix"
> >
> > => (decorate a)
> > "prefix:Unbound: #'clojurewerkz.titanium.graph-test/a:suffix"
> >
> > so... fix?
> >  but more importantly does anyone need to add checks for
> is-the-var-bound in
> > their code where they checked for nil ?
> >
> > --
> > --
> > 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.
> >
> >
>
>
>
> --
> Sean A Corfield -- (904) 302-SEAN
> An Architect's View -- http://corfield.org/
> World Singles, LLC. -- http://worldsingles.com/
>
> "Perfection is the enemy of the good."
> -- Gustave Flaubert, French realist novelist (1821-1880)
>
> --
> --
> 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: testing for nil may not be enough

2013-04-29 Thread Jonathan Fischer Friberg
If you don't want to set the initial value to nil, set it to ::unbound or
similar. Should be very
hard to accidentally bind the same value.

Jonathan


On Mon, Apr 29, 2013 at 8:04 PM, AtKaaZ  wrote:

> the pain with that is that it wouldn't work inside a function where a
> would be the function parameter, ok it would work in a macro but inside a
> function... that would be interesting to see
>
>
> On Mon, Apr 29, 2013 at 9:01 PM, Sean Corfield wrote:
>
>> Try this:
>>
>> user=> (def a)
>> #'user/a
>> user=> (bound? (var a))
>> false
>> user=> (def a nil)
>> #'user/a
>> user=> (bound? (var a))
>> true
>>
>> Sean
>>
>> On Mon, Apr 29, 2013 at 8:32 AM, AtKaaZ  wrote:
>> > How do you guys handle the cases when the var is unbound? I mean
>> > specifically in the cases where you just test if the var is nil.
>> >
>> > => (def a)
>> > #'clojurewerkz.titanium.graph-test/a
>> >
>> > => a
>> > #
>> >
>> > => (nil? a)
>> > false
>> >
>> > => (bound? a)
>> > ClassCastException clojure.lang.Var$Unbound cannot be cast to
>> > clojure.lang.Var  clojure.core/bound?/fn--4837 (core.clj:4954)
>> >
>> > => (bound? #'a)
>> > false
>> >
>> > ok imagine the following sample :))
>> >
>> > => (defn decorate [input]
>> >  (when (not (nil? input)) (str "prefix:" input ":suffix")))
>> > #'clojurewerkz.titanium.graph-test/decorate
>> >
>> > => (decorate "1")
>> > "prefix:1:suffix"
>> >
>> > => (decorate a)
>> > "prefix:Unbound: #'clojurewerkz.titanium.graph-test/a:suffix"
>> >
>> > so... fix?
>> >  but more importantly does anyone need to add checks for
>> is-the-var-bound in
>> > their code where they checked for nil ?
>> >
>> > --
>> > --
>> > 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.
>> >
>> >
>>
>>
>>
>> --
>> Sean A Corfield -- (904) 302-SEAN
>> An Architect's View -- http://corfield.org/
>> World Singles, LLC. -- http://worldsingles.com/
>>
>> "Perfection is the enemy of the good."
>> -- Gustave Flaubert, French realist novelist (1821-1880)
>>
>> --
>> --
>> 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
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] Grojure, a Java/C# syntax atop Clojure using Kern

2013-04-29 Thread Baishampayan Ghose
Very nice work! ~BG

On Mon, Apr 29, 2013 at 10:11 AM, Gavin Grover
 wrote:
> Grojure is a Java/C#/Groovy-like syntax atop Clojure using the Kern parser
> combinator library. It's also of interest as an example grammar for those
> using Kern to build their own grammars.
>
> Available from https://github.com/gavingroovygrover/grojure
>
> Gavin "Groovy" Grover
>
> --
> --
> 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: Now *there*'s a machine made for Clojure.

2013-04-29 Thread Cesar Pinera
There's no Java option for using the Intel Xeon Phi yet. When I wanted to
try them with my Clojure code (I work for Intel) I was told I would have to
work directly with the native APIs. So no luck there yet.


On Sat, Apr 27, 2013 at 7:51 PM, Cedric Greevey  wrote:

> https://en.wikipedia.org/wiki/Intel_MIC
>
> 50+ cores?! Clojure will leave every other language in the dust on
> something like that, thanks to its inherently scaleable concurrency
> constructs. Try writing a 50-threaded Java application without getting
> deadlocks all over the place, or cheating and using very coarse-grained
> locks (have fun with the task manager showing 2% CPU utilization when your
> app is running full-bore!).
>
> If big, 32-bit addressing spaces were what made automatic memory
> management really begin to come into its own (and with it, Java), then it's
> doubtless 50-core machines that will make automatic concurrency management
> really begin to come into its own.
>
>

-- 
-- 
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: login with friend, but username blank, despite keyword-params middleware in place

2013-04-29 Thread larry google groups
I will re-phrase the question. Can anyone suggest a reason why the form 
params would be not register with these middlewares in place? 

(def app
  (-> app-routes
  (friend/authenticate {:workflows [(workflows/interactive-form)]
:credential-fn (partial 
creds/bcrypt-credential-fn users)})
  (wrap-session {:cookie-name "timeout-session" :cookie-attrs {:max-age 
90}})
  (wrap-cookies)
  (wrap-multipart-params)
  (wrap-params)
  (wrap-nested-params)
  (wrap-keyword-params)))

The problem is specific to "friend". I have other forms, which are not 
protected by "friend" and they work just fine. 

But with "friend", when I pprint the request to the terminal, I only see 
stuff like:

:params {},
 :form-params {},
 :multipart-params {},

I print the request on the first line of the login function: 

(defn login [request]
  (println (pp/pprint request))
  "2013-03-01 - the default name of the function expected by the Friend 
authorization library."
  (timbre/spy :debug " the return value of the login page: "
  (let [login-template (enlive/html-resource 
"templates/login.html")
login-html  (apply str (enlive/emit* login-template))
layout (enlive/html-resource "templates/admin.html")
layout (enlive/transform layout
 [:#outer]
 (enlive/html-content 
login-html))
html (apply str (enlive/emit* layout))
  ]
(response html


my routes:

(defroutes app-routes
  (ANY "/" request (home-page request))
  (ANY "/login" request (login request))
  (friend/logout (ANY "/logout" request (ring.util.response/redirect "/")))
  (GET "/serve-file/:file-id" request (serve-file request))
  (GET "/home/:slides-id" request (home-page request))
  (GET "/action/:action-to-perform" request (action request))
  (GET "/admin" request (friend/authorize #{::admin} (admin request)))
  (GET "/admin/list/:item-type" [item-type] (admin-list item-type))
  (GET "/admin/edit/:item-type" request (admin-forms request))
  (GET "/admin/edit/:item-type/:item-name" request (admin-forms request))
  (POST "/admin/edit/:item-type/:item-name" request 
(admin-process-form-input request))
  (POST "/admin/edit/:item-type" request (admin-process-form-input request))
  (GET "/admin/delete/:item-type/:item-name" request 
(admin-delete-ask-for-confirmation request))
  (POST "/admin/delete/:item-type/:item-name" request 
(admin-delete-finalized request))
  (GET "/admin/clone/:item-type/:item-name" request (admin-clone-this-item 
request))
  (GET "/admin/preview/:item-type/:item-name" request (admin-preview 
request))
  (GET "/admin/upload" request (admin-upload request))
  (route/resources "/")
  (route/not-found "Page not found"))


I have tried several things and nothing has given me much of a clue, so any 
suggestions are welcome. 





On Friday, April 26, 2013 2:16:22 PM UTC-4, larry google groups wrote:
>
> I have tried putting (friend/authenticate) at the beginning and end of 
> this block:
>
>
> (def app
>   (-> app-routes
>   (wrap-session {:cookie-name "timeout-session" :cookie-attrs 
> {:max-age 90}})
>   (wrap-cookies)
>   (wrap-multipart-params)
>   (wrap-params)
>   (wrap-nested-params)
>   (wrap-keyword-params)
>   (friend/authenticate {:workflows [(workflows/interactive-form)]
> :credential-fn (partial 
> creds/bcrypt-credential-fn users)
> :login-uri "/login"
> :unauthorized-redirect-uri "/login" 
> :default-landing-uri "/admin"})))
>
>
> and: 
>
>
> (def app
>   (-> app-routes
>   (friend/authenticate {:workflows [(workflows/interactive-form)]
> :credential-fn (partial 
> creds/bcrypt-credential-fn users)
> :login-uri "/login"
> :unauthorized-redirect-uri "/login" 
> :default-landing-uri "/admin"})
>   (wrap-session {:cookie-name "timeout-session" :cookie-attrs 
> {:max-age 90}})
>   (wrap-cookies)
>   (wrap-multipart-params)
>   (wrap-params)
>   (wrap-nested-params)
>   (wrap-keyword-params)
> ))
>
>
> but that doesn't seem to matter. 
>
> I defined my one user in the namespace as: 
>
> (def users {"admin" {:username "admin"
>  :password (creds/hash-bcrypt "47010thave")
>  :roles #{::admin}}})
>
> If I point my broswer here:
>
> localhost:3/admin
>
> I get redirected to here:
>
> localhost:3/admin
>
> I then fill in this form:
>
> Username: Password:  />
> 
> If I print the request to the terminal, the form params are all blank:
>
> {:ssl-client-cert nil,
>  :remote-addr "0:0:0:0:0:0:0:1",
>  :scheme :http,
>  :query-para

Using a Java game engine in my project

2013-04-29 Thread Alex Fowler
Hello! I have a problem, I will try to explain.. I want to write a game 
with Clojure and JMonkeyEngine (http://jmonkeyengine.com/). So I take their 
latest nightie set of jars (http://jmonkeyengine.com/nightly/) and 
what? I can't make use of them in my CCW/Leiningen project no matter how 
hard I try. So ok, I have found some examples where people get them in the 
"lib" folder and it works, or where they recommend pushing them to the 
local maven repo... but they do not tell how they do it, or they show it 
for some very simple cases. Sure, there is a lot of instructions like "use 
mvn install:install-file " or "lein localrepo 
install "... so do I have to do it for all the 30 
(thirty) jar files? Considering too, that I have to invent an "artifactId" 
for every one of them, invent a "version number", type all that in 
manually. And that is not my library, I do not want to invent that. And 
even, if I do that, then, how do I specify that all them are interdependant 
(are parts of one thing) and have to be always drawn in together? I will 
have to specify the 30 dependencies in my project.clj each time? Well, and 
even if I do, then I will still have that pain with manually copying all 
that stuff on each new machine where I work, picking it from the local 
maven repo and putting it to another maven repo. And if I want to push 
it to Clojars, I have do that for each one manually too, typing in commands 
in the Windows cmd and taking care for inventing version numbers?... oh, 
and maybe I could go about specifying  clauses in a pom? pinch 
me am I dreaming a nightmare? :)

I have tried to do something along these lines... spent about 15 hours in 
general and got almost nothing but headache and eyesore... and a feeling of 
being extremily stupid for not being able to plug a few jars into a jvm 
program (isn't java all just about putting jars together? :) ). I am a 
Clojure newb and maybe I am missing somewhat essential.. but in Scala, with 
or without SBT, using Scala IDE for Eclipse, I got everything up and 
running in about 15 minutes.

Please, could anyone give me a clear explanation or better, a full example 
of plugging in the JME3 into a Clojure project? Shouldn't it be simple? 
Thank you in advance, the situation is really disappointing for me :(

-- 
-- 
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: login with friend, but username blank, despite keyword-params middleware in place

2013-04-29 Thread larry google groups
After the failed login, I am redirected here:

http://localhost:30001/login?&login_failed=Y&username=

and where I pprint the request, I see this in the terminal:

 :params {"" nil, "login_failed" "Y", "username" ""},






On Monday, April 29, 2013 3:09:09 PM UTC-4, larry google groups wrote:
>
> I will re-phrase the question. Can anyone suggest a reason why the form 
> params would be not register with these middlewares in place? 
>
> (def app
>   (-> app-routes
>   (friend/authenticate {:workflows [(workflows/interactive-form)]
> :credential-fn (partial 
> creds/bcrypt-credential-fn users)})
>   (wrap-session {:cookie-name "timeout-session" :cookie-attrs 
> {:max-age 90}})
>   (wrap-cookies)
>   (wrap-multipart-params)
>   (wrap-params)
>   (wrap-nested-params)
>   (wrap-keyword-params)))
>
> The problem is specific to "friend". I have other forms, which are not 
> protected by "friend" and they work just fine. 
>
> But with "friend", when I pprint the request to the terminal, I only see 
> stuff like:
>
> :params {},
>  :form-params {},
>  :multipart-params {},
>
> I print the request on the first line of the login function: 
>
> (defn login [request]
>   (println (pp/pprint request))
>   "2013-03-01 - the default name of the function expected by the Friend 
> authorization library."
>   (timbre/spy :debug " the return value of the login page: "
>   (let [login-template (enlive/html-resource 
> "templates/login.html")
> login-html  (apply str (enlive/emit* login-template))
> layout (enlive/html-resource "templates/admin.html")
> layout (enlive/transform layout
>  [:#outer]
>  (enlive/html-content 
> login-html))
> html (apply str (enlive/emit* layout))
>   ]
> (response html
>
>
> my routes:
>
> (defroutes app-routes
>   (ANY "/" request (home-page request))
>   (ANY "/login" request (login request))
>   (friend/logout (ANY "/logout" request (ring.util.response/redirect "/")))
>   (GET "/serve-file/:file-id" request (serve-file request))
>   (GET "/home/:slides-id" request (home-page request))
>   (GET "/action/:action-to-perform" request (action request))
>   (GET "/admin" request (friend/authorize #{::admin} (admin request)))
>   (GET "/admin/list/:item-type" [item-type] (admin-list item-type))
>   (GET "/admin/edit/:item-type" request (admin-forms request))
>   (GET "/admin/edit/:item-type/:item-name" request (admin-forms request))
>   (POST "/admin/edit/:item-type/:item-name" request 
> (admin-process-form-input request))
>   (POST "/admin/edit/:item-type" request (admin-process-form-input 
> request))
>   (GET "/admin/delete/:item-type/:item-name" request 
> (admin-delete-ask-for-confirmation request))
>   (POST "/admin/delete/:item-type/:item-name" request 
> (admin-delete-finalized request))
>   (GET "/admin/clone/:item-type/:item-name" request (admin-clone-this-item 
> request))
>   (GET "/admin/preview/:item-type/:item-name" request (admin-preview 
> request))
>   (GET "/admin/upload" request (admin-upload request))
>   (route/resources "/")
>   (route/not-found "Page not found"))
>
>
> I have tried several things and nothing has given me much of a clue, so 
> any suggestions are welcome. 
>
>
>
>
>
> On Friday, April 26, 2013 2:16:22 PM UTC-4, larry google groups wrote:
>>
>> I have tried putting (friend/authenticate) at the beginning and end of 
>> this block:
>>
>>
>> (def app
>>   (-> app-routes
>>   (wrap-session {:cookie-name "timeout-session" :cookie-attrs 
>> {:max-age 90}})
>>   (wrap-cookies)
>>   (wrap-multipart-params)
>>   (wrap-params)
>>   (wrap-nested-params)
>>   (wrap-keyword-params)
>>   (friend/authenticate {:workflows [(workflows/interactive-form)]
>> :credential-fn (partial 
>> creds/bcrypt-credential-fn users)
>> :login-uri "/login"
>> :unauthorized-redirect-uri "/login" 
>> :default-landing-uri "/admin"})))
>>
>>
>> and: 
>>
>>
>> (def app
>>   (-> app-routes
>>   (friend/authenticate {:workflows [(workflows/interactive-form)]
>> :credential-fn (partial 
>> creds/bcrypt-credential-fn users)
>> :login-uri "/login"
>> :unauthorized-redirect-uri "/login" 
>> :default-landing-uri "/admin"})
>>   (wrap-session {:cookie-name "timeout-session" :cookie-attrs 
>> {:max-age 90}})
>>   (wrap-cookies)
>>   (wrap-multipart-params)
>>   (wrap-params)
>>   (wrap-nested-params)
>>   (wrap-keyword-params)
>> ))
>>
>>
>> but that doesn't seem to matter. 
>>
>> I defined my one user in the namespace as: 

Re: Using a Java game engine in my project

2013-04-29 Thread AtKaaZ
Hi, I've been planning on trying the instructions/code from [1] with regard
to jme3 and clojure but I haven't got there yet. Does that help you ?

There's also this project [2] which uses jme3 in clojure. The last time I
tried it I was able to get a window and a 3D scene.

[1] http://aurellem.org/
[2] https://github.com/CmdrDats/fightingsail



On Mon, Apr 29, 2013 at 10:02 PM, Alex Fowler wrote:

> Hello! I have a problem, I will try to explain.. I want to write a game
> with Clojure and JMonkeyEngine (http://jmonkeyengine.com/). So I take
> their latest nightie set of jars (http://jmonkeyengine.com/nightly/)
> and what? I can't make use of them in my CCW/Leiningen project no
> matter how hard I try. So ok, I have found some examples where people get
> them in the "lib" folder and it works, or where they recommend pushing them
> to the local maven repo... but they do not tell how they do it, or they
> show it for some very simple cases. Sure, there is a lot of instructions
> like "use mvn install:install-file " or "lein
> localrepo install "... so do I have to do it for all
> the 30 (thirty) jar files? Considering too, that I have to invent an
> "artifactId" for every one of them, invent a "version number", type all
> that in manually. And that is not my library, I do not want to invent that.
> And even, if I do that, then, how do I specify that all them are
> interdependant (are parts of one thing) and have to be always drawn in
> together? I will have to specify the 30 dependencies in my project.clj each
> time? Well, and even if I do, then I will still have that pain with
> manually copying all that stuff on each new machine where I work, picking
> it from the local maven repo and putting it to another maven repo. And
> if I want to push it to Clojars, I have do that for each one manually too,
> typing in commands in the Windows cmd and taking care for inventing version
> numbers?... oh, and maybe I could go about specifying  clauses
> in a pom? pinch me am I dreaming a nightmare? :)
>
> I have tried to do something along these lines... spent about 15 hours in
> general and got almost nothing but headache and eyesore... and a feeling of
> being extremily stupid for not being able to plug a few jars into a jvm
> program (isn't java all just about putting jars together? :) ). I am a
> Clojure newb and maybe I am missing somewhat essential.. but in Scala, with
> or without SBT, using Scala IDE for Eclipse, I got everything up and
> running in about 15 minutes.
>
> Please, could anyone give me a clear explanation or better, a full example
> of plugging in the JME3 into a Clojure project? Shouldn't it be simple?
> Thank you in advance, the situation is really disappointing for me :(
>
> --
> --
> 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 Elastisch 1.1.0-rc1 is released

2013-04-29 Thread Michael Klishin
Elastisch [1] is a small, feature complete, well documented Clojure client
for ElasticSearch.

1.1 includes a number of new features, most notably:

 * Native client with the same API as the REST one
 * Scroll queries support
 * Bulk operations support

Release notes:
http://blog.clojurewerkz.org/blog/2013/04/29/elastisch-1-dot-1-0-rc1-is-released/

1. http://clojureelasticsearch.info
-- 
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: Using a Java game engine in my project

2013-04-29 Thread James Reeves
I've been messing around with jME3 as well, and at some point I might
release a library for it.

One of the problems with jME3 is that its deployment mechanism hasn't quite
caught up with the current century. I'm planning on packaging it up
eventually, but in the meantime here's the ugly, dirty, terrible hack I've
been using:

1. Download the binaries:
http://www.jmonkeyengine.com/nightly/jME3_2013-04-29.zip
2. Create a new directory and extract the zip file into it
3. Create a new Leiningen project
4. Add the following to your project.clj file: :resource-paths ["lib/*"]
5. Copy the lib directory from the jME3 binaries into your project directory

Here's an example application to get you going:

https://gist.github.com/weavejester/5484183

- James


On 29 April 2013 20:02, Alex Fowler  wrote:

> Hello! I have a problem, I will try to explain.. I want to write a game
> with Clojure and JMonkeyEngine (http://jmonkeyengine.com/). So I take
> their latest nightie set of jars (http://jmonkeyengine.com/nightly/)
> and what? I can't make use of them in my CCW/Leiningen project no
> matter how hard I try. So ok, I have found some examples where people get
> them in the "lib" folder and it works, or where they recommend pushing them
> to the local maven repo... but they do not tell how they do it, or they
> show it for some very simple cases. Sure, there is a lot of instructions
> like "use mvn install:install-file " or "lein
> localrepo install "... so do I have to do it for all
> the 30 (thirty) jar files? Considering too, that I have to invent an
> "artifactId" for every one of them, invent a "version number", type all
> that in manually. And that is not my library, I do not want to invent that.
> And even, if I do that, then, how do I specify that all them are
> interdependant (are parts of one thing) and have to be always drawn in
> together? I will have to specify the 30 dependencies in my project.clj each
> time? Well, and even if I do, then I will still have that pain with
> manually copying all that stuff on each new machine where I work, picking
> it from the local maven repo and putting it to another maven repo. And
> if I want to push it to Clojars, I have do that for each one manually too,
> typing in commands in the Windows cmd and taking care for inventing version
> numbers?... oh, and maybe I could go about specifying  clauses
> in a pom? pinch me am I dreaming a nightmare? :)
>
> I have tried to do something along these lines... spent about 15 hours in
> general and got almost nothing but headache and eyesore... and a feeling of
> being extremily stupid for not being able to plug a few jars into a jvm
> program (isn't java all just about putting jars together? :) ). I am a
> Clojure newb and maybe I am missing somewhat essential.. but in Scala, with
> or without SBT, using Scala IDE for Eclipse, I got everything up and
> running in about 15 minutes.
>
> Please, could anyone give me a clear explanation or better, a full example
> of plugging in the JME3 into a Clojure project? Shouldn't it be simple?
> Thank you in advance, the situation is really disappointing for me :(
>
> --
> --
> 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: Using a Java game engine in my project

2013-04-29 Thread AtKaaZ
That's awesome!  Thanks James!


On Mon, Apr 29, 2013 at 10:46 PM, James Reeves wrote:

> I've been messing around with jME3 as well, and at some point I might
> release a library for it.
>
> One of the problems with jME3 is that its deployment mechanism hasn't
> quite caught up with the current century. I'm planning on packaging it up
> eventually, but in the meantime here's the ugly, dirty, terrible hack I've
> been using:
>
> 1. Download the binaries:
> http://www.jmonkeyengine.com/nightly/jME3_2013-04-29.zip
> 2. Create a new directory and extract the zip file into it
> 3. Create a new Leiningen project
> 4. Add the following to your project.clj file: :resource-paths ["lib/*"]
> 5. Copy the lib directory from the jME3 binaries into your project
> directory
>
> Here's an example application to get you going:
>
> https://gist.github.com/weavejester/5484183
>
> - James
>
>
> On 29 April 2013 20:02, Alex Fowler  wrote:
>
>> Hello! I have a problem, I will try to explain.. I want to write a game
>> with Clojure and JMonkeyEngine (http://jmonkeyengine.com/). So I take
>> their latest nightie set of jars (http://jmonkeyengine.com/nightly/)
>> and what? I can't make use of them in my CCW/Leiningen project no
>> matter how hard I try. So ok, I have found some examples where people get
>> them in the "lib" folder and it works, or where they recommend pushing them
>> to the local maven repo... but they do not tell how they do it, or they
>> show it for some very simple cases. Sure, there is a lot of instructions
>> like "use mvn install:install-file " or "lein
>> localrepo install "... so do I have to do it for all
>> the 30 (thirty) jar files? Considering too, that I have to invent an
>> "artifactId" for every one of them, invent a "version number", type all
>> that in manually. And that is not my library, I do not want to invent that.
>> And even, if I do that, then, how do I specify that all them are
>> interdependant (are parts of one thing) and have to be always drawn in
>> together? I will have to specify the 30 dependencies in my project.clj each
>> time? Well, and even if I do, then I will still have that pain with
>> manually copying all that stuff on each new machine where I work, picking
>> it from the local maven repo and putting it to another maven repo. And
>> if I want to push it to Clojars, I have do that for each one manually too,
>> typing in commands in the Windows cmd and taking care for inventing version
>> numbers?... oh, and maybe I could go about specifying  clauses
>> in a pom? pinch me am I dreaming a nightmare? :)
>>
>> I have tried to do something along these lines... spent about 15 hours in
>> general and got almost nothing but headache and eyesore... and a feeling of
>> being extremily stupid for not being able to plug a few jars into a jvm
>> program (isn't java all just about putting jars together? :) ). I am a
>> Clojure newb and maybe I am missing somewhat essential.. but in Scala, with
>> or without SBT, using Scala IDE for Eclipse, I got everything up and
>> running in about 15 minutes.
>>
>> Please, could anyone give me a clear explanation or better, a full
>> example of plugging in the JME3 into a Clojure project? Shouldn't it be
>> simple? Thank you in advance, the situation is really disappointing for me
>> :(
>>
>> --
>> --
>> 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 mem

[GSoC 2013] Learning resource

2013-04-29 Thread Andrew Kondratovich
Hello.

It's probably late, but I want to offer to community a GSoC project idea. 
Recently, I took a part in a short Clojure courses, which were organized on 
pure enthusiasm by Dmitry Bushenko. There were a lot of people interested 
in it. Most of them didn't not know where to start but they wanted.

I propose to create an engine (web resource) that allows to create 
educational materials for Clojure, give assignments and carry out their 
test.

I imagine it like this:

1. Lecturer creates a video presentation or webinar.
2. Optional test task in the form of a blank leiningen project.
3. Members learn the materials and perform a task which would be tested by 
system after.

I have ideas of how to implement different parts of the system, test 
project management and testing, mechanism to create whole courses for 
Clojure and some more.

A lot can be learned from the experience of Codecademy.

I think such a resource would be useful for community by promoting the 
language.

Do you think the same and are there are any people ready to take on 
mentoring ?


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.




[ANN] Himilsbach 0.0.1 is released

2013-04-29 Thread Jan Stępień
Dear Clojurians,

I'm very happy to announce Himilsbach 0.0.1.

Himilsbach is a tiny actor library for intra-process messaging inspired by 
Erlang.

Find it at https://github.com/jstepien/himilsbach

Your feedback is very much appreciated!

All the best,
--
Jan Stępień

-- 
-- 
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: Using a Java game engine in my project

2013-04-29 Thread Jonathan Fischer Friberg
I'm currently making a library for jmonkeyengine. It's not
ready yet, however, a while back I decided to put jme in a repository.

Url: "http://jmonkeyengine.s3-website-eu-west-1.amazonaws.com/";
Add to deps: [jme "2013-04-01"]

The biggest problem with it right now is that it contains all test models
and textures, which I didn't realise at the time (this accounts for more
than half of the size). But it's quick & easy if you want to give it a go.

Jonathan



On Mon, Apr 29, 2013 at 9:56 PM, AtKaaZ  wrote:

> That's awesome!  Thanks James!
>
>
> On Mon, Apr 29, 2013 at 10:46 PM, James Reeves wrote:
>
>> I've been messing around with jME3 as well, and at some point I might
>> release a library for it.
>>
>> One of the problems with jME3 is that its deployment mechanism hasn't
>> quite caught up with the current century. I'm planning on packaging it up
>> eventually, but in the meantime here's the ugly, dirty, terrible hack I've
>> been using:
>>
>> 1. Download the binaries:
>> http://www.jmonkeyengine.com/nightly/jME3_2013-04-29.zip
>> 2. Create a new directory and extract the zip file into it
>> 3. Create a new Leiningen project
>> 4. Add the following to your project.clj file: :resource-paths ["lib/*"]
>> 5. Copy the lib directory from the jME3 binaries into your project
>> directory
>>
>> Here's an example application to get you going:
>>
>> https://gist.github.com/weavejester/5484183
>>
>> - James
>>
>>
>> On 29 April 2013 20:02, Alex Fowler  wrote:
>>
>>> Hello! I have a problem, I will try to explain.. I want to write a game
>>> with Clojure and JMonkeyEngine (http://jmonkeyengine.com/). So I take
>>> their latest nightie set of jars (http://jmonkeyengine.com/nightly/)
>>> and what? I can't make use of them in my CCW/Leiningen project no
>>> matter how hard I try. So ok, I have found some examples where people get
>>> them in the "lib" folder and it works, or where they recommend pushing them
>>> to the local maven repo... but they do not tell how they do it, or they
>>> show it for some very simple cases. Sure, there is a lot of instructions
>>> like "use mvn install:install-file " or "lein
>>> localrepo install "... so do I have to do it for all
>>> the 30 (thirty) jar files? Considering too, that I have to invent an
>>> "artifactId" for every one of them, invent a "version number", type all
>>> that in manually. And that is not my library, I do not want to invent that.
>>> And even, if I do that, then, how do I specify that all them are
>>> interdependant (are parts of one thing) and have to be always drawn in
>>> together? I will have to specify the 30 dependencies in my project.clj each
>>> time? Well, and even if I do, then I will still have that pain with
>>> manually copying all that stuff on each new machine where I work, picking
>>> it from the local maven repo and putting it to another maven repo. And
>>> if I want to push it to Clojars, I have do that for each one manually too,
>>> typing in commands in the Windows cmd and taking care for inventing version
>>> numbers?... oh, and maybe I could go about specifying  clauses
>>> in a pom? pinch me am I dreaming a nightmare? :)
>>>
>>> I have tried to do something along these lines... spent about 15 hours
>>> in general and got almost nothing but headache and eyesore... and a feeling
>>> of being extremily stupid for not being able to plug a few jars into a jvm
>>> program (isn't java all just about putting jars together? :) ). I am a
>>> Clojure newb and maybe I am missing somewhat essential.. but in Scala, with
>>> or without SBT, using Scala IDE for Eclipse, I got everything up and
>>> running in about 15 minutes.
>>>
>>> Please, could anyone give me a clear explanation or better, a full
>>> example of plugging in the JME3 into a Clojure project? Shouldn't it be
>>> simple? Thank you in advance, the situation is really disappointing for me
>>> :(
>>>
>>> --
>>> --
>>> 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
>> cl

Understanding unmatched parenthesis in read-string

2013-04-29 Thread noahlz
(Disclaimer: I post this aware that read-string is considered dangerous for 
untrusted code and having starred tools.reader)

I was writing some code using read-string and encountered the following 
(somewhat odd?) behavior:

Clojure 1.5.1
user=> (read-string "1000N(")
1000N
user=> (read-string "1000N)")
1000N
user=> (read-string "(1000N")
RuntimeException EOF while reading  clojure.lang.Util.runtimeException 
(Util.java:219)

user=> (read-string ")1000N")
RuntimeException Unmatched delimiter: )  clojure.lang.Util.runtimeException 
(Util.java:219)


So if the string ends with an unmatched ) or (, the preceding value gets 
returned and the unmatched character discarded. But if the string starts 
with an unmatched parens - EOF (as expected). I was a little surprised as I 
expected the first to cases to throw some kind of RuntimeException.

What is the explanation for this behavior if any, and where can I go / read 
more about the underlying theory of "correctly" handling this case? I'm 
aware that lexical parsing is a big topic - just wondering what the ruling 
was here (if any) and looking for a jumping off point into further 
readings. Also if this was discussed elsewhere (searching "read-string 
unmatched paren" yielded nothing).

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: Understanding unmatched parenthesis in read-string

2013-04-29 Thread Weber, Martin S
user=> (doc read-string)
-
clojure.core/read-string
([s])
  Reads *one* object from the string s
nil
(emphasis on *one* by me)

one object from ":a(" = :a; ":a)" = :a; "( … " = fail; ")…" = fail. (remember 
whitespace in front of a paren doesn't matter)

Have fun.

From: noahlz mailto:nzuc...@gmail.com>>
Reply-To: Clojure mailto:clojure@googlegroups.com>>
Date: Monday, April 29, 2013 16:26
To: Clojure mailto:clojure@googlegroups.com>>
Subject: Understanding unmatched parenthesis in read-string

(Disclaimer: I post this aware that read-string is considered dangerous for 
untrusted code and having starred tools.reader)

I was writing some code using read-string and encountered the following 
(somewhat odd?) behavior:

Clojure 1.5.1
user=> (read-string "1000N(")
1000N
user=> (read-string "1000N)")
1000N
user=> (read-string "(1000N")
RuntimeException EOF while reading  clojure.lang.Util.runtimeException 
(Util.java:219)

user=> (read-string ")1000N")
RuntimeException Unmatched delimiter: )  clojure.lang.Util.runtimeException 
(Util.java:219)


So if the string ends with an unmatched ) or (, the preceding value gets 
returned and the unmatched character discarded. But if the string starts with 
an unmatched parens - EOF (as expected). I was a little surprised as I expected 
the first to cases to throw some kind of RuntimeException.

What is the explanation for this behavior if any, and where can I go / read 
more about the underlying theory of "correctly" handling this case? I'm aware 
that lexical parsing is a big topic - just wondering what the ruling was here 
(if any) and looking for a jumping off point into further readings. Also if 
this was discussed elsewhere (searching "read-string unmatched paren" yielded 
nothing).

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.


-- 
-- 
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: Now *there*'s a machine made for Clojure.

2013-04-29 Thread Jonathan Fischer Friberg
On Mon, Apr 29, 2013 at 5:25 PM, Konrad Hinsen <
googlegro...@khinsen.fastmail.net> wrote:

> --On 29 avril 2013 09:09:27 -0400 Lee Spector 
> wrote:
>
>  On Apr 29, 2013, at 9:01 AM, Jonathan Fischer Friberg wrote:
>>
>>  You could always give 
>> https://github.com/halgari/**clojure-pya
>>  spin,
>>> might not be so easy to get everything working though. :)
>>>
>>
>> It might be worth it, if we could still write in Clojure and get good
>> multicore utilization and good performance overall for our application.
>>
>> Is there evidence that code written/run this way will perform
>> particularly well?
>>
>
> No. The Python VM has a global interpreter lock that prevents parallel
> execution of Python bytecode. If you want to parallel processing in Python
> (more precisely, the CPython implementation), you must either port
> CPU-intensive stuff to C or Cython, or run multiple communicating CPython
> instances.
>
> Konrad.


clojure-py code should run on pypy, which is much more promising;
http://pypy.org/
The support for http://www.stackless.com/ is especially interesting.

Jonathan

-- 
-- 
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: Understanding unmatched parenthesis in read-string

2013-04-29 Thread noahlz
Understood, but what I was wondering is why the trailing parenthesis is 
discarded / not considered part of the "object" expression?

On Monday, April 29, 2013 4:32:49 PM UTC-4, Weber, Martin S wrote:
>
>
> user=> (doc read-string)
> -
> clojure.core/read-string
> ([s])
>   Reads *one* object from the string s
> nil
> (emphasis on *one* by me)
>
> one object from ":a(" = :a; ":a)" = :a; "( … " = fail; ")…" = fail. 
> (remember whitespace in front of a paren doesn't matter)
>
> Have fun.
>

-- 
-- 
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: Understanding unmatched parenthesis in read-string

2013-04-29 Thread Ben Wolfson
Because "1000N" is a complete expression, as you can verify with your REPL.


On Mon, Apr 29, 2013 at 1:43 PM, noahlz  wrote:

> Understood, but what I was wondering is why the trailing parenthesis is
> discarded / not considered part of the "object" expression?
>
>
> On Monday, April 29, 2013 4:32:49 PM UTC-4, Weber, Martin S wrote:
>>
>>
>> user=> (doc read-string)
>> -
>> clojure.core/read-string
>> ([s])
>>   Reads *one* object from the string s
>> nil
>> (emphasis on *one* by me)
>>
>> one object from ":a(" = :a; ":a)" = :a; "( … " = fail; ")…" = fail.
>> (remember whitespace in front of a paren doesn't matter)
>>
>> Have fun.
>>
>  --
> --
> 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.
>
>
>



-- 
Ben Wolfson
"Human kind has used its intelligence to vary the flavour of drinks, which
may be sweet, aromatic, fermented or spirit-based. ... Family and social
life also offer numerous other occasions to consume drinks for pleasure."
[Larousse, "Drink" entry]

-- 
-- 
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: Now *there*'s a machine made for Clojure.

2013-04-29 Thread Timothy Baldridge
But as Konrad pointed out, the python VM (and the pypy vm) offers nothing
that JVMs don't support better. Everything from concurrency to the GC is
implemented better in the JVM.

Timothy


On Mon, Apr 29, 2013 at 2:41 PM, Jonathan Fischer Friberg <
odysso...@gmail.com> wrote:

> On Mon, Apr 29, 2013 at 5:25 PM, Konrad Hinsen <
> googlegro...@khinsen.fastmail.net> wrote:
>
>> --On 29 avril 2013 09:09:27 -0400 Lee Spector 
>> wrote:
>>
>>  On Apr 29, 2013, at 9:01 AM, Jonathan Fischer Friberg wrote:
>>>
>>>  You could always give 
>>> https://github.com/halgari/**clojure-pya
>>>  spin,
 might not be so easy to get everything working though. :)

>>>
>>> It might be worth it, if we could still write in Clojure and get good
>>> multicore utilization and good performance overall for our application.
>>>
>>> Is there evidence that code written/run this way will perform
>>> particularly well?
>>>
>>
>> No. The Python VM has a global interpreter lock that prevents parallel
>> execution of Python bytecode. If you want to parallel processing in Python
>> (more precisely, the CPython implementation), you must either port
>> CPU-intensive stuff to C or Cython, or run multiple communicating CPython
>> instances.
>>
>> Konrad.
>
>
> clojure-py code should run on pypy, which is much more promising;
> http://pypy.org/
> The support for http://www.stackless.com/ is especially interesting.
>
> Jonathan
>
> --
> --
> 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.
>
>
>



-- 
“One of the main causes of the fall of the Roman Empire was that–lacking
zero–they had no way to indicate successful termination of their C
programs.”
(Robert Firth)

-- 
-- 
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: Now *there*'s a machine made for Clojure.

2013-04-29 Thread Jonathan Fischer Friberg
Reading about this, yes, but there is hope:

http://morepypy.blogspot.se/2012/08/multicore-programming-in-pypy-and.html

Jonathan


On Mon, Apr 29, 2013 at 10:45 PM, Timothy Baldridge wrote:

> But as Konrad pointed out, the python VM (and the pypy vm) offers nothing
> that JVMs don't support better. Everything from concurrency to the GC is
> implemented better in the JVM.
>
> Timothy
>
>
> On Mon, Apr 29, 2013 at 2:41 PM, Jonathan Fischer Friberg <
> odysso...@gmail.com> wrote:
>
>> On Mon, Apr 29, 2013 at 5:25 PM, Konrad Hinsen <
>> googlegro...@khinsen.fastmail.net> wrote:
>>
>>> --On 29 avril 2013 09:09:27 -0400 Lee Spector 
>>> wrote:
>>>
>>>  On Apr 29, 2013, at 9:01 AM, Jonathan Fischer Friberg wrote:

  You could always give 
 https://github.com/halgari/**clojure-pya
  spin,
> might not be so easy to get everything working though. :)
>

 It might be worth it, if we could still write in Clojure and get good
 multicore utilization and good performance overall for our application.

 Is there evidence that code written/run this way will perform
 particularly well?

>>>
>>> No. The Python VM has a global interpreter lock that prevents parallel
>>> execution of Python bytecode. If you want to parallel processing in Python
>>> (more precisely, the CPython implementation), you must either port
>>> CPU-intensive stuff to C or Cython, or run multiple communicating CPython
>>> instances.
>>>
>>> Konrad.
>>
>>
>> clojure-py code should run on pypy, which is much more promising;
>> http://pypy.org/
>> The support for http://www.stackless.com/ is especially interesting.
>>
>> Jonathan
>>
>> --
>> --
>> 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.
>>
>>
>>
>
>
>
> --
> “One of the main causes of the fall of the Roman Empire was that–lacking
> zero–they had no way to indicate successful termination of their C
> programs.”
> (Robert Firth)
>
> --
> --
> 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: Understanding unmatched parenthesis in read-string

2013-04-29 Thread noahlz
Ok. The parser reads a single complete expression and discards the rest. It 
understands that once it has hit a new character that represents the 
beginning of a new expression, it doesn't care.

I suppose I thought the parser would raise an error on detecting an 
unmatched parenthesis, but that's wrong.

Interestingly, when I try this at the repl (1.5.1) it errors as I expected 
(probably why I expected it in the first place):

user=> 1000N)
1000N
RuntimeException Unmatched delimiter: )  clojure.lang.Util.runtimeException 
(Util.java:219)


Of course, the repl doesn't use "read-string." So, the next step in my 
journey is to investigate the source of clojure.main. But - someone wants 
to take the opportunity to ruin the surprise for me - with a more detailed 
explanation / theory discussion - I'm open to it :) 


On Monday, April 29, 2013 4:44:13 PM UTC-4, Ben wrote:
>
> Because "1000N" is a complete expression, as you can verify with your REPL.
>
>
> On Mon, Apr 29, 2013 at 1:43 PM, noahlz >wrote:
>
>> Understood, but what I was wondering is why the trailing parenthesis is 
>> discarded / not considered part of the "object" expression?
>>
>>
>> On Monday, April 29, 2013 4:32:49 PM UTC-4, Weber, Martin S wrote:
>>>
>>>
>>> user=> (doc read-string)
>>> -
>>> clojure.core/read-string
>>> ([s])
>>>   Reads *one* object from the string s
>>> nil
>>> (emphasis on *one* by me)
>>>
>>> one object from ":a(" = :a; ":a)" = :a; "( … " = fail; ")…" = fail. 
>>> (remember whitespace in front of a paren doesn't matter)
>>>
>>> Have fun.
>>>
>>  -- 
>> -- 
>> 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.
>>  
>>  
>>
>
>
>
> -- 
> Ben Wolfson
> "Human kind has used its intelligence to vary the flavour of drinks, which 
> may be sweet, aromatic, fermented or spirit-based. ... Family and social 
> life also offer numerous other occasions to consume drinks for pleasure." 
> [Larousse, "Drink" entry]
>
> 

-- 
-- 
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: Using a Java game engine in my project

2013-04-29 Thread AtKaaZ
that seems unsafe.

I'd rather use a nightly zip or what I am currently using, jme3 engine as
project in eclipse and when needed ant build it and have my project always
refer to the lib folder in the dist ie. I've these 2 lines in my project:

  :bootclasspath false;false is needed here for JME3 specified in
:resource-paths below; else it will fail with ClassNotFoundException
com.jme3.app.SimpleApplication  java.net.URLClassLoader$1.run
(URLClassLoader.java:366)

  :resource-paths ["resources", "../jme3_engine/dist/lib/*"] ;needs eclipse
project present: jme3_engine from trunk/engine ie.
https://code.google.com/p/jmonkeyengine/source/browse/#svn%2Ftrunk%2Fengine
and make sure you ant build it once to create and populate dist/lib/ folder

works fine for me in eclipse/ccw

btw, maybe you(Jonathan) and James could focus your efforts and release one
clojure jme3 library instead of two (eventually), or not...  just a
thought. It would seem like a waste if there will be two. (like hermes and
titanium people are focusing only on titanium now)

It'd be really cool to have a clojure 3D lib based on jme3



On Mon, Apr 29, 2013 at 11:21 PM, Jonathan Fischer Friberg <
odysso...@gmail.com> wrote:

> I'm currently making a library for jmonkeyengine. It's not
> ready yet, however, a while back I decided to put jme in a repository.
>
> Url: "http://jmonkeyengine.s3-website-eu-west-1.amazonaws.com/";
> Add to deps: [jme "2013-04-01"]
>
> The biggest problem with it right now is that it contains all test models
> and textures, which I didn't realise at the time (this accounts for more
> than half of the size). But it's quick & easy if you want to give it a go.
>
> Jonathan
>
>
>
> On Mon, Apr 29, 2013 at 9:56 PM, AtKaaZ  wrote:
>
>> That's awesome!  Thanks James!
>>
>>
>> On Mon, Apr 29, 2013 at 10:46 PM, James Reeves wrote:
>>
>>> I've been messing around with jME3 as well, and at some point I might
>>> release a library for it.
>>>
>>> One of the problems with jME3 is that its deployment mechanism hasn't
>>> quite caught up with the current century. I'm planning on packaging it up
>>> eventually, but in the meantime here's the ugly, dirty, terrible hack I've
>>> been using:
>>>
>>> 1. Download the binaries:
>>> http://www.jmonkeyengine.com/nightly/jME3_2013-04-29.zip
>>> 2. Create a new directory and extract the zip file into it
>>> 3. Create a new Leiningen project
>>> 4. Add the following to your project.clj file: :resource-paths ["lib/*"]
>>> 5. Copy the lib directory from the jME3 binaries into your project
>>> directory
>>>
>>> Here's an example application to get you going:
>>>
>>> https://gist.github.com/weavejester/5484183
>>>
>>> - James
>>>
>>>
>>> On 29 April 2013 20:02, Alex Fowler  wrote:
>>>
 Hello! I have a problem, I will try to explain.. I want to write a game
 with Clojure and JMonkeyEngine (http://jmonkeyengine.com/). So I take
 their latest nightie set of jars (http://jmonkeyengine.com/nightly/)
 and what? I can't make use of them in my CCW/Leiningen project no
 matter how hard I try. So ok, I have found some examples where people get
 them in the "lib" folder and it works, or where they recommend pushing them
 to the local maven repo... but they do not tell how they do it, or they
 show it for some very simple cases. Sure, there is a lot of instructions
 like "use mvn install:install-file " or "lein
 localrepo install "... so do I have to do it for all
 the 30 (thirty) jar files? Considering too, that I have to invent an
 "artifactId" for every one of them, invent a "version number", type all
 that in manually. And that is not my library, I do not want to invent that.
 And even, if I do that, then, how do I specify that all them are
 interdependant (are parts of one thing) and have to be always drawn in
 together? I will have to specify the 30 dependencies in my project.clj each
 time? Well, and even if I do, then I will still have that pain with
 manually copying all that stuff on each new machine where I work, picking
 it from the local maven repo and putting it to another maven repo. And
 if I want to push it to Clojars, I have do that for each one manually too,
 typing in commands in the Windows cmd and taking care for inventing version
 numbers?... oh, and maybe I could go about specifying  clauses
 in a pom? pinch me am I dreaming a nightmare? :)

 I have tried to do something along these lines... spent about 15 hours
 in general and got almost nothing but headache and eyesore... and a feeling
 of being extremily stupid for not being able to plug a few jars into a jvm
 program (isn't java all just about putting jars together? :) ). I am a
 Clojure newb and maybe I am missing somewhat essential.. but in Scala, with
 or without SBT, using Scala IDE for Eclipse, I got everything up and
 running in about 15 minutes.

 Please, could anyone give me a clear explan

Re: Understanding unmatched parenthesis in read-string

2013-04-29 Thread Ben Wolfson
On Mon, Apr 29, 2013 at 1:57 PM, noahlz  wrote:

> Ok. The parser reads a single complete expression and discards the rest.
> It understands that once it has hit a new character that represents the
> beginning of a new expression, it doesn't care.
>
> I suppose I thought the parser would raise an error on detecting an
> unmatched parenthesis, but that's wrong.
>
> Interestingly, when I try this at the repl (1.5.1) it errors as I expected
> (probably why I expected it in the first place):
>
> user=> 1000N)
> 1000N
>
> RuntimeException Unmatched delimiter: )
> clojure.lang.Util.runtimeException (Util.java:219)
>
>
> Of course, the repl doesn't use "read-string." So, the next step in my
> journey is to investigate the source of clojure.main. But - someone wants
> to take the opportunity to ruin the surprise for me - with a more detailed
> explanation / theory discussion - I'm open to it :)
>

But notice that this *also* returns 1000N, first. So the cases aren't that
different: it managed to read a complete expression, and evaluated it. Then
it tried to read *another* expression from the unconsumed input. The
difference is only that read-string doesn't attempt to exhaust its input
argument.

-- 
Ben Wolfson
"Human kind has used its intelligence to vary the flavour of drinks, which
may be sweet, aromatic, fermented or spirit-based. ... Family and social
life also offer numerous other occasions to consume drinks for pleasure."
[Larousse, "Drink" entry]

-- 
-- 
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: login with friend, but username blank, despite keyword-params middleware in place

2013-04-29 Thread Chas Emerick
There's too much here for me to comb through.  A couple of things:

https://friend-demo.herokuapp.com/interactive-form is a complete demo 
application that uses Friend's interactive-form workflow.  You might have seen 
this already; if not, it's a good starting point.

Second, try adding a verbose logging middleware to your -> form, e.g.

(defn wrap-verbose
  [h]
  (fn [req]
(println "" req)
(h req))

(-> ...
wrap-verbose)

You can move that wrap-verbose application around in your "stack" to see the 
state of the request map at different points.

Hope that helps,

- Chas

-- 
-- 
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] Alembic, a library for adding dependencies to your REPL classpath

2013-04-29 Thread Hugo Duncan

Alembic [1] is a library for adding dependencies to your REPL classpath.

It adds minimal dependencies to your project, while still allowing
resolving of dependencies from clojars, etc.  It builds on top of lein,
pomegranate and classlojure.

It records added dependencies, so you can query them for adding to
project.clj.

Alembic will warn if transitive dependencies have conflicting versions.

A blog post on alembic gives some more details [2]

Hugo

[1] https://github.com/pallet/alembic
[2] http://palletops.com/alembic-clojure-classpath-control/

-- 
-- 
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/script web framework?

2013-04-29 Thread serialhex
hi all, i've been looking into doing a project i have in mind in clojure &
clojurescript, and i'm having trouble finding a decent framework to
bootstrap me.  i'm fairly new to clojure but i really want to get my feet
wet.  i looked at pedestal but there aren't any good tutorials (yet).  i've
heard about & looked at noir but also read that it's not updated anymore...
 so, any suggestions?

justin

snt frum my awesum ansroid... txt mite b rong

-- 
-- 
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: Understanding unmatched parenthesis in read-string

2013-04-29 Thread Cedric Greevey
On Mon, Apr 29, 2013 at 5:02 PM, Ben Wolfson  wrote:

> On Mon, Apr 29, 2013 at 1:57 PM, noahlz  wrote:
>
>> Ok. The parser reads a single complete expression and discards the rest.
>> It understands that once it has hit a new character that represents the
>> beginning of a new expression, it doesn't care.
>>
>> I suppose I thought the parser would raise an error on detecting an
>> unmatched parenthesis, but that's wrong.
>>
>> Interestingly, when I try this at the repl (1.5.1) it errors as I
>> expected (probably why I expected it in the first place):
>>
>> user=> 1000N)
>> 1000N
>>
>> RuntimeException Unmatched delimiter: )
>> clojure.lang.Util.runtimeException (Util.java:219)
>>
>>
>> Of course, the repl doesn't use "read-string." So, the next step in my
>> journey is to investigate the source of clojure.main. But - someone wants
>> to take the opportunity to ruin the surprise for me - with a more detailed
>> explanation / theory discussion - I'm open to it :)
>>
>
> But notice that this *also* returns 1000N, first. So the cases aren't that
> different: it managed to read a complete expression, and evaluated it. Then
> it tried to read *another* expression from the unconsumed input. The
> difference is only that read-string doesn't attempt to exhaust its input
> argument.
>

If you want to exhaust read-string's input argument, getting back a vector
of all of the objects in the input and an error if any of them are
syntactically invalid, just call (read-string (str "[" in-string "]")).
This also deals with empty inputs in a non-blowing-up manner, returning an
empty vector, which might allow uniform handling of the cases (empty?
in-string) and (not (empty? in-string)) in some instances.

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




a tutorial for working at the repl?

2013-04-29 Thread larry google groups

I am no longer a total beginner at Clojure, but I find I still get badly 
confused by some issues at the repl (namesspaces, classpath, dependencies, 
etc). Can anyone point me to a good tutorial about working at the repl? 




-- 
-- 
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/script web framework?

2013-04-29 Thread Mimmo Cosenza
Hi Justin,
perhaps you could find some help in https://github.com/magomimmo/modern-cljs.

I still have to complete few more tutorials covering enlive, enfocus, 
clojusrescript testing and friend, but it already covers a lot, I think, to 
become productive with clj-cljs. 

It's not a framework. To me a framework is a kind of balck-box and libs are a 
kind of white-box. But I know that coming from other languages/frameworks this 
approach seems less productive. But if you want to have more control on your 
app, it rewards. 

HIH

Mimmo


On Apr 29, 2013, at 4:35 PM, serialhex  wrote:

> hi all, i've been looking into doing a project i have in mind in clojure & 
> clojurescript, and i'm having trouble finding a decent framework to bootstrap 
> me.  i'm fairly new to clojure but i really want to get my feet wet.  i 
> looked at pedestal but there aren't any good tutorials (yet).  i've heard 
> about & looked at noir but also read that it's not updated anymore...  so, 
> any suggestions?
> 
> justin
> 
> snt frum my awesum ansroid... txt mite b rong
> 
> 
> -- 
> -- 
> 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: Understanding unmatched parenthesis in read-string

2013-04-29 Thread noahlz


On Monday, April 29, 2013 6:07:01 PM UTC-4, Cedric Greevey wrote:
>
>
> If you want to exhaust read-string's input argument, getting back a vector 
> of all of the objects in the input and an error if any of them are 
> syntactically invalid, just call (read-string (str "[" in-string "]")). 
> This also deals with empty inputs in a non-blowing-up manner, returning an 
> empty vector, which might allow uniform handling of the cases (empty? 
> in-string) and (not (empty? in-string)) in some instances.
>
>
Interestingly, my code already contains something like the following:

(let [expr (-> (str "(" input ")") read-string)] ...)

It felt wrong when I wrote this, but it seems like I was in the right 
track? I'm guessing vectors are safer than lists for passing to eval?

 

-- 
-- 
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: Understanding unmatched parenthesis in read-string

2013-04-29 Thread Ben Wolfson
On Mon, Apr 29, 2013 at 3:21 PM, noahlz  wrote:

>  I'm guessing vectors are safer than lists for passing to eval?
>

They're equally unsafe.

-- 
Ben Wolfson
"Human kind has used its intelligence to vary the flavour of drinks, which
may be sweet, aromatic, fermented or spirit-based. ... Family and social
life also offer numerous other occasions to consume drinks for pleasure."
[Larousse, "Drink" entry]

-- 
-- 
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: a tutorial for working at the repl?

2013-04-29 Thread noahlz


On Monday, April 29, 2013 6:07:34 PM UTC-4, larry google groups wrote:
>
>
> I am no longer a total beginner at Clojure, but I find I still get badly 
> confused by some issues at the repl (namesspaces, classpath, dependencies, 
> etc). Can anyone point me to a good tutorial about working at the repl? 
>
>
Leiningen is terrific for streamlining this process. 

http://jrheard.tumblr.com/post/40024238467/getting-started-with-clojure

Perhaps the biggest gotcha for me namespaces in the REPL was understanding 
(in-ns) vs (ns) and (require) vs (use).  


-- 
-- 
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: Now *there*'s a machine made for Clojure.

2013-04-29 Thread Colin Fleming
I guess you could go for a middle ground where you run a JVM instance per 8
cores or so, which would minimise your intercommunication but still reduce
your GC contention. Of course as soon as (> num-jvms 1) you have to write
all the communication and deployment code anyway so it might not be a big
win, but if you decide to go that way it would probably be more efficient
and minimise your JVM memory overhead.

Cheers,
Colin


On 30 April 2013 03:50, Lee Spector  wrote:

>
>
> On Apr 29, 2013, at 11:25 AM, Konrad Hinsen wrote:
> >> Is there evidence that code written/run this way will perform
> >> particularly well?
> >
> > No. The Python VM has a global interpreter lock that prevents parallel
> execution of Python bytecode. If you want to parallel processing in Python
> (more precisely, the CPython implementation), you must either port
> CPU-intensive stuff to C or Cython, or run multiple communicating CPython
> instances.
>
> Ah. Well we could do that in Clojure without dealing with Python, and our
> tests show that we'd get the multicore speedups that we want. But I'm not
> eager to re-engineer everything to launch and use and deal with multiple
> JVM instances and the necessary intercommunication. I'd like to use the
> built-in Clojure concurrency support, which is elegant but isn't giving us
> reasonable multicore utilization.
>
> Thanks,
>
>  -Lee
>
> --
> --
> 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: [ANN] Grojure, a Java/C# syntax atop Clojure using Kern

2013-04-29 Thread Gavin Grover
Armando, I intend to keep Grojure as single-pass, unlike what you did with 
Eisen, so people can easily see a matchup between the Kern combinators and 
the Clojure macros when looking at the source. I still need to reduce the 
(at times) exponential backtracking a lot so Grojure will become a more 
performant showcase for Kern over time. I haven't found any bugs in Kern so 
congratulations on that one.

On Tuesday, April 30, 2013 1:42:06 AM UTC+8, Armando Blancas wrote:
>
> Nice work, Gavin. Grojure is a good example why Clojure is an excellent 
> UNCOL for the JVM, so some of us will depend less on the ASM lib. Your 
> parser illustrates how to use grammar actions for writing a very compact 
> one-pass translator; pretty cool.
>
> On Sunday, April 28, 2013 9:41:00 PM UTC-7, Gavin Grover wrote:
>>
>> Grojure is a Java/C#/Groovy-like syntax atop Clojure using the Kern 
>> parser combinator library. It's also of interest as an example grammar for 
>> those using Kern to build their own grammars.
>>
>> Available from https://github.com/gavingroovygrover/grojure
>>
>> Gavin "Groovy" Grover
>>
>>

-- 
-- 
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: testing for nil may not be enough

2013-04-29 Thread John D. Hume
On Apr 29, 2013 1:07 PM, "Jonathan Fischer Friberg" 
wrote:
>
> If you don't want to set the initial value to nil, set it to ::unbound or
similar. Should be very
> hard to accidentally bind the same value.

Please take Jonathan's advice if nil is a valid value for a user to bind;
use nil as the initial value if it's not.

It is non-idiomatic to leave the var unbound for exactly the reason you're
running into: unbound vars are annoying to deal with.

-- 
-- 
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/script web framework?

2013-04-29 Thread Erlis Vidal
I've been playing with http://clojurescriptone.com/ and I like it a lot.

here you have a direct link to the wiki page
https://github.com/brentonashworth/one/wiki


On Mon, Apr 29, 2013 at 6:15 PM, Mimmo Cosenza wrote:

> Hi Justin,
> perhaps you could find some help in
> https://github.com/magomimmo/modern-cljs.
>
> I still have to complete few more tutorials covering enlive, enfocus,
> clojusrescript testing and friend, but it already covers a lot, I think, to
> become productive with clj-cljs.
>
> It's not a framework. To me a framework is a kind of balck-box and libs
> are a kind of white-box. But I know that coming from other
> languages/frameworks this approach seems less productive. But if you want
> to have more control on your app, it rewards.
>
> HIH
>
> Mimmo
>
>
> On Apr 29, 2013, at 4:35 PM, serialhex  wrote:
>
> hi all, i've been looking into doing a project i have in mind in clojure &
> clojurescript, and i'm having trouble finding a decent framework to
> bootstrap me.  i'm fairly new to clojure but i really want to get my feet
> wet.  i looked at pedestal but there aren't any good tutorials (yet).  i've
> heard about & looked at noir but also read that it's not updated anymore...
>  so, any suggestions?
>
> justin
>
> snt frum my awesum ansroid... txt mite b rong
>
> --
> --
> 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
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: login with friend, but username blank, despite keyword-params middleware in place

2013-04-29 Thread Nelson Morris
The part of the middleware stack that looks like:

(-> 
  (wrap-params)
  (wrap-nested-params)
  (wrap-keyword-params))

is in the wrong order.  It needs to be

(-> 

  (wrap-keyword-params)
  (wrap-nested-params)
  (wrap-params))

The response having

 :params {"" nil, "login_failed" "Y", "username" ""},

indicates that they are not being changed to keywords.  Since friend's
interactive-form workflow uses keywords to pull out the params,
it doesn't match and is constantly failing.

-
Nelson Morris



On Mon, Apr 29, 2013 at 4:20 PM, Chas Emerick  wrote:

> There's too much here for me to comb through.  A couple of things:
>
> https://friend-demo.herokuapp.com/interactive-form is a complete demo
> application that uses Friend's interactive-form workflow.  You might have
> seen this already; if not, it's a good starting point.
>
> Second, try adding a verbose logging middleware to your -> form, e.g.
>
> (defn wrap-verbose
>   [h]
>   (fn [req]
> (println "" req)
> (h req))
>
> (-> ...
> wrap-verbose)
>
> You can move that wrap-verbose application around in your "stack" to see
> the state of the request map at different points.
>
> Hope that helps,
>
> - Chas
>
> --
> --
> 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: [ANN] Grojure, a Java/C# syntax atop Clojure using Kern

2013-04-29 Thread Armando Blancas
Thanks; glad to know the lib's working well. It'll be interesting to see 
how Clojure semantics like immutability, closures, and programming with 
values start to take hold in more languages and tools.

On Monday, April 29, 2013 3:57:04 PM UTC-7, Gavin Grover wrote:
>
> Armando, I intend to keep Grojure as single-pass, unlike what you did with 
> Eisen, so people can easily see a matchup between the Kern combinators and 
> the Clojure macros when looking at the source. I still need to reduce the 
> (at times) exponential backtracking a lot so Grojure will become a more 
> performant showcase for Kern over time. I haven't found any bugs in Kern so 
> congratulations on that one.
>
> On Tuesday, April 30, 2013 1:42:06 AM UTC+8, Armando Blancas wrote:
>>
>> Nice work, Gavin. Grojure is a good example why Clojure is an excellent 
>> UNCOL for the JVM, so some of us will depend less on the ASM lib. Your 
>> parser illustrates how to use grammar actions for writing a very compact 
>> one-pass translator; pretty cool.
>>
>> On Sunday, April 28, 2013 9:41:00 PM UTC-7, Gavin Grover wrote:
>>>
>>> Grojure is a Java/C#/Groovy-like syntax atop Clojure using the Kern 
>>> parser combinator library. It's also of interest as an example grammar for 
>>> those using Kern to build their own grammars.
>>>
>>> Available from https://github.com/gavingroovygrover/grojure
>>>
>>> Gavin "Groovy" Grover
>>>
>>>

-- 
-- 
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/script web framework?

2013-04-29 Thread Murtaza Husain

webfui is another framework you can look at. I have a sample using it at 
github.com/murtaza52/mashup

pedestal.io is another shiny new framework, which has a solid backing and 
is very promising.  


On Tuesday, April 30, 2013 6:02:59 AM UTC+5:30, Erlis Vidal wrote:
>
> I've been playing with http://clojurescriptone.com/ and I like it a lot. 
>
> here you have a direct link to the wiki page 
> https://github.com/brentonashworth/one/wiki
>
>
> On Mon, Apr 29, 2013 at 6:15 PM, Mimmo Cosenza 
> 
> > wrote:
>
>> Hi Justin,
>> perhaps you could find some help in 
>> https://github.com/magomimmo/modern-cljs.
>>
>> I still have to complete few more tutorials covering enlive, enfocus, 
>> clojusrescript testing and friend, but it already covers a lot, I think, to 
>> become productive with clj-cljs. 
>>
>>  It's not a framework. To me a framework is a kind of balck-box and libs 
>> are a kind of white-box. But I know that coming from other 
>> languages/frameworks this approach seems less productive. But if you want 
>> to have more control on your app, it rewards. 
>>
>> HIH
>>
>> Mimmo
>>
>>
>> On Apr 29, 2013, at 4:35 PM, serialhex > 
>> wrote:
>>
>> hi all, i've been looking into doing a project i have in mind in clojure 
>> & clojurescript, and i'm having trouble finding a decent framework to 
>> bootstrap me.  i'm fairly new to clojure but i really want to get my feet 
>> wet.  i looked at pedestal but there aren't any good tutorials (yet).  i've 
>> heard about & looked at noir but also read that it's not updated anymore... 
>>  so, any suggestions?
>>
>> justin
>>
>> snt frum my awesum ansroid... txt mite b rong
>>
>> -- 
>> -- 
>> 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 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: Now *there*'s a machine made for Clojure.

2013-04-29 Thread Konrad Hinsen
--On 29 avril 2013 22:54:12 +0200 Jonathan Fischer Friberg 
 wrote:



Reading about this, yes, but there is hope:

http://morepypy.blogspot.se/2012/08/multicore-programming-in-pypy-and.html


Indeed, Pypy may become a good solution for multicore parallelism in 
Python. However,


1) We are not there yet.

2) You lose compatibility with all the Python packages that contain 
extension modules, which means 90% of the Python packages I care about.


Once we get to 1), a solution to 2) may follow, so I don't want to be 
overly pessimistic. But at best it's going to take a lot of time.


Konrad.

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