Re: Determining validity of mathematical expression before evaluation

Rudolf Adamkovič <[email protected]>
Newsgroups gmane.emacs.help
Message-ID <[email protected]>
Heime <[email protected]> writes:

[I forgot to CC the list; sorry for the duplicate message.]

>> Is it possible to determine whether an elisp mathematical expression
>> is valid before evaluating it?

That depends entirely on what you consider a valid mathematical
expression. :)

> I call bc.

Why not Lisp instead?

(string-to-number (calc-eval "10 + 5 * 2")) => 20

Rudy
-- 
"One can begin to reason only when a clear picture has been formed in
the imagination."

--- Walter Warwick Sawyer, Mathematician's Delight, 1943

Rudolf Adamkovič <[email protected]> [he/him]
http://adamkovic.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.