help-smalltalk
[Top][All Lists]
Advanced

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

[Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary>>#a


From: parasti
Subject: [Help-smalltalk] CharacterArray class>>#lineDelimiter and Dictionary>>#addAll: both fail
Date: Tue, 20 Mar 2007 13:54:06 +0200
User-agent: Icedove 1.5.0.9 (X11/20061220)

This is with 2.3.3.  I noticed that #lineDelimiter fails when sent to
the class it's defined in, CharacterArray:

    st> CharacterArray lineDelimiter!
    Object: CharacterArray new: 1 "<-0x5c60cd20>" error: Invalid
    argument : argument must be between 0 and 4294967295
    SystemExceptions.ArgumentOutOfRange(Exception)>>#signal
    SystemExceptions.ArgumentOutOfRange(Exception)>>#signal:
    SystemExceptions.ArgumentOutOfRange class>>#signalOn:mustBeBetween:and:
    CharacterArray(Object)>>#checkIndexableBounds:put:
    CharacterArray(Object)>>#at:put:
    CharacterArray class(ArrayedCollection class)>>#with:
    CharacterArray class>>#lineDelimiter

Seeing that it works with most subclasses, I guess it makes sense to put
the method in a common parent class, but there's no documentation that
says "don't use this here, use with String (or other subclass) instead".

Also, #addAll: doesn't work on Dictionaries:

    st> Smalltalk at: #a put: (Dictionary new add: 1 -> 'one'; yourself)!
    st> Smalltalk at: #b put: (Dictionary new add: 2 -> 'two'; yourself)!
    st> a addAll: b!
    Object: 'two' error: did not understand #key
    MessageNotUnderstood(Exception)>>#signal
    String(Object)>>#doesNotUnderstand:
    Dictionary>>#add:
    optimized [] in Collection>>#addAll:
    [] in Dictionary>>#do:
    Dictionary(HashedCollection)>>#do:
    Dictionary>>#do:
    Dictionary(Collection)>>#addAll:

I believe it should iterate directly over elements and not their values.

Best,
Jānis





reply via email to

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