Dyalog / Jarvis

APL-based web service framework supporting JSON or REST
https://dyalog.github.io/Jarvis/
MIT License
33 stars 6 forks source link

Not an issue #18

Closed lstefano71 closed 4 years ago

lstefano71 commented 4 years ago

Definitely not an issue: more a curiosity. I am intrigued by this line:

https://github.com/Dyalog/Jarvis/blob/8c53cea550273fcd01b539b4bad92050f08ee4c9/Source/Jarvis.dyalog#L479

Why the #.? I have very similar code in one of my projects (unsurprisingly since I copied it from JsonServer) but I don't think I went for the "#.". Is there a good reason to create that particular namespace as a child of root? Thank you!

arcfide commented 4 years ago

The namespace is created relative to your current path, which can greatly affect your variable environment depending on the code you want to write. Using # guarantees that the namespace is created in a location that does not expose the same tree of environments that might otherwise be created.

lstefano71 commented 4 years ago

Thank you, but I know all that. I am interested specifically in why that particular namespace was created as a child of root.

On Thu, Jun 4, 2020 at 10:56 PM Aaron W. Hsu notifications@github.com wrote:

The namespace is created relative to your current path, which can greatly affect your variable environment depending on the code you want to write. Using # guarantees that the namespace is created in a location that does not expose the same tree of environments that might otherwise be created.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Dyalog/Jarvis/issues/18#issuecomment-639111848, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQLJ6RWFNV4VU6BLENGFCTRVADARANCNFSM4NSYGJVA .

-- Stefano

bpbecker commented 4 years ago

I expect the assignment to # was a remnant from earlier server versions, but it would probably make sense to make it a field inside the Jarvis instance.