Re: beginner’s question with Maxi ma
Stavros Macrakis <[email protected]>
| Newsgroups | gmane.comp.mathematics.maxima.general |
|---|---|
| Message-ID | <CACLVabV7Uv+vL2CZrpP8vpPpo9i1D0bxp__WRUvpzRxKKD-OXg@mail.gmail.com> |
Some comments...
If you declare("-",alphabetic), you can avoid problems by writing a space
before and after the minus sign, e.g., *- a* and *a - b* rather than *-a*
and *a-b*.
It's nice to see someone taking advantage of Maxima's extensible syntax, but
declaring standard operator characters to be alphabetic is bound to cause
problems:
- Maxima's output form doesn't take it into account, so you can't use
*save/load*.
declare("-",alphabetic)$
string(a - b) >>> a-b (a symbol, not an expression)
parse_string(string(a - b))+b >>> b + a-b
op(parse_string(string(a - b))) >>>
part: argument must be a non-atomic expression; found a-b
- Libraries written in the Maxima language are likely not to read in
correctly.
- It's confusing for users that 3e-3 is a number, but -3e-3 is a symbol
(the "-" in the exponent is handled by the number parser, which ignores the
alphabetic declaration).
It's better practice to write bigfloat numbers in bigfloat notation
directly, e.g., *1.234b-3, *or to convert exact numbers, e.g., *bfloat(1234
* 10^ - 6), *instead of converting floating-point numbers, e.g.,
*bfloat(1.234e-3)*. In your particular example, though, float precision is
enough, so it doesn't matter.
I don't understand why you're writing S as a memoizing function.
-s
_______________________________________________
Maxima-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maxima-discuss