Advertisement
Guest User

Untitled

a guest
Nov 14th, 2019
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Collection extend [
  2.     totalsize [
  3.         ^self inject: 0 into: [:x :y | (y isKindOf: Collection) ifTrue: [x + y totalsize] ifFalse: [x + 1]]
  4.     ]
  5. ].
  6.  
  7. a := #(2.7 #( ) #(3.1 #(4 #( #(true #( )) $c #( #(5)) $x)) #( )) false).
  8. a totalsize printNl.
  9. s := Set new.
  10. s add: #(2.7 3.1) ; add: 4 ; add: #(true $c 5) ; add: #( ) ; add: #($x) ; add: #( #(false) ) .
  11. s totalsize printNl.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement