
From:  Marc Tfardy 
Subject:  Re: Quick math calc on any buffer 
Date:  Wed, 25 Feb 2009 00:29:29 +0100 
Useragent:  Thunderbird 2.0.0.19 (Windows/20081209) 
Chetan schrieb:
Scott Frazer <address@hidden> writes:On Feb 21, 11:42 am, Rodrigo Lazo <address@hidden> wrote:Hi all, Is there a way to compute a math expression on any buffer? I mean, if I have a buffer with the following expression 2 + 3 I want to mark the region and compute the result 2 + 3 = 5 It doesn't seems too hard to do, I've looked on calculator.el for a "computing" function I can call but I didn't find it.(defun mycalcresult (beg end) (interactive "r") (insert " = " (calceval (buffersubstring beg end))))
This makes me wonder, is there a rewriter of math expressions, something like a macro that can rewrite the arithmetic expression as regular lisp function calls?
Yes. See my last post before. The call: (mathreadexprs "2 + 3") gives: ((+ 2 3)) This was my attempt in my version of mycalcresult. reagrds Marc
[Prev in Thread]  Current Thread  [Next in Thread] 