On 30 Nov., 20:09, Stuart Sierra <[EMAIL PROTECTED]> wrote:
> On Nov 28, 6:54 pm, Dmitri <[EMAIL PROTECTED]> wrote:
>
> > First of I'd like to say that I find Clojure to be an excellent
> > language, however I find the lack of infix operators makes reading
> > equations somewhat unnatural, eg:
>
> Hi, Dmitri,
>
> Glad you like Clojure! There are Common Lisp packages like
> <http://www.cliki.net/infix> that do infix-conversion. I don't find infix
> notation useful except when transcribing formulas, and fractions or
> roots usually force me to use parentheses anyway. Sun has an
> interesting experimental language called Fortress, <http://
> projectfortress.sun.com/>, that uses real mathematical notation.
Although a standard reader macro for infix syntax would be a nice
thing to have in Clojure.
It could be #[...] or something like that. I don’t care if it is
#[] or i{} or $() or something else.
But it would be nice to be able to say
say #[14x⁶ - 2√π]
vs (- (* 14 (. Math (pow x 6))) (* 2 (. Math (sqrt Math/PI))))
Or #[Σlist + 19]
vs (apply + 19 list)
or (if #[∀x∈M1: x > 10 ∧ ∃y∈M2: y=4] ...)
vs (if (and (every? #(> % 10) M1) (some #(= 4 %) M2)) ...)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---