What is the equivalent to )SI ?

General APL language issues

What is the equivalent to )SI ?

Postby PGilbert on Tue Mar 22, 2016 3:57 pm

Is it possible to get the equivalent of )SI as a system function or by code ? ⎕SI and ⎕XSI are missing the line numbers. This could be use to store the state indicator into a file when there is a bug happening in the application. Without the line numbers ⎕SI and ⎕XSI are not very useful for that purpose.

Thanks,

Pierre Gilbert
User avatar
PGilbert
 
Posts: 436
Joined: Sun Dec 13, 2009 8:46 pm
Location: Montréal, Québec, Canada

Re: What is the equivalent to )SI ?

Postby JohnS|Dyalog on Tue Mar 22, 2016 5:54 pm

⎕LC gives the line numbers, so ↓⍉↑⎕SI ⎕LC gives a vector of function-line_number pairs.
JohnS|Dyalog
 

Re: What is the equivalent to )SI ?

Postby PGilbert on Tue Mar 22, 2016 6:36 pm

Thanks John for your reply. Here is with your help what I was looking for:

      ⊃⎕XSI{⍺,'[',(⍕⍵),']'}¨⎕LC


Is this a 'safe' expression that will never bug ? Is ⎕LC will always have the same dimension as ⎕XSI ? Would it be possible to add the thread ID of each interrupted functions somewhere ?
User avatar
PGilbert
 
Posts: 436
Joined: Sun Dec 13, 2009 8:46 pm
Location: Montréal, Québec, Canada

Re: What is the equivalent to )SI ?

Postby JohnS|Dyalog on Tue Mar 22, 2016 7:53 pm

Is this a 'safe' expression that will never bug ? Is ⎕LC will always have the same dimension as ⎕XSI ?

Yes. ⎕SI and ⎕XSI were designed to be the same length as ⎕LC.
Would it be possible to add the thread ID of each interrupted functions somewhere ?

I can't think of a way to do this.
JohnS|Dyalog
 

Re: What is the equivalent to )SI ?

Postby PGilbert on Tue Mar 22, 2016 8:04 pm

Thanks John for your time.
User avatar
PGilbert
 
Posts: 436
Joined: Sun Dec 13, 2009 8:46 pm
Location: Montréal, Québec, Canada

Re: What is the equivalent to )SI ?

Postby StefanoLanzavecchia on Wed Mar 23, 2016 11:25 am

PGilbert wrote:Is it possible to get the equivalent of )SI as a system function or by code ? ⎕SI and ⎕XSI are missing the line numbers.


PGilbert wrote:Thanks John for your reply. Here is with your help what I was looking for:

      ⊃⎕XSI{⍺,'[',(⍕⍵),']'}¨⎕LC




Careful, though: ⎕SI/⎕XSI provide data only for the thread they are executed in, whereas )SI shows the stack for all of the running (or paused) threads. As far as I know, there is simply no way, to rebuild the result of )SI in code.
User avatar
StefanoLanzavecchia
 
Posts: 109
Joined: Fri Oct 03, 2008 9:37 am


Return to Language

Who is online

Users browsing this forum: No registered users and 1 guest