Re: WAT? BigInt instead of Long?

2013-04-01 Thread Alf Kristian Støyle
Reading the source, Ratios are actually represented as
java.math.BigIntegerobjects. (
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang
/Ratio.java)

Asking for denominator and numerator returns these values directly.
user=> (class (denominator (/ 1 2)))
java.math.BigInteger
user=> (class (numerator (/ 1 2)))
java.math.BigInteger

Following the source, conversion happens in the Numbers.divide(BigInteger,
BigInteger) method:
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang
/Numbers.java#L342
(called from https://github.com/clojure/clojure/blob/master/src/jvm/clojure/
lang/Numbers.java#L670)

Cheers,
Alf



On 1 April 2013 23:57, Alan Thompson  wrote:

> Just read about this in "Clojure Programming" (Emerick) p428:
>  clojure.lang.BigInt is different than java.lang.BigInteger, in that BigInt
> uses 64-bit primitive longs under the covers to keep performance up if the
> value will fit within the range of a long.  So for "normal" sized values,
> it doesn't have the overhead of the arbitrary-precision type.  But, the
> extra precision is there if you need it later on in a calculation.
>  Alan Thompson
>
>
>
> On Mon, Apr 1, 2013 at 2:43 PM, Gary Verhaegen 
> wrote:
>
>> That's because ratios are intended to get you arbitrary precision.
>> That would not work so well if they used Longs for their numerator and
>> denominator.
>>
>> On 29 March 2013 14:11, Peter Mancini  wrote:
>> > (class 1) java.lang.Long ;check!
>> > (class (* (/ 1 255) 254)) clojure.lang.Ratio ;check!
>> > (class (* (/ 1 255) 255)) clojure.lang.BigInt ;WAT?
>> >
>> > Should not example 3 and example 1 end up the same? (Noob question, I
>> know,
>> > but this didn't make sense to me and I thought I was doing something
>> wrong
>> > when I saw 1N coming back.)
>> >
>
>  --
> --
> 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: Rich Hickey quote on immutability

2013-04-01 Thread Alf Kristian Støyle
Thanks guys. Exactly what I was looking for.

Cheers,
Alf


On 2 April 2013 01:28, Michael Ball  wrote:

> It might be his Clojure/West 2012 presentation on Datomic near the very
> end.
>
> "Choose immutability and see where it takes you."
>
> http://www.infoq.com/presentations/The-Design-of-Datomic
>
>
>
>
>
> On Monday, April 1, 2013 9:33:37 AM UTC-7, Alf wrote:
>>
>> Hey everyone!
>>
>> I am doing presentation on Clojure and immutability, and I am looking
>> for a quote. I think I remember Rich saying something along the lines of:
>>
>> "Try going immutable and see where it takes you".
>>
>> Anyone remember where (or if at all), he said this? And of course, what
>> the exact quote is?
>>
>> Cheers,
>> Alf
>>
>  --
> --
> 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: Attempt at rethrow macro

2013-04-01 Thread Bill Robertson
While it may violate the principle of least surprise (until you 
realize/learn that try/catch is a special form), I don't think it's a bug.

On Monday, April 1, 2013 4:00:31 PM UTC-4, Cedric Greevey wrote:
>
> IMO, the real problem here is try not macroexpanding its body before 
> looking for its catches. IMO that's a bug, and indeed that the rethrow 
> macro doesn't work when the s-expression it expands to would work in its 
> place represents a violation, at least in spirit, of homoiconicity. There 
> are operators that are "special" and can't be supplied via macro. That's 
> wrong.
>  

-- 
-- 
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.java.jdbc turning into a DSL/ORM?

2013-04-01 Thread Sean Corfield
The 0.2.3 API is a strict subset of the 0.2.4 API. Unfortunately the
current autodoc only generates documentation based on master.

On Mon, Apr 1, 2013 at 5:37 PM, smnirven  wrote:
> Does the API documentation for version 0.2.3 exist somewhere? I see the
> auto-generated docs on the github page, but it seems it documents the
> up-coming 0.2.4 version (not currently publicly accessible).
>
>
>
> On Wednesday, March 6, 2013 10:44:54 AM UTC-5, Thomas Heller wrote:
>>
>> Hey,
>>
>> I'm using [clojure/java.jdbc "0.2.3"] and wasn't sure about a function so
>> I looked at the source and noticed that the git master seems to be turning
>> into some sort of DSL/ORM?
>>
>> Just wondering if the intention is to make the DSL the primary way to work
>> with the API or if clojure.java.jdbc.sql will be completely optional?
>>
>> java.jdbc isn't perfect but it gets the job done, but I'm not too fond of
>> DSLs wrapping DSLs (which SQL is IMHO).
>>
>> Just wondering what motivated the massive API changes?
>>
>> Regards,
>> /thomas
>
> --
> --
> 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: Rich Hickey quote on immutability

2013-04-01 Thread Michael Ball
It might be his Clojure/West 2012 presentation on Datomic near the very end.

"Choose immutability and see where it takes you."

http://www.infoq.com/presentations/The-Design-of-Datomic





On Monday, April 1, 2013 9:33:37 AM UTC-7, Alf wrote:
>
> Hey everyone!
>
> I am doing presentation on Clojure and immutability, and I am looking for 
> a quote. I think I remember Rich saying something along the lines of:
>
> "Try going immutable and see where it takes you".
>
> Anyone remember where (or if at all), he said this? And of course, what 
> the exact quote is?
>
> Cheers,
> Alf
>  

-- 
-- 
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.java.jdbc turning into a DSL/ORM?

2013-04-01 Thread smnirven
Does the API documentation for version 0.2.3 exist somewhere? I see the 
auto-generated docs on the github page, but it seems it documents the 
up-coming 0.2.4 version (not currently publicly accessible).



On Wednesday, March 6, 2013 10:44:54 AM UTC-5, Thomas Heller wrote:
>
> Hey,
>
> I'm using [clojure/java.jdbc "0.2.3"] and wasn't sure about a function so 
> I looked at the source and noticed that the git master seems to be turning 
> into some sort of DSL/ORM?
>
> Just wondering if the intention is to make the DSL the primary way to work 
> with the API or if clojure.java.jdbc.sql will be completely optional?
>
> java.jdbc isn't perfect but it gets the job done, but I'm not too fond of 
> DSLs wrapping DSLs (which SQL is IMHO).
>
> Just wondering what motivated the massive API changes?
>
> Regards,
> /thomas
>

-- 
-- 
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] tools.namespace 0.2.3

2013-04-01 Thread Stuart Sierra
Clojure-contrib library "tools.namespace" release 0.2.3 now available in
the Maven Central repository.

In Leiningen:

[org.clojure/tools.namespace "0.2.3"]

On GitHub:

https://github.com/clojure/tools.namespace

Changes in this release:

   * In the event of an error while reloading,
`clojure.tools.namespace.repl/refresh` will attempt to recover the aliases
/ referred symbols in the current REPL namespace. This may make it easier
to debug the error and reload code again.

-- 
-- 
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: Rich Hickey quote on immutability

2013-04-01 Thread Ivan Kozik
On Mon, Apr 1, 2013 at 4:33 PM, Alf Kristian Støyle
 wrote:
> "Try going immutable and see where it takes you".
>
> Anyone remember where (or if at all), he said this? And of course, what the
> exact quote is?

"Choose immutability and see where it takes you"

http://www.infoq.com/presentations/The-Design-of-Datomic 00:54:28

-- 
-- 
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 ClojureWerkz Money 1.0 is released

2013-04-01 Thread Michael Klishin
Money [1] a tiny Clojure library that deals with monetary amounts and
currencies.
It is built on top of Joda Money [2].

Release notes:
http://blog.clojurewerkz.org/blog/2013/04/02/introducing-clojurewerkz-money/

1. https://github.com/clojurewerkz/money/
2. http://joda-money.sourceforge.net/
-- 
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: WAT? BigInt instead of Long?

2013-04-01 Thread Alan Thompson
Just read about this in "Clojure Programming" (Emerick) p428:
 clojure.lang.BigInt is different than java.lang.BigInteger, in that BigInt
uses 64-bit primitive longs under the covers to keep performance up if the
value will fit within the range of a long.  So for "normal" sized values,
it doesn't have the overhead of the arbitrary-precision type.  But, the
extra precision is there if you need it later on in a calculation.
Alan Thompson


On Mon, Apr 1, 2013 at 2:43 PM, Gary Verhaegen wrote:

> That's because ratios are intended to get you arbitrary precision.
> That would not work so well if they used Longs for their numerator and
> denominator.
>
> On 29 March 2013 14:11, Peter Mancini  wrote:
> > (class 1) java.lang.Long ;check!
> > (class (* (/ 1 255) 254)) clojure.lang.Ratio ;check!
> > (class (* (/ 1 255) 255)) clojure.lang.BigInt ;WAT?
> >
> > Should not example 3 and example 1 end up the same? (Noob question, I
> know,
> > but this didn't make sense to me and I thought I was doing something
> wrong
> > when I saw 1N coming back.)
> >

-- 
-- 
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: WAT? BigInt instead of Long?

2013-04-01 Thread Gary Verhaegen
That's because ratios are intended to get you arbitrary precision.
That would not work so well if they used Longs for their numerator and
denominator.

On 29 March 2013 14:11, Peter Mancini  wrote:
> (class 1) java.lang.Long ;check!
> (class (* (/ 1 255) 254)) clojure.lang.Ratio ;check!
> (class (* (/ 1 255) 255)) clojure.lang.BigInt ;WAT?
>
> Should not example 3 and example 1 end up the same? (Noob question, I know,
> but this didn't make sense to me and I thought I was doing something wrong
> when I saw 1N coming back.)
>
> --
> --
> 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: Attempt at rethrow macro

2013-04-01 Thread Ben Wolfson
On Mon, Apr 1, 2013 at 1:32 PM, Alan Malloy  wrote:

> This is how every macro and special form works. I know you like to
> complain, but the alternative is simply not possible: macros have complete
> control of expanding their bodies, and any macros therein are expanded
> later, not before. Try writing a macro system that goes the other way, and
> see how disastrous the result is.


Precisely because "macros have complete control" of their bodies, it is not
true that "any macros therein are expanded later, not before". A macro can,
at its discretion, choose to macroexpand its arguments if it wants to. It's
not always unreasonable to do this: I wrote a parallel let macro that
expands the binding expressions in its binding vector to find out what
names are occur free in them. That's much easier to do after fully
macroexpanding the forms, since you only have to deal with the five or so
primitive binding forms. (In that case the macroexpansion was only done for
ease of investigating the forms, and the un-expanded versions were what
were interpolated into the return value of the macro, but that's beside the
point; a macro *can* expand its arguments.)

-- 
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: Attempt at rethrow macro

2013-04-01 Thread Alan Malloy
This is how every macro and special form works. I know you like to 
complain, but the alternative is simply not possible: macros have complete 
control of expanding their bodies, and any macros therein are expanded 
later, not before. Try writing a macro system that goes the other way, and 
see how disastrous the result is.

On Monday, April 1, 2013 1:00:31 PM UTC-7, Cedric Greevey wrote:
>
> IMO, the real problem here is try not macroexpanding its body before 
> looking for its catches. IMO that's a bug, and indeed that the rethrow 
> macro doesn't work when the s-expression it expands to would work in its 
> place represents a violation, at least in spirit, of homoiconicity. There 
> are operators that are "special" and can't be supplied via macro. That's 
> wrong.
>  

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




my code blows up when I try to see it using pprint

2013-04-01 Thread larry google groups

I have a function which at this point only amounts to a print line:


(defn add-rows-of-choices-for-a-given-type-and-return-new-template 
[template item-type-as-string sequence-of-items]
  (pp/pprint sequence-of-items)
  ;; (let [inner-template-of-rows-showing-options-for-this-type-of-item 
(enlive/html-resource "templates/rows_of_options.html")
  ;;   inner-template (enlive/select 
inner-template-of-rows-showing-options-for-this-type-of-item 
[:#list_all_of_type_inner_rows_and_options])
  ;;   inner-template-transformed (enlive/transform inner-template 
[:.row_of_choices]  
  ;;(enlive/clone-for 
[one-map-of-this-type sequence-of-items]
  ;; 
 [:li :h2]
  ;; 
 (enlive/content (:public-text one-map-of-this-type))
  ;; 
 [:li.edit_button :a]
  ;; 
 (enlive/set-attr :href (str "/admin/edit/" item-type-as-string "/" 
(correct/transform-keyword-into-string (:item-name one-map-of-this-type
  ;; 
 [:li.preview_button :a]
  ;; 
 (enlive/set-attr :href (str "/admin/preview/" item-type-as-string"/" 
(correct/transform-keyword-into-string (:item-name one-map-of-this-type
  ;; 
 [:li.delete_button :a]
  ;; 
 (enlive/set-attr :href (str "/admin/delete/" item-type-as-string  "/" 
(correct/transform-keyword-into-string (:item-name one-map-of-this-type
  ;; 
 [:li.clone_button :a]
  ;; 
 (enlive/set-attr :href (str "/admin/clone/" item-type-as-string "/" 
(correct/transform-keyword-into-string (:item-name 
one-map-of-this-type))
  ;;   final-template (enlive/transform template 
[:#rows-of-choices-for-a-given-type] (enlive/content 
inner-template-transformed))]
  ;;   final-template
;; )
  )


I get this error: 


java.lang.ClassCastException: clojure.lang.PersistentArrayMap cannot be 
cast to java.util.Map$Entry
at clojure.lang.APersistentMap$ValSeq.first(APersistentMap.java:174)
at clojure.lang.RT.first(RT.java:566)
at clojure.core$first.invoke(core.clj:55)
at clojure.pprint$pprint_reader_macro.invoke(dispatch.clj:50)
at clojure.pprint$pprint_list.invoke(dispatch.clj:77)
at clojure.lang.MultiFn.invoke(MultiFn.java:163)
at clojure.pprint$write_out.invoke(pprint_base.clj:194)
at clojure.pprint$pprint$fn__7359.invoke(pprint_base.clj:250)
at clojure.pprint$pprint.invoke(pprint_base.clj:248)
at clojure.pprint$pprint.invoke(pprint_base.clj:245)
at 
kiosks_clojure.admin$add_rows_of_choices_for_a_given_type_and_return_new_template.invoke(admin.clj:28)
at kiosks_clojure.admin$render_all_of_this_type.invoke(admin.clj:222)
at 
kiosks_clojure.admin$render_the_template_that_lists_all_items_of_this_type.invoke(admin.clj:234)


The function that feeds data to this function returns this:




return value from 
 transform-seq-of-items-filter-out-any-that-are-scheduled-to-be-deleted 
[{:per-page-form-cache {:per-page-banner-title "What kind of performing 
arts?", :html-input " ChooseDanceTheaterMusicAll kinds"}, 
:slides-styles " #supporting_and_explanatory_illustration { 
background-image: url('/img/camp_planner_the_sun_is_shining.png') }  ", 
:public-text "What kind of performing arts?", :multiple false, :planners-id 
:summer-camp, :item-name :performing-arts-followup, :item-image 
"camp_planner_the_sun_is_shining.png", :children-type :answers} 
{:per-page-form-cache {:per-page-banner-title "What type of camp? ", 
:html-input " ChooseAcademicArtPerforming 
ArtsSportsGeneral 
interestSpecial 
interestSpecial 
needs"}, :slides-styles " 
#supporting_and_explanatory_illustration { background-image: 
url('/img/camp_planner_the_sun_is_shining.png') }  ", :public-text "What 
type of camp? ", :multiple false, :planners-id :summer-camp, :item-name 
:what-type-of-camp-daycamp, :item-image 
"camp_planner_the_sun_is_shining.png", :children-type :answers} 
{:per-page-form-cache {:per-page-banner-title "What's your budget? ", 
:html-input " Choose$$"},
 
:slides-styles " #supporting_and_explanatory_illustration { 
background-image: url('/img/camp_planner_dollar_signs.png') }  ", 
:public-text "What's your budget? ", :multiple false, :planners-id 
:summer-camp, :item-name :what-s-your-budget-sleepaway, :item-image 
"camp_planner_dollar_signs.png", :children-type :answers} 
{:per-page-form-cache {:per-page-banner-title "What kind of camp do you 
want?", :html-input " ChooseDay 
campsSleepaway 

Re: Rich Hickey quote on immutability

2013-04-01 Thread Jeremiah Dodds
Alf Kristian Støyle  writes:

> Hey everyone!
>
> I am doing presentation on Clojure and immutability, and I am looking for a
> quote. I think I remember Rich saying something along the lines of:
>
> "Try going immutable and see where it takes you".
>
> Anyone remember where (or if at all), he said this? And of course, what the
> exact quote is?

You can find Rich saying something similar to that in just about every
recorded talk I've seen of
him. http://www.youtube.com/watch?v=dGVqrGmwOAw for example.

-- 
-- 
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: Attempt at rethrow macro

2013-04-01 Thread Cedric Greevey
IMO, the real problem here is try not macroexpanding its body before
looking for its catches. IMO that's a bug, and indeed that the rethrow
macro doesn't work when the s-expression it expands to would work in its
place represents a violation, at least in spirit, of homoiconicity. There
are operators that are "special" and can't be supplied via macro. That's
wrong.

-- 
-- 
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: Securing Clojure + Clojurescript Web App

2013-04-01 Thread albert cortez
Sorry if my comment about ajax was confusing. I actually meant the same 
thing as the original poster. I have a single page application which 
load everything over an initial route in compojure. Everything after that 
is done with your wonderful libraries shoreleave-ring/shoreleave-remote 
together with domina. Maybe i'm just too inexperienced to know, but I'm 
finding it difficult to figure out how I can use friend to restrict certain 
users' ability to view modified DOM(since it is a SPA). Do you think you 
might be able to make a simple example?

-Albert

On Monday, April 1, 2013 8:16:42 PM UTC+2, Chas Emerick wrote:
>
> I think different people are asking different questions here.
>
> Authenticating via an XHR or similar is very straightforward if you are 
> using a single-step authentication method like the username/password 
> interactive workflow.  Just POST to the right URL with username/password 
> data, and carry on based on a successful vs. unsuccessful response.
>
> Authorization within a single-page application is a totally separate 
> question.  Now that I've read Ari's question again fresh, I think he's 
> asking "How do I enforce authorization policies when my RPC mechanism (in 
> this case, shoreleave-remote) 'binds' on a single URI, when it looks like 
> all the Friend authorization examples establish policy on a per-URI basis?"
>
> (Apologies to Ari if that's *not* what he's asking, but I'll answer that 
> question if anyone's interested…)
>
> The answer is that you can use 
> `cemerick.friend/authorize`, `cemerick.friend/authorized?`,  
> `cemerick.friend/throw-unauthorized` 
> in various combinations whereever you need to enforce authorization policy. 
>  It does not have to be applied only once, just within the boundary of 
> routing, and it does not even have to be role-based.  So, if you expose N 
> functions via shoreleave's RPC mechanism, each of those (or dedicated 
> `defremote`s that delegate to other fns) can contain any arbitrary 
> authorization checks, each potentially changing application behaviour or 
> throwing an authorization failure as your needs demand.
>
> That's today, and should suffice for building effectively any application 
> you need.  Someday soon however, it will be possible to back into a 
> singular routing+authorization policy table for your entire application, 
> which could include e.g. multiple shoreleave RPC endpoints, each with their 
> own delimited bag of remote-available fns, each potentially guarded by 
> their own authorization criteria.  This will hopefully allow for 
> declarative policy specifications, automated reporting of effective policy 
> outside of runtime, allow you to disentangle authorization policy from the 
> rest of your codebase, and altogether make audits less invasive and 
> therefore less costly.
>
> I hope the above clarifies more than it confuses.
>
> Cheers,
>
> - Chas
>
> On Apr 1, 2013, at 1:12 PM, albert cortez wrote:
>
> In the same boat here. Trying to make a SPA and now am trying to figure 
> out the easiest way to have ajax authentification.
>
> On Tuesday, February 26, 2013 5:24:09 PM UTC+1, Ari wrote:
>>
>> Hi,
>>
>> I'd appreciate suggestions on how I can/should secure my 
>> clojure/clojurescript "single page web" app that relies heavily on 
>> shoreleave-remote. With other frameworks, upon authentication I've created 
>> a "roles" cookie that the clientside uses to determine access rights to 
>> views, while on the serverside I use a "roles" session variable to 
>> determine access rights to GET/POST data. But Shoreleave side-steps the 
>> serverside authentication/authorization (via friend), so I'm not sure how 
>> to proceed. 
>>
>> Thanks.
>>
>> -Ari
>>
>>
> -- 
> -- 
> 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 th

Re: Attempt at rethrow macro

2013-04-01 Thread Bill Robertson
I think that's what is going on too. I tried quoting catch in the rethrow 
macro, but that didn't do it (didn't expect it to either).

(defmacro rethrow [ex-class] `('catch ~ex-class x# (throw x#)))

I still wonder if there is some sort of macrofoolery that would get it past 
the compiler. I'm not going to hold my breath though.

-Bill

On Monday, April 1, 2013 1:26:43 PM UTC-4, Alf wrote:
>
> Hey Bill.
>
> I am guessing the problem is that the rethrow macro is expanded and passed 
> to the reader/compiler before the handle-ex macro is. And at that point the 
> compiler sees catch as a "standalone-symbol", not as part of the try 
> special form. Macro-experts, please correct me :)
>
> Tried to quickly catch up with 
> http://www.infoq.com/presentations/Clojure-Macros, but infoq seems slow.
>
> Cheers,
> Alf
>
>
> On 1 April 2013 17:21, Bill Robertson  >wrote:
>
>> I was all excited when I was able to consolidate a lot of try/catch logic 
>> behind a macro earlier this morning. All was good.
>>
>> I felt like I could do a better job of communicating my intentions in the 
>> code though with a rethrow construct rather than writing 
>> (catch FooException #f (throw #f))
>>
>> I would have liked to have been able to simply write
>> (rethrow FooException)
>>
>> This failed. Poking around the docs a bit, I see that try/catch is a 
>> special form. Which makes sense.
>>
>> user=> (defmacro rethrow [ex-class] `(catch ~ex-class x# (throw x#)))
>> #'user/rethrow
>> user=> (defmacro handle-ex [message & body] `(try ~@body (rethrow 
>> IllegalArgumentException) (catch Exception x# (throw 
>> (IllegalArgumentException. message)
>> #'user/handle-ex
>> user=> (handle-ex "no" (throw (IllegalArgumentException. "yes")))
>> CompilerException java.lang.RuntimeException: Unable to resolve symbol: 
>> catch in this context, compiling:(NO_SOURCE_PATH:1:1)
>>
>> It was a longshot, but I tried to qualify catch. That fails too, because 
>> it's not really there...
>>
>> user=> (defmacro rethrow [ex-class] `(clojure.core/catch ~ex-class x# 
>> (throw x#)))
>> #'user/rethrow
>> user=> (defmacro handle-ex [message & body] `(try ~@body (rethrow 
>> IllegalArgumentException) (catch Exception x# (throw 
>> (IllegalArgumentException. message)
>> #'user/handle-ex
>> user=> (handle-ex "no" (throw (IllegalArgumentException. "yes")))
>> CompilerException java.lang.RuntimeException: No such var: 
>> clojure.core/catch, compiling:(NO_SOURCE_PATH:1:1)
>>
>> Is this possible to do within the normal bounds of the language?
>>
>> Thanks!
>>
>>
>>  -- 
>> -- 
>> 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: Problem with map (only when running on browser)

2013-04-01 Thread Alan Thompson
I second that, Nico!  For some reason the lines are not wrapping at all in
GMail and are coming in a couple of hundred char's wide!
Alan


On Sat, Mar 30, 2013 at 8:54 AM, Cedric Greevey  wrote:

> On Sat, Mar 30, 2013 at 10:09 AM, Nico  wrote:
>
>> BTW, it seems like knowing Clojure is a requirement to start using
>> Clojurescript,
>>
>
> I think the general expectation has been that anyone using Clojurescript
> is likely to be using both.
>
> Maybe you should just learn Clojure? Between the many tutorial and
> documentation resources posted, try-clojure, and the lightweight IDE clooj,
> it shouldn't be too difficult.
>
> P.S. Please fix your linewrap. The long lines make it inconvenient to read
> this entire thread, at least in gmail's web interface.
>
> --
> --
> 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: Attempt at rethrow macro

2013-04-01 Thread Armando Blancas
Define rethrow as a function; Alf's probably right. Also, change to: 
~message.

user=> (defn rethrow [ex-class] `(catch ~ex-class x# (throw x#)))
#'user/rethrow
user=> 
user=> (defmacro handle-ex [message & body] 
  `(try ~@body ~(rethrow IllegalArgumentException) 
 (catch Exception x# (throw (IllegalArgumentException. ~message)
#'user/handle-ex
user=> 
user=> (handle-ex "no" (throw (IllegalArgumentException. "yes")))
IllegalArgumentException yes  user/eval9 (NO_SOURCE_FILE:7)


On Monday, April 1, 2013 8:21:30 AM UTC-7, Bill Robertson wrote:
>
> I was all excited when I was able to consolidate a lot of try/catch logic 
> behind a macro earlier this morning. All was good.
>
> I felt like I could do a better job of communicating my intentions in the 
> code though with a rethrow construct rather than writing 
> (catch FooException #f (throw #f))
>
> I would have liked to have been able to simply write
> (rethrow FooException)
>
> This failed. Poking around the docs a bit, I see that try/catch is a 
> special form. Which makes sense.
>
> user=> (defmacro rethrow [ex-class] `(catch ~ex-class x# (throw x#)))
> #'user/rethrow
> user=> (defmacro handle-ex [message & body] `(try ~@body (rethrow 
> IllegalArgumentException) (catch Exception x# (throw 
> (IllegalArgumentException. message)
> #'user/handle-ex
> user=> (handle-ex "no" (throw (IllegalArgumentException. "yes")))
> CompilerException java.lang.RuntimeException: Unable to resolve symbol: 
> catch in this context, compiling:(NO_SOURCE_PATH:1:1)
>
> It was a longshot, but I tried to qualify catch. That fails too, because 
> it's not really there...
>
> user=> (defmacro rethrow [ex-class] `(clojure.core/catch ~ex-class x# 
> (throw x#)))
> #'user/rethrow
> user=> (defmacro handle-ex [message & body] `(try ~@body (rethrow 
> IllegalArgumentException) (catch Exception x# (throw 
> (IllegalArgumentException. message)
> #'user/handle-ex
> user=> (handle-ex "no" (throw (IllegalArgumentException. "yes")))
> CompilerException java.lang.RuntimeException: No such var: 
> clojure.core/catch, compiling:(NO_SOURCE_PATH:1:1)
>
> Is this possible to do within the normal bounds of the language?
>
> 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: Attempt at rethrow macro

2013-04-01 Thread Alan Malloy
On Monday, April 1, 2013 10:26:43 AM UTC-7, Alf wrote:

> I am guessing the problem is that the rethrow macro is expanded and passed 
> to the reader/compiler before the handle-ex macro is. And at that point the 
> compiler sees catch as a "standalone-symbol", not as part of the try 
> special form. Macro-experts, please correct me :)
>
> Tried to quickly catch up with 
> http://www.infoq.com/presentations/Clojure-Macros, but infoq seems slow.
>
> On 1 April 2013 17:21, Bill Robertson  >wrote:
>
>> I was all excited when I was able to consolidate a lot of try/catch logic 
>> behind a macro earlier this morning. All was good.
>>
>> I felt like I could do a better job of communicating my intentions in the 
>> code though with a rethrow construct rather than writing 
>> (catch FooException #f (throw #f))
>>
>> I would have liked to have been able to simply write
>> (rethrow FooException)
>>
>> This failed. Poking around the docs a bit, I see that try/catch is a 
>> special form. Which makes sense.
>>
>> user=> (defmacro rethrow [ex-class] `(catch ~ex-class x# (throw x#)))
>> #'user/rethrow
>> user=> (defmacro handle-ex [message & body] `(try ~@body (rethrow 
>> IllegalArgumentException) (catch Exception x# (throw 
>> (IllegalArgumentException. message)
>> #'user/handle-ex
>> user=> (handle-ex "no" (throw (IllegalArgumentException. "yes")))
>> CompilerException java.lang.RuntimeException: Unable to resolve symbol: 
>> catch in this context, compiling:(NO_SOURCE_PATH:1:1)
>>
>> It was a longshot, but I tried to qualify catch. That fails too, because 
>> it's not really there...
>>
>> user=> (defmacro rethrow [ex-class] `(clojure.core/catch ~ex-class x# 
>> (throw x#)))
>> #'user/rethrow
>> user=> (defmacro handle-ex [message & body] `(try ~@body (rethrow 
>> IllegalArgumentException) (catch Exception x# (throw 
>> (IllegalArgumentException. message)
>> #'user/handle-ex
>> user=> (handle-ex "no" (throw (IllegalArgumentException. "yes")))
>> CompilerException java.lang.RuntimeException: No such var: 
>> clojure.core/catch, compiling:(NO_SOURCE_PATH:1:1)
>>
>> Is this possible to do within the normal bounds of the language?
>>
>> Thanks!
>>
>>
>>  -- 
>> -- 
>> 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.
>>  
>>  
>>
>
>
That is the opposite of the problem: `try` searches for a `catch` without 
macroexpanding its body forms. You could come at the problem differently, 
by writing a macro that expands to an entire try+catch 
form: (try-rethrowing [IllegalArgumentException] (do a b c) (catch 
Exception e e) (finally (foo))) is a macro that you could successfully 
write.

-- 
-- 
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: Securing Clojure + Clojurescript Web App

2013-04-01 Thread Chas Emerick
I think different people are asking different questions here.

Authenticating via an XHR or similar is very straightforward if you are using a 
single-step authentication method like the username/password interactive 
workflow.  Just POST to the right URL with username/password data, and carry on 
based on a successful vs. unsuccessful response.

Authorization within a single-page application is a totally separate question.  
Now that I've read Ari's question again fresh, I think he's asking "How do I 
enforce authorization policies when my RPC mechanism (in this case, 
shoreleave-remote) 'binds' on a single URI, when it looks like all the Friend 
authorization examples establish policy on a per-URI basis?"

(Apologies to Ari if that's *not* what he's asking, but I'll answer that 
question if anyone's interested…)

The answer is that you can use `cemerick.friend/authorize`, 
`cemerick.friend/authorized?`,  `cemerick.friend/throw-unauthorized` in various 
combinations whereever you need to enforce authorization policy.  It does not 
have to be applied only once, just within the boundary of routing, and it does 
not even have to be role-based.  So, if you expose N functions via shoreleave's 
RPC mechanism, each of those (or dedicated `defremote`s that delegate to other 
fns) can contain any arbitrary authorization checks, each potentially changing 
application behaviour or throwing an authorization failure as your needs demand.

That's today, and should suffice for building effectively any application you 
need.  Someday soon however, it will be possible to back into a singular 
routing+authorization policy table for your entire application, which could 
include e.g. multiple shoreleave RPC endpoints, each with their own delimited 
bag of remote-available fns, each potentially guarded by their own 
authorization criteria.  This will hopefully allow for declarative policy 
specifications, automated reporting of effective policy outside of runtime, 
allow you to disentangle authorization policy from the rest of your codebase, 
and altogether make audits less invasive and therefore less costly.

I hope the above clarifies more than it confuses.

Cheers,

- Chas

On Apr 1, 2013, at 1:12 PM, albert cortez wrote:

> In the same boat here. Trying to make a SPA and now am trying to figure out 
> the easiest way to have ajax authentification.
> 
> On Tuesday, February 26, 2013 5:24:09 PM UTC+1, Ari wrote:
> Hi,
> 
> I'd appreciate suggestions on how I can/should secure my 
> clojure/clojurescript "single page web" app that relies heavily on 
> shoreleave-remote. With other frameworks, upon authentication I've created a 
> "roles" cookie that the clientside uses to determine access rights to views, 
> while on the serverside I use a "roles" session variable to determine access 
> rights to GET/POST data. But Shoreleave side-steps the serverside 
> authentication/authorization (via friend), so I'm not sure how to proceed. 
> 
> Thanks.
> 
> -Ari
> 
> 
> -- 
> -- 
> 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: Attempt at rethrow macro

2013-04-01 Thread Alf Kristian Støyle
Hey Bill.

I am guessing the problem is that the rethrow macro is expanded and passed
to the reader/compiler before the handle-ex macro is. And at that point the
compiler sees catch as a "standalone-symbol", not as part of the try
special form. Macro-experts, please correct me :)

Tried to quickly catch up with
http://www.infoq.com/presentations/Clojure-Macros, but infoq seems slow.

Cheers,
Alf


On 1 April 2013 17:21, Bill Robertson  wrote:

> I was all excited when I was able to consolidate a lot of try/catch logic
> behind a macro earlier this morning. All was good.
>
> I felt like I could do a better job of communicating my intentions in the
> code though with a rethrow construct rather than writing
> (catch FooException #f (throw #f))
>
> I would have liked to have been able to simply write
> (rethrow FooException)
>
> This failed. Poking around the docs a bit, I see that try/catch is a
> special form. Which makes sense.
>
> user=> (defmacro rethrow [ex-class] `(catch ~ex-class x# (throw x#)))
> #'user/rethrow
> user=> (defmacro handle-ex [message & body] `(try ~@body (rethrow
> IllegalArgumentException) (catch Exception x# (throw
> (IllegalArgumentException. message)
> #'user/handle-ex
> user=> (handle-ex "no" (throw (IllegalArgumentException. "yes")))
> CompilerException java.lang.RuntimeException: Unable to resolve symbol:
> catch in this context, compiling:(NO_SOURCE_PATH:1:1)
>
> It was a longshot, but I tried to qualify catch. That fails too, because
> it's not really there...
>
> user=> (defmacro rethrow [ex-class] `(clojure.core/catch ~ex-class x#
> (throw x#)))
> #'user/rethrow
> user=> (defmacro handle-ex [message & body] `(try ~@body (rethrow
> IllegalArgumentException) (catch Exception x# (throw
> (IllegalArgumentException. message)
> #'user/handle-ex
> user=> (handle-ex "no" (throw (IllegalArgumentException. "yes")))
> CompilerException java.lang.RuntimeException: No such var:
> clojure.core/catch, compiling:(NO_SOURCE_PATH:1:1)
>
> Is this possible to do within the normal bounds of the language?
>
> 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: Securing Clojure + Clojurescript Web App

2013-04-01 Thread albert cortez
In the same boat here. Trying to make a SPA and now am trying to figure out 
the easiest way to have ajax authentification.

On Tuesday, February 26, 2013 5:24:09 PM UTC+1, Ari wrote:
>
> Hi,
>
> I'd appreciate suggestions on how I can/should secure my 
> clojure/clojurescript "single page web" app that relies heavily on 
> shoreleave-remote. With other frameworks, upon authentication I've created 
> a "roles" cookie that the clientside uses to determine access rights to 
> views, while on the serverside I use a "roles" session variable to 
> determine access rights to GET/POST data. But Shoreleave side-steps the 
> serverside authentication/authorization (via friend), so I'm not sure how 
> to proceed. 
>
> Thanks.
>
> -Ari
>
>

-- 
-- 
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 Introducing Clochure: a better Clojure

2013-04-01 Thread Phil Hagelberg

Michael Klishin writes:

> 2013/4/1 Rostislav Svoboda 
>
>> This is a step back. The only way for the future is xml: + 1
>> 2
>
>
> This is planned for the next release.

In the mean time you can port all your project.clj files to project.xml
with this plugin:

https://github.com/technomancy/lein-xml

Hope that helps!

-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: Attempt at rethrow macro

2013-04-01 Thread Ben Wolfson
IIRC "catch" is auxiliary syntax---it only has meaning within a (try ...)
form.


On Mon, Apr 1, 2013 at 8:21 AM, Bill Robertson wrote:

> I was all excited when I was able to consolidate a lot of try/catch logic
> behind a macro earlier this morning. All was good.
>
> I felt like I could do a better job of communicating my intentions in the
> code though with a rethrow construct rather than writing
> (catch FooException #f (throw #f))
>
> I would have liked to have been able to simply write
> (rethrow FooException)
>
> This failed. Poking around the docs a bit, I see that try/catch is a
> special form. Which makes sense.
>
> user=> (defmacro rethrow [ex-class] `(catch ~ex-class x# (throw x#)))
> #'user/rethrow
> user=> (defmacro handle-ex [message & body] `(try ~@body (rethrow
> IllegalArgumentException) (catch Exception x# (throw
> (IllegalArgumentException. message)
> #'user/handle-ex
> user=> (handle-ex "no" (throw (IllegalArgumentException. "yes")))
> CompilerException java.lang.RuntimeException: Unable to resolve symbol:
> catch in this context, compiling:(NO_SOURCE_PATH:1:1)
>
> It was a longshot, but I tried to qualify catch. That fails too, because
> it's not really there...
>
> user=> (defmacro rethrow [ex-class] `(clojure.core/catch ~ex-class x#
> (throw x#)))
> #'user/rethrow
> user=> (defmacro handle-ex [message & body] `(try ~@body (rethrow
> IllegalArgumentException) (catch Exception x# (throw
> (IllegalArgumentException. message)
> #'user/handle-ex
> user=> (handle-ex "no" (throw (IllegalArgumentException. "yes")))
> CompilerException java.lang.RuntimeException: No such var:
> clojure.core/catch, compiling:(NO_SOURCE_PATH:1:1)
>
> Is this possible to do within the normal bounds of the language?
>
> 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.
>
>
>



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




Rich Hickey quote on immutability

2013-04-01 Thread Alf Kristian Støyle
Hey everyone!

I am doing presentation on Clojure and immutability, and I am looking for a
quote. I think I remember Rich saying something along the lines of:

"Try going immutable and see where it takes you".

Anyone remember where (or if at all), he said this? And of course, what the
exact quote is?

Cheers,
Alf

-- 
-- 
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 Introducing Clochure: a better Clojure

2013-04-01 Thread Akhil Wali
I almost broke my keyboard.
/slow clap
On Apr 1, 2013 8:15 PM, "Michael Klishin" 
wrote:

>
> 2013/4/1 Rostislav Svoboda 
>
>> Michael: I'm about to send you a patch. Just let me fill the contributor
>> agreement
>
>
> Don't bother. Clochure doubles down on the Clojure's contributor
> agreement's respect to
> the past.
>
> Unless you send your CA on a piece of papyrus or a clay board, it will
> never be considered.
> Also, we did this release on GitHub to appeal to the cool kids but when
> Clochure adoption
> surpasses Clojure, we will move back to CVS and will also remove all
> documentation (nobody
> cares about working on it anyway).
> --
> 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: [ANN] Pedestal Application Framework

2013-04-01 Thread Tyler Gillies
I meant to say picture of your signature, yay monday mornings

On Monday, April 1, 2013 8:17:43 AM UTC-7, Tyler Gillies wrote:
>
> Preview app on mac allows you to take a picture of your picture and use it 
> on documents. Then you can just open up file, click signature tool and 
> apply, then save and email.
>
> On Friday, March 29, 2013 12:48:54 PM UTC-7, Jeremiah Dodds wrote:
>>
>> Cedric Greevey  writes: 
>>
>> > It's a definite improvement ... but "please print and sign the 
>> agreement, then 
>> > scan and mail"? There are a growing number of people that do 
>> *everything* 
>> > online, to the point of not having a printer, not having a scanner, or 
>> not 
>> > having either. 
>> > 
>> > Of course, the same people tend to have trouble with the quaint notion 
>> that a 
>> > funny-looking squiggle emitted by pen onto paper is somehow a securer 
>> form of 
>> > authentication than a 128-bit cryptographic signature of a document 
>> hash. :) 
>> > 
>> > -- 
>>
>> Those people may be interested in sites like https://www.hellofax.com/ 
>> when faced with "needing" to print, sign, and scan some paper-trail :P 
>>
>> -- 
>> Jeremiah Dodds 
>>
>> blog   : http://jdodds.github.com 
>> github : https://github.com/jdodds 
>> freenode/skype  : exhortatory 
>> twitter: kaens 
>>
>

-- 
-- 
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] Pedestal Application Framework

2013-04-01 Thread Tyler Gillies
Preview app on mac allows you to take a picture of your picture and use it 
on documents. Then you can just open up file, click signature tool and 
apply, then save and email.

On Friday, March 29, 2013 12:48:54 PM UTC-7, Jeremiah Dodds wrote:
>
> Cedric Greevey > writes: 
>
> > It's a definite improvement ... but "please print and sign the 
> agreement, then 
> > scan and mail"? There are a growing number of people that do 
> *everything* 
> > online, to the point of not having a printer, not having a scanner, or 
> not 
> > having either. 
> > 
> > Of course, the same people tend to have trouble with the quaint notion 
> that a 
> > funny-looking squiggle emitted by pen onto paper is somehow a securer 
> form of 
> > authentication than a 128-bit cryptographic signature of a document 
> hash. :) 
> > 
> > -- 
>
> Those people may be interested in sites like https://www.hellofax.com/ 
> when faced with "needing" to print, sign, and scan some paper-trail :P 
>
> -- 
> Jeremiah Dodds 
>
> blog   : http://jdodds.github.com 
> github : https://github.com/jdodds 
> freenode/skype  : exhortatory 
> twitter: kaens 
>

-- 
-- 
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 Introducing Clochure: a better Clojure

2013-04-01 Thread Michael Klishin
2013/4/1 Rostislav Svoboda 

> Michael: I'm about to send you a patch. Just let me fill the contributor
> agreement


Don't bother. Clochure doubles down on the Clojure's contributor
agreement's respect to
the past.

Unless you send your CA on a piece of papyrus or a clay board, it will
never be considered.
Also, we did this release on GitHub to appeal to the cool kids but when
Clochure adoption
surpasses Clojure, we will move back to CVS and will also remove all
documentation (nobody
cares about working on it anyway).
-- 
MK

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

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: ANN Introducing Clochure: a better Clojure

2013-04-01 Thread Dan Cross
Well played.


On Mon, Apr 1, 2013 at 10:28 AM, Michael Klishin <
michael.s.klis...@gmail.com> wrote:

> Introducing Clochure: a better Clojure.
>
> Quoting project's README:
>
> Clochure (http://clochure.org) is an educated attempt to solve Clojure's
> number one problem and first obstacle that puts away newcomers:
> **parentheses**.
>
> We've found an elegant and practical solution to the problem: interchange 
> parentheses with square brackets. Why?
>
> Since 2008 one programming language has seen an unprecedented growth in 
> popularity despite its weird syntax: `Objective-C`. Why? Because to create 
> applications for the App Store you have to code in Objective-C. Over 800.000 
> apps in the App Store are a testimony of the popularity of this language.
>
> What does this have to do with Clochure? Well Objective-C syntax looks like 
> this:
>
> ```objective-c
> [[MyObject alloc] init]
> ```
>
> Don't you see something familiar there? Yep. We also noticed it.
>
> So now with Clochure you get all the advantages of the JVM, the elegance of 
> Clojure and tons of Objective-C developers that can jump straight away to 
> work in your startup code.
>
> Check it out for yourself: http://clochure.org.
>
> Happy April Fools day.
> --
> 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: ANN Introducing Clochure: a better Clojure

2013-04-01 Thread Michael Klishin
2013/4/1 Rostislav Svoboda 

> This is a step back. The only way for the future is xml: + 1
> 2


This is planned for the next release.
-- 
MK

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

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: ANN Introducing Clochure: a better Clojure

2013-04-01 Thread Rostislav Svoboda
This is a step back. The only way for the future is xml: + 1
2
Michael: I'm about to send you a patch. Just let me fill the contributor
agreement...

-- 
-- 
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 Introducing Clochure: a better Clojure

2013-04-01 Thread Wes Freeman
This is great!

I couldn't find the contributor agreement, though...

Wes

-- 
-- 
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 Introducing Clochure: a better Clojure

2013-04-01 Thread Michael Klishin
Introducing Clochure: a better Clojure.

Quoting project's README:

Clochure (http://clochure.org) is an educated attempt to solve Clojure's
number one problem and first obstacle that puts away newcomers:
**parentheses**.

We've found an elegant and practical solution to the problem:
interchange parentheses with square brackets. Why?

Since 2008 one programming language has seen an unprecedented growth
in popularity despite its weird syntax: `Objective-C`. Why? Because to
create applications for the App Store you have to code in Objective-C.
Over 800.000 apps in the App Store are a testimony of the popularity
of this language.

What does this have to do with Clochure? Well Objective-C syntax looks
like this:

```objective-c
[[MyObject alloc] init]
```

Don't you see something familiar there? Yep. We also noticed it.

So now with Clochure you get all the advantages of the JVM, the
elegance of Clojure and tons of Objective-C developers that can jump
straight away to work in your startup code.

Check it out for yourself: http://clochure.org.

Happy April Fools day.
-- 
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: Securing Clojure + Clojurescript Web App

2013-04-01 Thread Kevin Albrecht
I have the same question as you. Did you ever find an answer, Ari?
-Kevin

Den fredagen den 1:e mars 2013 kl. 15:36:45 UTC+1 skrev Ari:
>
>
>
> On Tuesday, February 26, 2013 8:54:19 PM UTC-5, Ari wrote:
>>
>> On Tuesday, February 26, 2013 3:16:23 PM UTC-5, Chas Emerick wrote:
>>  
>>
>>> What do you mean by "sidesteps the auth"?  If you're using 
>>> shoreleave-remote-ring, then the handler produced by its wrap-rpc 
>>> middleware is subject to whatever access controls you define via Friend.  
>>> - Chas
>>
>>
>> Friend, as I understand it, allows access to be controlled at the route 
>> level (see friend 
>> authorization) 
>> allowing for fine-grained access control definitions. However, since 
>> Shoreleave remote defines and relies on a single URI, which defaults to 
>> "_fetch", defining such fine-grained access controls is not possible. This 
>> is what I was referring to by "side-steps" the authentication/authorization 
>> flow and thus inhibits implementing the client-side/server-side security 
>> approach I described in my original post. 
>>
>> Following up on my original post, is it possible to create a "roles" 
>> cookie upon initial authentication; if so, how? Thanks.
>>
>> -Ari
>>
>
> Not to belabor the question, but can anyone shed light on whether my 
> understanding and approach is correct? Thanks.
>
> -Ari 
>

-- 
-- 
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: Quirk with printing regexps

2013-04-01 Thread Mark Engelberg
On Mon, Apr 1, 2013 at 1:00 AM, Michał Marczyk wrote:

> Could you just preprocess the strings passed to re-pattern (or
> patterns if you're getting those as input) to replace literal newlines
> with escape sequences? I'm assuming you don't care about ?x given the
> result you wish to achieve.
>

Thanks for brainstorming with me on this.  This was the strategy I pursued
before Mikhail pointed out about how ?x changes the semantics of literal
newlines.  I don't know how important the ?x is, but I am reluctant to
change the potential semantics of the regular expression for the sake of
printing.

Tonight I tried the strategy of keeping the literal newlines in, but doing
that sort of substitution (replacing literal whitespace with escape
sequences) right before printing.  It seems to be working so far, so I'm
keeping my fingers crossed.

--Mark

-- 
-- 
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: Quirk with printing regexps

2013-04-01 Thread Michał Marczyk
(The examples from the REPL still apply.)


On 1 April 2013 10:15, Michał Marczyk  wrote:
> Oh, wait, I posted the wrong function. Here's the one I meant:
>
> (defn pr-pattern [pat]
>   (pr (re-pattern (.replaceAll (re-matcher (re-pattern "\n")
>(.toString pat))
>"n"
>
>
> On 1 April 2013 10:00, Michał Marczyk  wrote:
>> On 1 April 2013 07:53, Mark Engelberg  wrote:
>>> Yeah, my goal is simply to get (re-pattern #"a\nb") to print (or more
>>> precisely, pr) as #"a\nb" without affecting the semantics of printing other
>>> regular expressions, but that seems to be impossible to achieve.  Sigh...
>>
>> Could you just preprocess the strings passed to re-pattern (or
>> patterns if you're getting those as input) to replace literal newlines
>> with escape sequences? I'm assuming you don't care about ?x given the
>> result you wish to achieve.
>>
>> Otherwise, I haven't done much testing on this, but perhaps you could
>> see whether it would work for you:
>>
>> (defn pr-pattern [pat]
>>   (print (str "#\""
>>   (.replaceAll (re-matcher (re-pattern "\n")
>>(.toString pat))
>>"n")
>>   "\"")))
>>
>> user=> (pr-pattern (re-pattern "a\nb"))
>> #"a\nb"nil
>> user=> (pr-pattern #"a\nb")
>> #"a\nb"nil
>>
>> (The nils are of course the return values. There are indeed four
>> backslashes in the replacement string literal, since
>> Matcher.replaceAll has its own escaping for $ (captured subsequence
>> reference when not escaped) and \.)
>>
>> Cheers,
>> Michał

-- 
-- 
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: Quirk with printing regexps

2013-04-01 Thread Michał Marczyk
Oh, wait, I posted the wrong function. Here's the one I meant:

(defn pr-pattern [pat]
  (pr (re-pattern (.replaceAll (re-matcher (re-pattern "\n")
   (.toString pat))
   "n"


On 1 April 2013 10:00, Michał Marczyk  wrote:
> On 1 April 2013 07:53, Mark Engelberg  wrote:
>> Yeah, my goal is simply to get (re-pattern #"a\nb") to print (or more
>> precisely, pr) as #"a\nb" without affecting the semantics of printing other
>> regular expressions, but that seems to be impossible to achieve.  Sigh...
>
> Could you just preprocess the strings passed to re-pattern (or
> patterns if you're getting those as input) to replace literal newlines
> with escape sequences? I'm assuming you don't care about ?x given the
> result you wish to achieve.
>
> Otherwise, I haven't done much testing on this, but perhaps you could
> see whether it would work for you:
>
> (defn pr-pattern [pat]
>   (print (str "#\""
>   (.replaceAll (re-matcher (re-pattern "\n")
>(.toString pat))
>"n")
>   "\"")))
>
> user=> (pr-pattern (re-pattern "a\nb"))
> #"a\nb"nil
> user=> (pr-pattern #"a\nb")
> #"a\nb"nil
>
> (The nils are of course the return values. There are indeed four
> backslashes in the replacement string literal, since
> Matcher.replaceAll has its own escaping for $ (captured subsequence
> reference when not escaped) and \.)
>
> Cheers,
> Michał

-- 
-- 
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: Quirk with printing regexps

2013-04-01 Thread Michał Marczyk
On 1 April 2013 07:53, Mark Engelberg  wrote:
> Yeah, my goal is simply to get (re-pattern #"a\nb") to print (or more
> precisely, pr) as #"a\nb" without affecting the semantics of printing other
> regular expressions, but that seems to be impossible to achieve.  Sigh...

Could you just preprocess the strings passed to re-pattern (or
patterns if you're getting those as input) to replace literal newlines
with escape sequences? I'm assuming you don't care about ?x given the
result you wish to achieve.

Otherwise, I haven't done much testing on this, but perhaps you could
see whether it would work for you:

(defn pr-pattern [pat]
  (print (str "#\""
  (.replaceAll (re-matcher (re-pattern "\n")
   (.toString pat))
   "n")
  "\"")))

user=> (pr-pattern (re-pattern "a\nb"))
#"a\nb"nil
user=> (pr-pattern #"a\nb")
#"a\nb"nil

(The nils are of course the return values. There are indeed four
backslashes in the replacement string literal, since
Matcher.replaceAll has its own escaping for $ (captured subsequence
reference when not escaped) and \.)

Cheers,
Michał

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