Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Collection extend [
- totalsize [
- ^self inject: 0 into: [:x :y | (y isKindOf: Collection) ifTrue: [x + y totalsize] ifFalse: [x + 1]]
- ]
- ].
- a := #(2.7 #( ) #(3.1 #(4 #( #(true #( )) $c #( #(5)) $x)) #( )) false).
- a totalsize printNl.
- s := Set new.
- s add: #(2.7 3.1) ; add: 4 ; add: #(true $c 5) ; add: #( ) ; add: #($x) ; add: #( #(false) ) .
- s totalsize printNl.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement