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=
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-Datomi
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 c
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, bu
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 Cloju
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-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,
`clo
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
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/
--
M
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 h
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 (*
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 wr
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
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
(enliv
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
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 operator
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
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
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 requireme
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
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
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
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
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
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/l
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 bett
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
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 r
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
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 imp
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 co
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 pu
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 "Cloj
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@googl
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 pati
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 pa
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 yo
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.
>
T
(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")
>(.toStrin
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
41 matches
Mail list logo