[GiNaC-list] ginsh as a subroutine?

Richard B. Kreckel kreckel at ginac.de
Wed Jun 22 23:45:19 CEST 2005


On Wed, 22 Jun 2005, John Fletcher wrote:
> I would like to be able to call a subroutine with a string e.g.
>
> "x+y"
>
> and receive back an ex object containing the expression and also a
> map mapping "x" and "y" strings to symbol objects.

Well, ex::construct_from_string_and_lst(const string&, const ex&) expects
you to provide the list of symbols.

> The example program ginsh does this internally.  I think it could be
> added within the class for ex objects.  Has anyone done this?

That sounds like a promising project.  If it could parse strings like
"expand((x+y)^2)", then this would be eminently useful for creating a
decent interface for TeXmacs.  There are a number of alternatives how to
interface TeXmacs, but I'm under the impression that the cleanest way is
via a string parser right inside the library, as opposed to the one in
ginsh or yet another one outside GiNaC proper.

Regards
  -richy.
-- 
Richard B. Kreckel
<http://www.ginac.de/~kreckel/>





More information about the GiNaC-list mailing list