[Cuis-dev] Namespace Code Sketch
Luciano Notarfrancesco
luchiano at gmail.com
Wed Jun 10 12:31:08 PDT 2020
On Thu, 11 Jun 2020 at 1:46 AM, <ken.dickey at whidbey.com> wrote:
>
> My thought is to use a Color swatch/icon to mark Environment Class names
> and have the tooltip give the Environment name prefix. Use this in
> place of the extended name prefix to reduce clutter.
>
Sounds interesting. Anyway I would try to find a better place for things
like color or icon, perhaps in theme? Not sure, but environments seem to me
something that should be independent of GUI stuff... and I can imagine for
example that a color that works well in the default theme looks bad in a
dark theme. Just a thought.
My thought again is to allow one to use a Feature (or Feature set) to be
> imported as a (set of) Environment(s). So Packages can be used either
> way.
>
> More complex UI management, but perhaps simplifies/unifies
> description/usage of Packages.
Yes, I like it! I was thinking about allowing a package to be installed in
a namespace, and also allowing an already loaded package to be moved to a
namespace, but I never implemented this part.
Also, I tried different approaches to solve the problem of referring to
classes in a namespace from a workspace. I considered having a global
setting for a default namespace, or a local setting in each workspace, but
I didn't like either option very much. I like the idea of having
environments as globals in Smalltalk, and using the doesNotUnderstand:
mechanism for resolving, for example if you want to instantiate a Cat in an
environment called Animals, I would write in a workspace: 'Animals Cat
new'. The lookup is not super fast, but I like it because it is simple,
readable and dynamic, and I think it would be used mostly for doIts so it
doesn't need to be super fast (and there are options anyway, you can still
do 'Animals at: #Cat', or come up with a mechanism to automatically compile
the required methods, etc). Goran mentioned that Dan wanted it to work like
this too, but I don't know if he was talking about Dan Ingalls, maybe
another Dan...
In other tools like the debugger or an inspector, you know what environment
you're in (self class environment). And for the class browser, what I did
was to derive the namespace from the system category name ('Animals-Mamals'
would give you the environment Animals if it exists, allowing you to
subclass Cat for example by sending #subclass:... to the class Cat).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20200611/4fbafec3/attachment.htm>
More information about the Cuis-dev
mailing list