Re: [Pharo-users] adding an element to an empty array

2015-06-29 Thread Sven Van Caekenberghe
> On 29 Jun 2015, at 14:23, Henrik Johansen > wrote: > > >> On 29 Jun 2015, at 2:18 , abdelghani ALIDRA wrote: >> >> Hi guys, >> >> Is there any way to add an element to an empty array (must not use new: >> anElement)? >> >> Cheers > > It sounds like you want to use an OrderedCollection,

Re: [Pharo-users] adding an element to an empty array

2015-06-29 Thread Peter Uhnák
Or if you want to create an array with elements already in it (this works both for array and collections) you can also do ~~ { anElement } "dynamic array syntax, Pharo-only" ~~ or #('element') "static array, works only for scalars" or Array with:

Re: [Pharo-users] adding an element to an empty array

2015-06-29 Thread Henrik Johansen
> On 29 Jun 2015, at 2:18 , abdelghani ALIDRA wrote: > > Hi guys, > > Is there any way to add an element to an empty array (must not use new: > anElement)? > > Cheers It sounds like you want to use an OrderedCollection, not an Array. Those will grow and shrink as needed when you use add:/rem

[Pharo-users] adding an element to an empty array

2015-06-29 Thread abdelghani ALIDRA
Hi guys, Is there any way to add an element to an empty array (must not use new: anElement)? Cheers