Thoughts About Dyalog Namespaces

Dick Bowman (12 January 2004)

Generally

I started using namespaces as soon as they became part of the APL/W product what they did for me was to let me partition my application workspaces so that I had manageable chunks for each logical part of the application, and a set of utility namespaces similarly split apart.

I tend to write lots of small functions rather than a few large ones so the benefit was greater and I also gained from being able to hide detail (if something was being achieved with lots of secondary calls the clutter was hidden away).

Mostly my APL/W applications have namespaces each with no more than a few dozen objects in each and my approach is consistent whether I'm reading code in from function files or just working with a static workspace.

Syntax

The )CS and )NS (and corresponding quadCS, quadNS) didn't feel "right" at first but I've got used to them and while I treasure innovation I think there's also a lot to be said for people expending APL in a consistent way - it would be goof for other vendors considering adding namespaces to their interpreter to do it as similarly to Dyalog as possible.

Something that doesn't seem to have been provided thoughtfully is a way of referring to "this" namespace (quadCS '' doesn't quite feel thought through) perhaps APL is generally missing the "me" or "self" concepts that some of the OO languages have. The use of "del" in dynamic functions is perhaps a step in the right direction (and dynamic functions are a Good Thing).

Why Is Everything a Namespace?

I think this is what bugs me most about APL/W, and it's perhaps a sign that I don't understand all I should about the way programming seems to be going. I can't see why everything (arbitrary collections of functions, forms, controls on forms) all sits there with nameclass 9. There seem to be ways of folding code into form definitions, but I haven't done it myself (or seen it done in practice).

Given the choice (and I don't) I'd keep compartmentalising workspaces quite distinct from defining GUI objects to me they should be separate nameclasses but maybe there are architectural reasons I don't comprehend. I'd make a similar criticism of APLX quadWI which also seems to be a sort of all-purpose catchall (again, I may just fail to see the underlying structure but quadWI to make GUI objects feels like a different sort of job than communicating with other APL sessions). Perhaps it's a bit like IBM using shared variables every time they needed something new.

Dot Syntax

Using the recent dot syntax is a real step forward maybe it's inseparable from having namespaces be everything. Changing an application from quadWG and quadWS (with everything in quotes) to dot-notation made a real step forward in readability (and I'm sure it makes APL look much more sensible to the outside world).

Minor Puzzles

What on earth were they thinking about when they introduced unnamed namespaces? The concept seems so opaque, and it's certainly led to bizarre problems with mistypes (how exactly are you supposed to expunge an unnamed object you just made by mistake?).

It seems that the ideas have recently run away with themselves but that's just my simple opinion. I like what namespaces to deal with the simple problem of breaking down applications into separate and non-interfering parts. Some of the chatter about recently-introduced features leave me cold but that may just be my opinion.

Copyright Dogon Research Ltd. 2004