|
From: Eduardo O. <edu...@gm...> - 2024-09-23 03:47:28
|
Hi list,
is there an easy way to distinguish the symbol "foo" from the symbol
"?foo" in Maxima? The question is bad, but look at the code below...
"foo" in Maxima is "$FOO" in Lisp, and
"?foo" in Maxima is "FOO" in Lisp -
...but in Maxima the are displayed in the same way.
Thanks in advance!
Eduardo Ochs
Here is the code:
--snip--snip--
traverse_1 : lambda([o, action],
if is(action = 'op) then op(o)
elseif is(action = 'args) then args(o)
else args(o)[action])$
traverse(o, [actions]) := xreduce('traverse_1, actions, o)$
:lisp (defun foo (x) (* 10 x))
:lisp (foo 2) ;; 20
?foo(2); /* 20 */
foo(2); /* foo(2) */
bar0 : lambda([x], foo(x));
bar : lambda([x], ?foo(x));
bar(2); /* 20 */
traverse(bar); /* lambda([x], foo(x)) */
traverse(bar, op); /* lambda */
traverse(bar, args); /* [[x], foo(x)] */
traverse(bar, args, 2); /* foo(x) */
traverse(bar, args, 2, op); /* foo */
o : traverse(bar, args, 2, op); /* foo */
foo; /* foo */
:lisp $o /* FOO */
:lisp $bar0 /* ((LAMBDA SIMP) ((MLIST) $X) (($FOO) $X))
*/
:lisp $bar /* ((LAMBDA SIMP) ((MLIST) $X) ((FOO) $X))
*/
--snip--snip--
|