Calling Stack

General discussions on potential enhancements to the APL+Win system.

Calling Stack

Postby Ajay Askoolum » July 18th, 2015, 3:07 am

The APL+Win stack (
Code: Select all
⎕si
) contains (some of)this information already but it is a little messy to extract the name of the calling function
Code: Select all
⎕si[⎕io+1]
and the {previous} line - the bit inside the square brackets.

Could you provide system variables

1. that contains the name of the calling function
2. the line in the calling function at which the jump took place
3. the line number that was being executed prior to the {current} line?

Why do I need this?

Items 1 & 2 just make like easier as they are already available in
Code: Select all
⎕si


Item 3 is needed. With
Code: Select all
⎕cse
, APL+Win has two execution contexts.
Code: Select all
⎕dm
provides information on the APL+Win execution context only. In order to report errors more precisely, the previous line number is needed. Let me demonstrate:

[1]
Code: Select all
→(0≠⎕cse 'ExecStmt' 'statement')↑Error

[2]
Code: Select all
→(0≠⎕cse 'ExecStmt' 'statement')↑Error

[3]
Code: Select all
→0

[4] Error: 'Error on line ' X (
Code: Select all
⎕cse 'GetLastError'
)

If I get to line [4], I need to know (the value of X) whether the error occurred on line [1] or on line[2]. That is, at line [4] I need to know the line from which the jump occurred. (I can work round this by simply recording
Code: Select all
⍬⍴⎕lc
on each of lines [1] and [2] - but that adds clutter!).
Ajay Askoolum
 
Posts: 884
Joined: February 22nd, 2007, 2:16 am
Location: United Kingdom

Return to APL+Win Wish-List

Who is online

Users browsing this forum: No registered users and 18 guests

cron