⎕SI in DFNS : help
Posted: Fri Nov 04, 2011 10:20 am
Not able to understand the behaviour of ⎕SI and ⎕STACK in defined functions.
I prepared the following:
and executed
TOPFN ''
The result is (Dyalog 13/Classic 32):
Here the state indicator stack looks like correct, the state indicator is not aligned.
Please note that the function CALLED2 is local to CALLED1.
Thank you for help.
I prepared the following:
⍝
TOPFN←{
⎕←'§§§§§§§§§§§§§§'
⎕←'⎕SI at level 0:',⎕SI
⎕←'⍴⎕LC:',(⍴⎕LC),' ⊃⍴⎕STACK:',⊃⍴⎕STACK
⎕←⎕STACK
CALLED1←{
⎕←'§§§§§§§§§§§§§§'
⎕←'⎕SI at level 1:',⎕SI
⎕←'⍴⎕LC:',(⍴⎕LC),' ⊃⍴⎕STACK:',⊃⍴⎕STACK
⎕←⎕STACK
CALLED2←{
⎕←'§§§§§§§§§§§§§§'
⎕←'⎕SI at level 2:',⎕SI
⎕←'⍴⎕LC:',(⍴⎕LC),' ⊃⍴⎕STACK:',⊃⍴⎕STACK
⎕←⎕STACK
⍵
}
CALLED2 ⍵
}
CALLED1 ⍵
}
and executed
TOPFN ''
The result is (Dyalog 13/Classic 32):
⍝
§§§§§§§§§§§§§§
⎕SI at level 0: TOPFN
⍴⎕LC: 1 ⊃⍴⎕STACK: 2
∇TOPFN
*
§§§§§§§§§§§§§§
⎕SI at level 1: TOPFN
⍴⎕LC: 1 ⊃⍴⎕STACK: 3
∇CALLED1
∇TOPFN
*
§§§§§§§§§§§§§§
⎕SI at level 2: TOPFN
⍴⎕LC: 1 ⊃⍴⎕STACK: 4
∇CALLED2
∇CALLED1
∇TOPFN
*
Here the state indicator stack looks like correct, the state indicator is not aligned.
Please note that the function CALLED2 is local to CALLED1.
Thank you for help.