Page 2 of 2
Re: How to display a namespace with a double click ?
Posted: Thu Apr 09, 2015 9:40 pm
by PGilbert
I have another question regarding the edition of a namespace. If I do:
ns←⎕ns''
ns.Title←'title1' 'title2' 'title3'
ns.ID←100 101 102
When I go with the editor the values of
ns.ID are read only (cannot be changed) and the value of
ns.Title can be edited. Question: Why the
editor cannot edit all the type of data of the namespace ?
I have tried also with the editor of David Liebtag and I am getting the message: ⎕SE.NumEd.numed: #.ns is not a valid variable.
Re: How to display a namespace with a double click ?
Posted: Fri Apr 10, 2015 7:17 am
by Phil Last
The failing of the editor to edit any arrays other than text strings, text matrices and lists of text strings is so old that everyone has forgotten it
is a failing. The NumEd facility (look for the icon of a grid in the session menu) was added decades ago as a stop-gap. I haven't tried David's editor but I guess it is apparent that David did not consider (or considered it to be too hard or unnecessary) to edit items in unnamed spaces. Nor it seems has Dyalog enhanced NumEd to edit arrays in spaces. Even named ones.
'zz'⎕ns''
zz.asd←2 3⍴⍳6
⎕SE.NumEd.numed: cursor not over a valid name
An effort was made by Dyalog a few years ago to level the playing field between named (dyadic ⎕NS) and unnamed (monadic ⎕NS) spaces but they are still not the same in a number of ways and are destined never to be so.
Also Dyalog's short-lived experimental interpreter APL# (APLSharp) was designed to make all spaces unnamed and indeed non-hierarchical.
One solution to all this would be to come up with a notation for embedding higher dimensional arrays in code.
http://archive.vector.org.uk/art10501450
Re: How to display a namespace with a double click ?
Posted: Fri Apr 10, 2015 11:20 am
by Vince|Dyalog
Hi Pierre and Phil,
numed: I think it's a limitation of our button callback code rather than David Liebtag's Array Editor. In Dyalog 14.0 onwards, you can directly edit ns.ID with a usercommand:
]array.edit ns.ID
You can also call David Liebtag's Array Editor directly:
http://help.dyalog.com/14.0/Content/Use ... ray_EditorPhil, you can use the button if you refer to your namespace and variable as #.zz.asd
I have logged this as 12127.
Regards,
Vince
Re: How to display a namespace with a double click ?
Posted: Fri Apr 10, 2015 11:51 am
by PGilbert
Thanks for the education Phil and Vince. It would be nice if David Liebtag's Array Editor would handle simple namespaces as well.
Re: How to display a namespace with a double click ?
Posted: Fri Apr 10, 2015 9:02 pm
by Phil Last
Yes, thanks Vince for that. I should've guessed it wouldn't handle relative paths.
But still won't work if space is unnamed.
Re: How to display a namespace with a double click ?
Posted: Mon Apr 13, 2015 10:01 am
by Vince|Dyalog
Hi Phil,
For an unnamed namespace, I think this would do it:
Code: Select all
∇ unnamed;arrayeditwithtitle;width
[1] ⎕CS ⎕NS''
[2] numarr←1 2 3
[3]
[4] width←{(⍵=64)/⍕⍵}{z←⍵ ⋄ 2×⍬⍴⎕SIZE'z'}⍬
[5] 'arrayeditwithtitle'⎕NA'dlaedit',width,'.dll|DyalogEditArrayTitle <pp >pp <0C2[]'
[6] numarr←arrayeditwithtitle numarr 0 'my numvec'
[7]
[8]
[9] ⎕←numarr
∇
Regards,
Vince