Also, if you run code from the clipboard, the cursor ends up positioned at the 
end of the last line of  clipboard text, not on a following line as in previous 
versions of J.

--- Brian

________________________________
From: Beta <[email protected]> on behalf of Jan-Pieter Jacobs 
<[email protected]>
Sent: Wednesday, March 24, 2021 5:49 PM
To: [email protected] <[email protected]>
Subject: [External][Jbeta] Bug? locale + inverse

Hi all,

In view of the dict add-on I wrote about recently (see [1]) I don't
understand why the inverses won't work for verbs in the class/locale below.
I would expect that if a verb having an inverse (e.g. {&vals@(keys&i.) )
containing more defined verbs (all in the same locale) works, its inverse
would also work.

This turns out to be wrong, so I wonder whether this is intended, or a bug,
and if intended, what use the present behaviour has:

NB. Test class

coclass 'cl'

create =: 3 : 0

'keys vals' =: y

gi =: keys&i. NB. Get indices

fv =: {&vals

0 0$0

)


get =: fv@gi NB. works but NOT inverse


cgi =: a.&i. NB. constant keys, defined class wide

cfv =: {&(i.256) NB. constant values

cget =: cfv@cgi NB. constant get, works but NOT inverse

aio =: {&(i.256)@(a.&i.)NB. all in one works ALSO inverse

fcget =: cfv@cgi f. NB. Also works both ways

lat =: 2 : 'u. @ v.' NB. localized @

aget =: cfv lat cgi NB. works, but NOT inverse.


d =: codestroy


cocurrent 'base'


o =: 'cl'conew~ 'abcd';i.4


get__o 'ac' NB. fine

get__o inv 1 3 NB. not ok.


cget__o 'ac'

cget__o inv 97 99 NB. not ok


fcget__o 'ac'

fcget__o inv 97 99 NB. works


aio__o 'ac'

aio__o inv 97 99 NB. works


aget__o 'ac'

aget__o inv 97 99 NB. not ok.

The fcget and aio do not need lookups and just work as intended, The others
work in one way, but not the inverse. It does not seem to be a problem
between the class locale and the object locale, because then cget would
work while get wouldn't.
Using, out of curiosity a "localized" version of at , using u./v. does not
resolve the problem either.

Fixing all verbs solves the issue but in my usecase, the problem is
occasionally, keys and vals are updated, which would require all verbs
using them to account for this, and it would feel messy to me, for
something I expected to just work. Or perhaps, I've gotten too used to J
being 100% logical...

What do you think? (this is in J903 beta-f on Linux 64 AVX).
Thanks,
Jan-Pieter
[1]: 
https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fjsoftware.com%2Fpipermail%2Fprogramming%2F2021-March%2F057881.html&amp;data=04%7C01%7Cmcguinne%40fdu.edu%7C8f0e8a58aee5464822ad08d8ef0ebc2a%7C3224fad94bcc4d47ae9886ea3c6b3b13%7C1%7C0%7C637522193865005229%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=PhNhXoY2z7St1w2QZwizs5vR6pnGTKEEhg8%2BilUP2o4%3D&amp;reserved=0
----------------------------------------------------------------------
For information about J forums see 
https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.jsoftware.com%2Fforums.htm&amp;data=04%7C01%7Cmcguinne%40fdu.edu%7C8f0e8a58aee5464822ad08d8ef0ebc2a%7C3224fad94bcc4d47ae9886ea3c6b3b13%7C1%7C0%7C637522193865005229%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=UCA7lVf05Svsp6LAET%2F2eTUwsx0Bglel0r8azcTvPXc%3D&amp;reserved=0
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to