Post Reply 
logging a function's argument
09-25-2022, 07:40 PM
Post: #1
logging a function's argument
With the 50g, it was possible to have a function with the side effect of logging the argument by appending it to a list. Say something like this.

Code:

XARG
<< ->  X
  << 'XLST' X STO+ X >> 
>>

where 'XLST' starts out as an empty list.

My motivation for such a function was to explore certain algorithms such as numeric solving and numeric integration. Afterwards, I could look at the 'XLST' to see what the algorithm did. It worked like a charm.

My attempts for doing the same with the Prime have been less successful. I tried

Code:
EXPORT XARG(x)
BEGIN
 L1:=CONCAT(L1,x);
 RETURN x;
END;

and
Code:
#cas
xarg(x):=
BEGIN
 L1:=CONCAT(L1,x);
 RETURN x;
END;
#end

These work fine when executed directly from the command line. But when used within fsolve() or int(), neither works as hoped.

Any ideas on how to make this work?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
logging a function's argument - Wes Loewer - 09-25-2022 07:40 PM



User(s) browsing this thread: 1 Guest(s)