SequenceableCollection new

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

SequenceableCollection new

Wolfgang Dann
Hi,

I'm new to smalltalk, so perhaps I did something wrong.

SequenceableCollection new does not return instead the
system hangs.

The documentation says I have to use #new instead of #new:.

Regards



_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: SequenceableCollection new

Holger Freyther
On 04/06/2011 12:34 PM, Wolfgang Dann wrote:
> Hi,
>
> I'm new to smalltalk, so perhaps I did something wrong.
>
> SequenceableCollection new does not return instead the
> system hangs.

interesting. OrderedCollection new (and is a subclass of it) is working though.

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: SequenceableCollection new

Wolfgang Eder
In reply to this post by Wolfgang Dann
hi wolfgang,
try OrderedCollection new
instead
kind regards
wolfgang

On 06.04.2011 12:34, Wolfgang Dann wrote:

> Hi,
>
> I'm new to smalltalk, so perhaps I did something wrong.
>
> SequenceableCollection new does not return instead the
> system hangs.
>
> The documentation says I have to use #new instead of #new:.
>
> Regards
>
>
>
> _______________________________________________
> help-smalltalk mailing list
> [hidden email]
> http://lists.gnu.org/mailman/listinfo/help-smalltalk
>


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: SequenceableCollection new

Holger Freyther
On 04/06/2011 01:06 PM, Wolfgang Eder wrote:
> hi wolfgang,
> try OrderedCollection new

do you know/understand what is causing this issue? It seems stuck in the VM/C
code.

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: SequenceableCollection new

MrGwen
On 04/06/2011 01:20 PM, Holger Hans Peter Freyther wrote:

> On 04/06/2011 01:06 PM, Wolfgang Eder wrote:
>> hi wolfgang,
>> try OrderedCollection new
>
> do you know/understand what is causing this issue? It seems stuck in the VM/C
> code.
>
> _______________________________________________
> help-smalltalk mailing list
> [hidden email]
> http://lists.gnu.org/mailman/listinfo/help-smalltalk

Hi,

it seems it fails when it prints the sequencableCollection there should
be an infinite recursion (do need size and size need do) ;-)

Collection>>size [

        | count |
        count := 0.
        self do: [:element | count := count + 1].
        ^count
]

SequencableCollection>>do: aBlock [

        1 to: self size do: [:i | aBlock value: (self at: i)]
]

Gwen

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: SequenceableCollection new

Paolo Bonzini-2
On 04/06/2011 02:04 PM, Gwenael Casaccio wrote:
>
>
> Collection>>size [
>
>      | count |
>      count := 0.
>      self do: [:element | count := count + 1].
>      ^count
> ]

I'll just add "size [ ^0 ]".

Thanks for the report.

Paolo

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk