Based on your report (very complete, thanks) I can make a guess at the
source of the domain error.
It looks like fastincl, which was defined as
fastincl =: cmp 1 : 0
text
)
was replaced by
fastincl =: cmp fastincld4B7g0
fastincld4B7g0 =: 1 : 0
text
)
Unfortunately, the replacement was done in that order, so that at the
point fastincld4B7g0 was first encountered, it was undefined and assumed
to be a verb. Thus fastincl became defined as a verb hook. When it was
executed, the name fastincld4B7g0 was resolved, and when it turned out
not to be a verb as expected, produced domain error.
The replacement in the debugger should be only for verbs. Fixing that
will make the domain error go away, but it will not make for easy
debugging. The debugger will look up the name 'fastincl' and find that
it is not an explicit definition (it contains one, but also the
reference to cmp). That will cause fastincl to be debugged as a tacit
verb, with no access to the individual lines. I will have to think about
how to fix that problem.
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