<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.18.1">
</HEAD>
<BODY>
Bonjour,<BR>
<BR>
La classe SortedCollection implémente la méthode copyWithoutIndex: comme suit :<BR>
<BR>
copyWithoutIndex: index<BR>
"Return a copy containing all elements except the index-th."<BR>
<BR>
| copy |<BR>
copy := self species ofSize: self size - 1.<BR>
copy replaceFrom: 1 to: index-1 with: self startingAt: 1.<BR>
copy replaceFrom: index to: copy size with: self startingAt: index+1.<BR>
^ copy<BR>
<BR>
qui utilise la méthode <BR>
<BR>
replaceFrom: start to: stop with: replacement startingAt: repStart <BR>
"This destructively replaces elements from start to stop in the receiver <BR>
starting at index, repStart, in the sequenceable collection, <BR>
replacementCollection. Answer the receiver. No range checks are <BR>
performed."<BR>
<BR>
| index repOff |<BR>
repOff := repStart - start.<BR>
index := start - 1.<BR>
[(index := index + 1) <= stop]<BR>
whileTrue: [self at: index put: (replacement at: repOff + index)]<BR>
<BR>
Elle même utilise la méthode at:put qui ne doit pas être utilisée sur une collection triée.... d'où le message d'erreur <BR>
at: anInteger put: anObject<BR>
self shouldNotImplement<BR>
<BR>
J'utilise l'image sq3.10-7159web08.03.1<BR>
<BR>
Je pense qu'un reject: sera plus simple.... Mais cependant, ce cheminement, avec cette erreur, ne devrait pas être à mon sens.<BR>
<BR>
Olivier<BR>
<BR>
</BODY>
</HTML>