List.st
changeset 4934 91b2585d2cba
parent 4816 efece2a6d28b
child 5009 eedec11e58f7
--- a/List.st	Wed Apr 03 08:37:30 2019 +0200
+++ b/List.st	Wed Apr 03 12:41:40 2019 +0200
@@ -245,6 +245,23 @@
     "Modified (format): / 01-08-2018 / 11:51:29 / Claus Gittinger"
 !
 
+dropLast:n
+    "remove the last n elements from the receiver collection. 
+     Return the receiver."
+
+    self possiblySynchronized:[
+        | stop |
+        stop := self size.
+        super dropLast:n.
+        dependents notNil ifTrue:[
+            self changed:#removeFrom: with:(Array with:(stop - n + 1) with:stop).
+        ].
+    ].
+    ^ self
+
+    "Created: / 03-04-2019 / 12:40:35 / Claus Gittinger"
+!
+
 removeAll
     "remove all elements from the collection.
      Returns the receiver."