9.7.1 rxapply problems

35 views
Skip to first unread message

John Baker

unread,
Apr 26, 2026, 4:59:53 PM (11 days ago) Apr 26
to forum
I posted this in the programming group a week ago but I'm not sure anyone reads that group.  Here it is again.

I came across a use of rxapply in my code that breaks in j 9.7.1

The old rxapply refers to its verb left argument with a plain u - I think j 9.7.1 needs a u.

The following tweak works for my code:

rxapply_jregex_ =: 1 : 0

:

if. L. x do. 'pat ndx'=. x else. pat=. x [ ndx=. ,0 end.

if. 1 ~: #$ ndx do. 13!:8[3 end.

mat=. ({.ndx) {"2 pat rxmatches y

r=. u.&.> mat rxfrom y  NB. change u to u.

r mat rxmerge y

)

Henry Rich

unread,
Apr 27, 2026, 2:00:40 AM (10 days ago) Apr 27
to fo...@jsoftware.com
[Does the programming forum still exist?]

Can you give a little more detail?  In particular, what is your u argument?  Give a failing case, please.

If your u was a locally-defined name in the caller, it would not be defined inside rxapply.  u. would fix that.  But I don't remember any changes in 9.7 that would affect this area.

Henry Rich
To unsubscribe from this group and stop receiving emails from it, send an email to forum+un...@jsoftware.com.

John Baker

unread,
Apr 27, 2026, 2:22:11 PM (10 days ago) Apr 27
to forum, Henry Rich
Hi Henry,

My use of rxapply followed this scenario.  It was called by a local explicit verb within a named locale. The locale held the referent to (u).

The named locale was not on the search path and the (u) verb was in the named locale so it's not surprising that rxapply could not find (u) from jregex.

By changing u to u. the verb got fixed and ran.  I tweaked my app to use the rxapply with (u.).   It seems the u. version is more general, unless there are
good reasons for keeping u a general utility like rxapply probably should use (u.).

cheers

Henry Rich

unread,
Apr 27, 2026, 3:27:35 PM (10 days ago) Apr 27
to John Baker, forum
That makes sense. That is exactly what u. was created to fix. If your u is just an explicit verb you could also use (name f.) as the argument to rxapply. 

It is up to Chris & Bill to decide whether to put this change in. 

Henry Rich


bill lam

unread,
Apr 27, 2026, 6:57:39 PM (10 days ago) Apr 27
to fo...@jsoftware.com
If u. can work where u can't. What is the purpose of having u in J language?

Henry Rich

unread,
Apr 28, 2026, 2:27:28 AM (9 days ago) Apr 28
to forum
* u can be a noun or a verb
* u is stacked by value, u. is a reference 
* If you need the value, perhaps to compare, u is necessary
* if you need to execute the verb, u. is better

Henry Rich

bill lam

unread,
Apr 28, 2026, 9:48:21 AM (9 days ago) Apr 28
to fo...@jsoftware.com, John Baker
I check that line was u in the base library since at least from year 2019.

On Tue, Apr 28, 2026 at 3:27 AM Henry Rich <henry...@gmail.com> wrote:
>

Henry Rich

unread,
Apr 28, 2026, 10:40:50 AM (9 days ago) Apr 28
to forum, John Baker
Yes, u is the old way to do it, but it doesn't work with locally-defined names. u. should be better, but might be worth a beta first. 

Henry Rich

bill lam

unread,
Apr 28, 2026, 11:57:55 AM (9 days ago) Apr 28
to fo...@jsoftware.com
I am puzzled why John Baker said u worked until J9.7 ?  The base library didn't change so that the change must inside JE or his own code.

I don't think base library needs change from u to u. if it is not broken.

John Baker

unread,
Apr 28, 2026, 12:05:11 PM (9 days ago) Apr 28
to fo...@jsoftware.com, fo...@jsoftware.com

Bill, I only recently noticed the rxapply u.  It’s possible it worked like this in earlier versions of J and I never noticed. 

On Apr 28, 2026, at 09:57, bill lam <bbil...@gmail.com> wrote:



Henry Rich

unread,
Apr 28, 2026, 12:14:43 PM (9 days ago) Apr 28
to forum
What does 'broken' mean? With u, rxapply fails when you give it a local name. If that's not broken, it's at least fractured. Then again it's scary to change so venerable a function. 

Is it possible to change to u. in such a way that the change is picked up only for 9.8 and later? That would give time to shake the change down. 

Henry Rich
Reply all
Reply to author
Forward
0 new messages