Hmm.. actually, this does look like a flaw in stringreplace, in the
sense that stringreplace currently supports replacing the empty string
with a non-empty string. However, I have not yet thought of a simple
way to reproduce the index error.
But, I did run into another issue, which might be related:
('';'*';'a';'AA') stringreplace 'abc'
*a*b*c
('a';'AA';'';'*') stringreplace 'abc'
AA*b*c
Here, I expected to get the same result from both expressions.
(That said, in my context, I should not have been replacing empty
strings. So that's still on me.)
FYI,
--
Raul
On Fri, Mar 11, 2022 at 1:16 PM Raul Miller <[email protected]> wrote:
>
> Ah, that is a bug in my code, then.
>
> And presumably every time it's replacing a null string, it's doing it
> for every null string in the target. So... almost certainly not a bug
> in stringreplace.
>
> Sorry about the noise,
>
> --
> Raul
>
> On Fri, Mar 11, 2022 at 12:37 PM Henry Rich <[email protected]> wrote:
> >
> > It fails on my system too. I observe that some of the replace strings
> > are null:
> >
> > <./ #@> _2 ]\ X
> > 0 13
> >
> > I don't know what stringreplace would do with that.
> >
> > Henry Rich
> >
> >
> > On 3/11/2022 11:47 AM, Eric Iverson wrote:
> > > Raul,
> > > Beta is a good place, at least for now. Is this with a custom build JE?
> > > First step is to see if it fails in an official 903 release.
> > >
> > > On Fri, Mar 11, 2022 at 11:26 AM Raul Miller <[email protected]>
> > > wrote:
> > >
> > >> I ran into a bizarre error in stringreplace while working on
> > >> converting dictionary content to wiki format:
> > >>
> > >> |index error: stringreplace
> > >> | rep ind}exp#txt
> > >>
> > >> #rep
> > >> 323777
> > >> #ind
> > >> 323777
> > >> $txt
> > >> 12253
> > >>
> > >> That said, I have been experiencing odd problems with my machines
> > >> recently, so before I spend too much time on this: can anyone else
> > >> reproduce the problem?
> > >>
> > >> Here's a script which triggers this error for me:
> > >>
> > >> https://gist.github.com/rdm/bf14417a605849ba61e397f888ace8c5
> > >>
> > >> (Also... is the beta forum the right forum for this kind of thing?)
> > >>
> > >> Thanks,
> > >>
> > >> --
> > >> Raul
> > >> ----------------------------------------------------------------------
> > >> 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