Hi tahnks!
  i just need to do that operation. to conbert that string. for
example for sums i did
(defn sum [s]
    (apply + (map #(- (int (first %)) (int \0)) (re-seq #"[0-9]" s))))
and it just sums the the numbers but if a have also multiplications,
substracyions and divsions how i do it??



On 26 abr, 13:07, "Jim - FooBar();" <jimpil1...@gmail.com> wrote:
> On 26/04/12 04:18, Asranz wrote:
>
> > Hi. im having a little problem i need to do a parser like to do
> > operations but i dont get how to do it very well
>
> > ex.
>
> >   "1+2*3+4-5*6+7*8-9" = 431
> > i have to do it with sums but i dont get it how i can take all the
> > operations.
> > any advices?
>
> if you need a macro that tranforms infix arithmetic expressions to
> prefix expressions i've got the right macro for you....
>
> Jim

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

Reply via email to