Meaning of .clear() for containers
"Jérôme M. Berger"
jeberger at free.fr
Thu Jan 6 10:47:11 PST 2011
Steven Schveighoffer wrote:
> I don't expect this to be a huge problem. Will people who more likely
> destroy an object with:
>
> clear(obj);
>
> or
>
> obj.clear();
>
> ? To me, the first looks like you are doing an operation to the object,
> where the second looks like you are having the object do an operation.
>
> UFC is going to cause lots of these little corner cases. Another I can
> think of is global properties. with @property foo(int x), do you call
> this as foo = 1; or 1.foo?
>
I believe this becomes a problem when you have *both* a free
standing function (to destroy the container) and a method (to empty
it). And yes, this will crop up a lot with UFC.
Jerome
--
mailto:jeberger at free.fr
http://jeberger.free.fr
Jabber: jeberger at jabber.fr
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20110106/6d73b169/attachment.pgp>
More information about the Digitalmars-d
mailing list