[Poll] Idiom for saying one type is an attribute of another
Brian Rice
water at tunes.org
Fri Dec 9 18:17:06 PST 2005
-----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?
- --
- -Brian
http://tunes.org/~water/brice.vcf
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)
iD8DBQFDmjqpPVkAvLW1zf4RAgQVAJ0ZQvIiNPIO6GIV+83PRQrX1yL9hgCdE+D8
tkV4MNEVsPShW+fzYEsZvHQ=
=x/KC
-----END PGP SIGNATURE-----
More information about the Slate
mailing list