[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary
From: |
Stephen Compall |
Subject: |
Re: [Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary>>#addAll: both fail |
Date: |
Thu, 22 Mar 2007 18:25:39 -0500 |
On Tue, 2007-03-20 at 14:54 +0100, Paolo Bonzini wrote:
> > Also, #addAll: doesn't work on Dictionaries:
> >
> > I believe it should iterate directly over elements and not their values.
>
> It should use #keysAndValuesDo:, indeed.
Its current meaning lends itself to the extremely convenient
Dictionary withAll: {#a -> 1. #b -> 2}.
as class>>withAll: is defined as something like "self new addAll: arg".
I prefer the semantics of addAll: to definitely be "arg do: [:each|self
add: each]", but this would change or be special-cased if you could
addAll: aDictionary in the manner parasti speaks of.
Perhaps a new method, like addAllAssociations:, which would be
semantically equivalent to "arg associationsDo: [:assoc|self at: assoc
key put: assoc value]", would be more appropriate?
--
;;; Stephen Compall ** http://scompall.nocandysw.com/blog **
"Peta" is Greek for fifth; a petabyte is 10 to the fifth power, as
well as fifth in line after kilo, mega, giga, and tera.
-- Lee Gomes, performing every Wednesday in his tech column
"Portals" on page B1 of The Wall Street Journal
signature.asc
Description: This is a digitally signed message part
- [Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary>>#addAll: both fail, parasti, 2007/03/20
- Re: [Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary>>#addAll: both fail, Paolo Bonzini, 2007/03/20
- Re: [Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary>>#addAll: both fail,
Stephen Compall <=
- Re: [Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary>>#addAll: both fail, Jānis Rūcis, 2007/03/22
- Re: [Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary>>#addAll: both fail, Stephen Compall, 2007/03/22
- Re: [Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary>>#addAll: both fail, Paolo Bonzini, 2007/03/23
- Re: [Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary>>#addAll: both fail, Jānis Rūcis, 2007/03/23
- Re: [Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary>>#addAll: both fail, Paolo Bonzini, 2007/03/23
- Re: [Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary>>#addAll: both fail, Jānis Rūcis, 2007/03/23
- Re: [Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary>>#addAll: both fail, Paolo Bonzini, 2007/03/23
- Re: [Help-smalltalk] Dictionary>>#addAll: fails, Stephen Compall, 2007/03/23
- [Help-smalltalk] Re: Dictionary>>#addAll: fails, Paolo Bonzini, 2007/03/26
- [Help-smalltalk] Re: Dictionary>>#addAll: fails, Stephen Compall, 2007/03/29