help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] Re: Dictionary>>#addAll: fails


From: Jānis Rūcis
Subject: [Help-smalltalk] Re: Dictionary>>#addAll: fails
Date: Fri, 30 Mar 2007 19:13:19 +0300
User-agent: Icedove 1.5.0.10 (X11/20070307)

Stephen Compall wrote:
>> I think the "this message expects a literal" thing is pretty weird.
> 
> The idea is to get the user thinking in terms of what good brace-syntax
> for instances would be.

I understand that, and actually having thought about it, it seems that I
was just confused by the documentation.  I would suggest:

    "Answer a new instance of Dictionary initialized from the keys and
    values of Associations in anArray.  This method is for convenience
    only;  it allows its argument to be conveniently specified as a
    braced Array literal that is structured accordingly:  {'key' ->
    'value'. 'another key' -> 'another value'}."

And maybe suggest that any other usage is considered "misuse" and is
"strongly discouraged or bad things will happen"...  :)  Basically I
think it should make it very clear that it's there for convenience.
That would also explain why Array>>#from: answers its argument instead
of a new instance, which seems inconsistent with Collection and Dictionary.

Jānis




reply via email to

[Prev in Thread] Current Thread [Next in Thread]