[Poll] Idiom for saying one type is an attribute of another
Waldemar Kornewald
wkornew at gmx.net
Sat Dec 10 08:09:55 PST 2005
Hi,
&context: sounds okay, but I have to think of more than a simple
back-link when I hear this word. &namespace: sounds like it would only
work on namespaces. What about &backLink: (*not* taking a Boolean, but
the backLink prototype/namespace)?
Bye,
Waldemar
Brian Rice wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi again,
>
> So I'm thinking about our "attribute types", where we have e.g. a
> ReadStream defined on the traits of some other prototype, like our
> collections and files and sockets and so forth. I got the idea that
> there should be a single idiom for all of this, just so it's
> encapsulated and we have just a little less code lying about to make
> up for it.
>
> For example, if we have a type "A B C" and from a method defined on
> C, we want to make a new "A D", we have to use the canonical path "A
> D" to refer to it. Instead, I'm thinking that methods on C should
> (when deemed appropriate by the designer) be able to go up that tree
> to use things.
>
> Now, here's the question: how do I want to express this?
>
> My gut instinct is to add another optional keyword to define: called
> something like &parent:, but definitely not exactly that because it
> would look like an inheritance option, which would be terribly
> confusing. Other name options are &namespace: or &context:. I would
> also name the method the same as the optional.
>
> Another option I considered was to have a &linkBack: Boolean option
> where it would define a method (of whatever name we choose) to access
> the first argument of define: (as in "collections define:
> #Set ...&linkBack: True" would define a method to access collections
> from Set) from the result. But this is too limiting since it ignores
> that there can be traits objects in between, as for the "Set traits
> ReadStream" type of paths.
>
> Opinions? Ideas?
More information about the Slate
mailing list