[Squeak-fr] Collections

FERRERE Frédéric frederic.ferrere at free.fr
Mer 31 Mai 15:21:44 UTC 2006


Bonjour,

je rencontre un petit problème de compréhension (de débutant c'est sur).


Voila un morceau de code :

| myImage pixelsValues |
	myImage := ImageMorph new.
	pixelsValues := myImage imageForm tallyPixelValues.
	Transcript 	show: pixelsValues size; cr.
	(pixelsValues select: [ :each | each > 0]) do: [ :each | Transcript show: each; show: ' '.].
	(pixelsValues collect: [ :each | each > 0]) do: [ :each | Transcript show: each; show: ' '.].


pixelsValues renvoie un bitmap (qui est une Collection)

pourquoi collect: sur le bitmap me renvoie une erreur ?

Error : improper store into indexable object

select par contre fonctionne 'normalement'

Merci d'éclairer ma lanterne de débutant (mais je m'accroche :) )

Cordialement,
-- 

Frédéric Ferrère


More information about the Squeak-fr mailing list