How to display a namespace with a double click ?

Learning APL or new to Dyalog? Ask "silly" questions here, without fear...
User avatar
PGilbert
Posts: 440
Joined: Sun Dec 13, 2009 8:46 pm
Location: Montréal, Québec, Canada

Re: How to display a namespace with a double click ?

Post 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.
User avatar
Phil Last
Posts: 628
Joined: Thu Jun 18, 2009 6:29 pm
Location: Wessex

Re: How to display a namespace with a double click ?

Post 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
Vince|Dyalog
Posts: 439
Joined: Wed Oct 01, 2008 9:39 am

Re: How to display a namespace with a double click ?

Post 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_Editor

Phil, you can use the button if you refer to your namespace and variable as #.zz.asd

I have logged this as 12127.

Regards,

Vince
User avatar
PGilbert
Posts: 440
Joined: Sun Dec 13, 2009 8:46 pm
Location: Montréal, Québec, Canada

Re: How to display a namespace with a double click ?

Post 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.
User avatar
Phil Last
Posts: 628
Joined: Thu Jun 18, 2009 6:29 pm
Location: Wessex

Re: How to display a namespace with a double click ?

Post 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.
Vince|Dyalog
Posts: 439
Joined: Wed Oct 01, 2008 9:39 am

Re: How to display a namespace with a double click ?

Post 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
Post Reply