Re: Quirk with printing regexps

2013-04-01 Thread Michał Marczyk
On 1 April 2013 07:53, Mark Engelberg mark.engelb...@gmail.com 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

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

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 michal.marc...@gmail.com 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)

Re: Quirk with printing regexps

2013-04-01 Thread Mark Engelberg
On Mon, Apr 1, 2013 at 1:00 AM, Michał Marczyk michal.marc...@gmail.comwrote: 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

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

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

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

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: bracket+ 1 2/bracket 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

Re: ANN Introducing Clochure: a better Clojure

2013-04-01 Thread Michael Klishin
2013/4/1 Rostislav Svoboda rostislav.svob...@gmail.com This is a step back. The only way for the future is xml: bracket+ 1 2/bracket This is planned for the next release. -- MK http://github.com/michaelklishin http://twitter.com/michaelklishin -- -- You received this message because you

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

Re: ANN Introducing Clochure: a better Clojure

2013-04-01 Thread Michael Klishin
2013/4/1 Rostislav Svoboda rostislav.svob...@gmail.com 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

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 cgre...@gmail.com javascript: writes:

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

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 michael.s.klis...@gmail.com wrote: 2013/4/1 Rostislav Svoboda rostislav.svob...@gmail.com Michael: I'm about to send you a patch. Just let me fill the contributor agreement Don't bother. Clochure doubles down

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

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 billrobertso...@gmail.comwrote: 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

Re: ANN Introducing Clochure: a better Clojure

2013-04-01 Thread Phil Hagelberg
Michael Klishin writes: 2013/4/1 Rostislav Svoboda rostislav.svob...@gmail.com This is a step back. The only way for the future is xml: bracket+ 1 2/bracket 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:

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

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

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

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.

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

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 cgree...@gmail.com wrote: On Sat, Mar 30, 2013 at 10:09 AM, Nico nbren...@gmail.com wrote: BTW, it seems

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

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

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

Re: Rich Hickey quote on immutability

2013-04-01 Thread Jeremiah Dodds
Alf Kristian Støyle alf.krist...@gmail.com 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

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

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

Re: Attempt at rethrow macro

2013-04-01 Thread Ben Wolfson
On Mon, Apr 1, 2013 at 1:32 PM, Alan Malloy a...@malloys.org 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

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 peter.manc...@gmail.com wrote: (class 1) java.lang.Long ;check! (class (* (/ 1 255) 254))

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

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

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 alf.krist...@gmail.com 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

[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,

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

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

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 smnir...@gmail.com wrote: Does the API documentation for version 0.2.3 exist somewhere? I see the auto-generated docs on

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

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 m...@mhbtech.com wrote: It might be his Clojure/West 2012 presentation on Datomic near the very end. Choose immutability and see where it takes you.

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=