The module m below displays in the same way as its member m:-a, but with square (list) brackets around it.
>
|
m := module()
export a;
local ModulePrint := proc()
return [print_preprocess(a)];
end proc;
end module:
|
>
|
|
The function foo(...) displays in reverse.
>
|
`print/foo` := proc()
local oof, i;
return oof(seq(print_preprocess([_passed][i]), i = _npassed .. 1, -1));
end proc:
|
>
|
|
Use lprint to see the actual result of print_preprocess. Here, the outer list was produced by the ModulePrint procedure, and the oof(...) structure by `print/foo`, which in turn was called as a result of the call to print_preprocess within ModulePrint:
>
|
|
Since lprint itself does not perform print preprocessing, it can also be used to see what the actual expression looks like:
module () local ModulePrint; export a; ModulePrint := proc () return [print_preprocess(a)] end proc; a := foo(1,2); end module
| |