Profiling Dfns

General APL language issues

Profiling Dfns

Postby paulmansour on Sun Mar 19, 2023 6:26 pm

A long time ago dfns were not included in ⎕Profile in certain circumstances. Currently the only exception seems to be named dfns inside trad functions, otherwise they seem to well covered. However, it appears that lines with a trailing brace, or a trailing brace with a right argument in the case a dfn inside a trade fn, are not recorded as having been executed:

In a plain dfn:

      ⎕PROFILE 'clear'
⎕PROFILE 'start' 'coverage'
Dfn2 0
3
⎕PROFILE 'data'
#.Provanto.Tests.OtherFunctions.Dfn2 1 0 0 0 0
#.Provanto.Tests.OtherFunctions.Dfn2 0 1 0 0 0 0
#.Provanto.Tests.OtherFunctions.Dfn2 1 1 0 0 0 0
#.Provanto.Tests.OtherFunctions.Dfn2 2 1 0 0 0 0
#.Provanto.Tests.OtherFunctions.Dfn2 3 1 0 0 0 0
⎕VR 'Dfn2'
∇ Dfn2←{
[1] a←1
[2] b←2
[3] ⍵+a+b
[4] }


And an unnamed dfn inside a trad fn:

      ⎕PROFILE 'clear'
⎕PROFILE 'start' 'coverage'
DfnInTrad2 0
10
⎕PROFILE 'data'
#.Provanto.Tests.OtherFunctions.DfnInTrad2 1 0 0 0 0
#.Provanto.Tests.OtherFunctions.DfnInTrad2 0 1 0 0 0 0
#.Provanto.Tests.OtherFunctions.DfnInTrad2 1 1 0 0 0 0
#.Provanto.Tests.OtherFunctions.DfnInTrad2 2 1 0 0 0 0
#.Provanto.Tests.OtherFunctions.DfnInTrad2 3 1 0 0 0 0
#.Provanto.Tests.OtherFunctions.DfnInTrad2 4 1 0 0 0 0
#.Provanto.Tests.OtherFunctions.DfnInTrad2 5 1 0 0 0 0
#.Provanto.Tests.OtherFunctions.DfnInTrad2 7 1 0 0 0 0
⎕VR 'DfnInTrad2'
∇ z←DfnInTrad2 x;r
[1] r←{
[2] a←1
[3] b←2
[4] c←3
[5] ⍵+c
[6] }x+7
[7] z←r
paulmansour
 
Posts: 430
Joined: Fri Oct 03, 2008 4:14 pm

Re: Profiling Dfns

Postby Vince|Dyalog on Tue Mar 21, 2023 10:58 am

Hi Paul,

Thanks for reporting this.

I have logged this as 20429.

Regards,

Vince
Vince|Dyalog
 
Posts: 432
Joined: Wed Oct 01, 2008 9:39 am


Return to Language

Who is online

Users browsing this forum: Google [Bot], Morten|Dyalog and 1 guest