c-code generation



Hello Robert,

On Tue, Dec 19, 2006 at 01:45:17PM -0700, Robert Dodier wrote:
> Johannes,
> 
> >Unfortunately, C does not allow to use e.g. %5 as a variable name,
> >so currently I need to run the result through "sed s/%/_/g".
> >Any ideas how to replace the % characters in maxima?
> 
> Try ssubst in the stringproc package. e.g.
> 
> load (stringproc);
> ssubst ("a", "b", "Foobar");
>  => Fooaar
> 
> Note that the arguments must be strings, so if you are trying to
> sanitize a symbol I guess you want something like
> 
> ssubst ("pct", "%", string ('%o5));
>  => pcto5

That did the trick. Thanks,
Johannes

> 
> Hope this helps
> Robert Dodier