RosettaCodeData/Task/Copy-a-string/Maxima/copy-a-string.maxima

20 lines
493 B
Plaintext

/* It's possible in Maxima to access individual characters by subscripts, but it's not the usual way.
Also, the result is "Lisp character", which cannot be used by other Maxima functions except cunlisp. The usual
way to access characters is charat, returning a "Maxima character" (actually a one characte string). With the latter,
it's impossible to modify a string in place, thus scopy is of little use. */
a: "loners"$
b: scopy(a)$
c: a$
c[2]: c[5]$
a;
"losers"
b;
"loners"
c;
"losers"