I don't know about the domain error.  I can explain the name, though perhaps not justify it in this case:

Only named entities can be debugged line-by-line.  If you have a verb like

unnamed =: 3 : 0"0
text
)

it doesn't play well with the debugger, because the inner verb has no name (the verb 'unnamed' is a compound).  The debugger tries to make things better by looking for verbs whose definition contains ':' and quietly splitting those into parts, assigning each part to a name, and putting them back together.  So the debug code would reassign so that

unnamed =: unnamedd4B7g0"0
unnamedd4B7g0 =: 3 : 0
text
)

which will debug much better.

I think the debugger is doing that here, because 'fastincl' will contain a ':' in its definition.  The rewriting doesn't accomplish much in this case.

Henry Rich

On 7/10/2019 3:20 AM, 'Mike Day' via Programming wrote:
It's the odd name and the fact that a domain error doesn't arise if you just run the phrase.

For the sake of this reply,  I've just opened up a new JQt session, and a new script, pasting in the defs I'd listed earlier, then loading and running as described below.

Here's the script,  with the notated session output appended, at NB. ####...,
all below this sign-off.
Cheers,
Mike

NB. copy of minimal script and session output

fastmax=: 1 : 0
 B=. C=. 1"_1 y
 while. +./C do.
  i=. C i.1
  B=. 0 i} B
  B=. -.@:u&(i{y)&.(B&#) y
  C=. C *. B
  B=. 1 i} B
 end.
 B#y
)

cmp=: +./@E.&>

fastincl=: cmp fastmax

NB. #############################################################
NB. notated copy of session
   load 'c:/d/j807/user/temp/215.ijs' NB. minimal script

   NB. running without debug
   fastincl 'abcde'
abcde
   (cmp fastmax) 'abcde'
abcde


   NB. invoke debug with Run/Debug OR ctrl-K
   NB. In debug window, select "fastmax" using "Stop Manager",
   NB. and choose "Stop All Lines"

   NB. Invoke it as follows:

   NB. a) indirectly via "fastincl",  the derived verb, on any string

   fastincl 'abcde'

   NB. immediate display in "debug"   ...
   NB. top output pane:
   NB.  >[0] cmp fastincld4B7g0  NB. Where does this name arise?

   NB. other two panes show:

   NB.   domain error
   NB.   fastincl[header] cmp fastincl

   NB.   cmp v +./@E.&>
   NB.   fastincl v cmp fastincld4B7g0

   NB. check names

  names 3
cmp      fastincl
   names 1    NB. what is fastincld4B7g0 ?!?!
fastincld4B7g0 fastmax

   clear''
   names 1


   load 'c:/d/j807/user/temp/215.ijs'
   NB. set up "debug" as before

   NB. rerun with (cmp fastmax) rather than "fastincl"
   (cmp fastmax) 'abcde'  NB. can step through line by line in "debug" as usual




On 10/07/2019 00:43, Henry Rich wrote:
I haven't tried to recreate this yet, but: what is the problem? Should it not get a domain error?  Or is it the odd name 'fastincld4B7g0'?

Henry Rich

On 7/9/2019 6:35 PM, 'Mike Day' via Programming wrote:
9.0 beta and 8.07 - JQt -Windows 10
M
       Sent from my iPad

On 9 Jul 2019, at 23:32, bill lam <bbill....@gmail.com> wrote:

what is the JVERSION ?

On Wed, Jul 10, 2019, 1:27 AM 'Mike Day' via Programming <
programm...@jsoftware.com> wrote:

Something for Henry, I think.

Starting to have a look at Louis' variants on Vadim's approach,  I tried
using debug on "fastincl" , invoked by ctrl-K.

Setting stop on all lines in either fastincl =: cmp fastmax
or in fastmax and then running
    fastincl lines
results in
"
domain error

fastincl[header] cmp fastincl

"

in debug's middle pane,

with

"

[0] cmp fastincld4B7g0
"

displayed in the top pane

The lowest pane displays:

"

cmp v +./@E.&>

fastincl v cmp fastincld4B7g0

"


This happens in both J 9.01 beta and J 8.07,  under Windows 10 .

Debug seems ok however when explicitly running "(cmp fastmax) lines "

So it's probably something to do with fastmax being an adverb,  but here
are
Louis' definitions to save hunting for them in the correspondence:

fastmax=: 1 : 0
  B=. C=. 1"_1 y
  while. +./C do.
   i=. C i.1
   B=. 0 i} B
   B=. -.@:u&(i{y)&.(B&#) y
   C=. C *. B
   B=. 1 i} B
  end.
  B#y
)

cmp=: +./@E.&>

fastincl=: cmp fastmax

debug behaves just the same for

    fastincl 'abc'

so I won't bother defining "lines" here.

This is probably known behaviour,  but it's new to me!

Thanks,

Mike



---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm


---
This email has been checked for viruses by AVG.
https://www.avg.com

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to