[ANN] new Symbol class and real object identity

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
26 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[ANN] new Symbol class and real object identity

Nicolas Petton
Hi,

Amber got a new class: Symbol. I adapted the parser to compile #foo as a
symbol, and they perform like expected: they are unique.

Object identity has been improved, now #== behaves like in any other
Smalltalk, and test the #identityHash. Unit tests reflect these changes.

The Kernel now has 90 unit tests. They're all green here, but if someone
could test on safari (IE7, Laurent?) that would be great.

Cheers,
Nico

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] new Symbol class and real object identity

Janko Mivšek
Nico perfect! I really love that Amber is becoming more and more pure
Smalltalk, with as few exceptions as possible.

Janko

S, Nicolas Petton piše:

> Hi,
>
> Amber got a new class: Symbol. I adapted the parser to compile #foo as a
> symbol, and they perform like expected: they are unique.
>
> Object identity has been improved, now #== behaves like in any other
> Smalltalk, and test the #identityHash. Unit tests reflect these changes.
>
> The Kernel now has 90 unit tests. They're all green here, but if someone
> could test on safari (IE7, Laurent?) that would be great.
>
> Cheers,
> Nico
>
>

--
Janko Mivšek
Aida/Web
Smalltalk Web Application Server
http://www.aidaweb.si
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] new Symbol class and real object identity

laurent laffont
In reply to this post by Nicolas Petton

On Mon, Dec 5, 2011 at 9:57 PM, Nicolas Petton <[hidden email]> wrote:
Hi,

Amber got a new class: Symbol. I adapted the parser to compile #foo as a
symbol, and they perform like expected: they are unique.

Object identity has been improved, now #== behaves like in any other
Smalltalk, and test the #identityHash. Unit tests reflect these changes.

The Kernel now has 90 unit tests. They're all green here, but if someone
could test on safari (IE7, Laurent?) that would be great.

On all IE these two tests are failing:
- BlockClosureTest>>testCompiledSource: function(){return (1) + (1);} but was: function (){return (1) + (1);}
because of a space between function and (). Do we care about this space ?
- JSObjectProxyTest>>testPropertyThatReturnsEmptyString because in IE hash always return at least # (I've written this test so that crap is my fault :)

On IE7 + IE8 more failing test:
- SymbolTest>>testAt
- StringTest>>testAt
- StringTest>>testCopyWithoutAll

I will work with Amber tomorrow, I can check.

Laurent
 

Cheers,
Nico


Reply | Threaded
Open this post in threaded view
|

Re: [ANN] new Symbol class and real object identity

laurent laffont
On iPhone iOS4, BlockClosureTest>>testCompiledSource also fails because of spaces but not the same:
function () {return (1) + (1);} but was: function (){return (1) + (1);}
           ^  ^
Anyway, cool to run all tests and debug on a old iPhone :)

Laurent


On Tue, Dec 6, 2011 at 8:00 AM, laurent laffont <[hidden email]> wrote:

On Mon, Dec 5, 2011 at 9:57 PM, Nicolas Petton <[hidden email]> wrote:
Hi,

Amber got a new class: Symbol. I adapted the parser to compile #foo as a
symbol, and they perform like expected: they are unique.

Object identity has been improved, now #== behaves like in any other
Smalltalk, and test the #identityHash. Unit tests reflect these changes.

The Kernel now has 90 unit tests. They're all green here, but if someone
could test on safari (IE7, Laurent?) that would be great.

On all IE these two tests are failing:
- BlockClosureTest>>testCompiledSource: function(){return (1) + (1);} but was: function (){return (1) + (1);}
because of a space between function and (). Do we care about this space ?
- JSObjectProxyTest>>testPropertyThatReturnsEmptyString because in IE hash always return at least # (I've written this test so that crap is my fault :)

On IE7 + IE8 more failing test:
- SymbolTest>>testAt
- StringTest>>testAt
- StringTest>>testCopyWithoutAll

I will work with Amber tomorrow, I can check.

Laurent
 

Cheers,
Nico



Reply | Threaded
Open this post in threaded view
|

Re: [ANN] new Symbol class and real object identity

Nicolas Petton
In reply to this post by laurent laffont
On Tue, 2011-12-06 at 08:00 +0100, laurent laffont wrote:

>
> On Mon, Dec 5, 2011 at 9:57 PM, Nicolas Petton
> <[hidden email]> wrote:
>         Hi,
>        
>         Amber got a new class: Symbol. I adapted the parser to compile
>         #foo as a
>         symbol, and they perform like expected: they are unique.
>        
>         Object identity has been improved, now #== behaves like in any
>         other
>         Smalltalk, and test the #identityHash. Unit tests reflect
>         these changes.
>        
>         The Kernel now has 90 unit tests. They're all green here, but
>         if someone
>         could test on safari (IE7, Laurent?) that would be great.
>
>
> On all IE these two tests are failing:
> - BlockClosureTest>>testCompiledSource: function(){return (1) + (1);}
> but was: function (){return (1) + (1);}
> because of a space between function and (). Do we care about this
> space ?

Not at all. I fixed the test.

> - JSObjectProxyTest>>testPropertyThatReturnsEmptyString because in IE
> hash always return at least # (I've written this test so that crap is
> my fault :)
OK, I'll fix that.

Nico

>
>
> On IE7 + IE8 more failing test:
> - SymbolTest>>testAt
> - StringTest>>testAt
> - StringTest>>testCopyWithoutAll
>
>
> I will work with Amber tomorrow, I can check.
>
>
> Laurent
>  
>        
>         Cheers,
>         Nico
>        
>


Reply | Threaded
Open this post in threaded view
|

OrderedCollection + fixed sized Array

Nicolas Petton
Hi guys,

You may have seen it, OrderedCollection appeared recently. While *it
shouldn't be used yet*, I'm slowly moving to fixed sized Arrays, and
introducing OrderedCollection.

Later I'll add SortedCollection too. Then We'll have:

Collection
    HashedCollection
        Dictionary
    Set
    SortedCollection
    SequenceableCollection
        Array
        OrderedCollection
        CharacterArray
            String
            Symbol

I think we'll be good to go with this hierarchy, and compatible enough
with the other Smalltalk dialects.

Cheers,
Nico

Reply | Threaded
Open this post in threaded view
|

Re: OrderedCollection + fixed sized Array

gokr
On 12/06/2011 11:36 AM, Nicolas Petton wrote:

> Collection
>      HashedCollection
>          Dictionary
>      Set
>      SortedCollection
>      SequenceableCollection
>          Array
>          OrderedCollection
>          CharacterArray
>              String
>              Symbol
>
> I think we'll be good to go with this hierarchy, and compatible enough
> with the other Smalltalk dialects.

Bloody brilliant I tell ya! :)

regards, Göran

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] new Symbol class and real object identity

Amber Milan Eskridge
In reply to this post by Nicolas Petton
Wow, great news!

On Tue, Dec 6, 2011 at 11:31 AM, Nicolas Petton
<[hidden email]> wrote:

> On Tue, 2011-12-06 at 08:00 +0100, laurent laffont wrote:
>>
>> On Mon, Dec 5, 2011 at 9:57 PM, Nicolas Petton
>> <[hidden email]> wrote:
>>         Hi,
>>
>>         Amber got a new class: Symbol. I adapted the parser to compile
>>         #foo as a
>>         symbol, and they perform like expected: they are unique.
>>
>>         Object identity has been improved, now #== behaves like in any
>>         other
>>         Smalltalk, and test the #identityHash. Unit tests reflect
>>         these changes.
>>
>>         The Kernel now has 90 unit tests. They're all green here, but
>>         if someone
>>         could test on safari (IE7, Laurent?) that would be great.
>>
>>
>> On all IE these two tests are failing:
>> - BlockClosureTest>>testCompiledSource: function(){return (1) + (1);}
>> but was: function (){return (1) + (1);}
>> because of a space between function and (). Do we care about this
>> space ?
>
> Not at all. I fixed the test.
>
>> - JSObjectProxyTest>>testPropertyThatReturnsEmptyString because in IE
>> hash always return at least # (I've written this test so that crap is
>> my fault :)
> OK, I'll fix that.
>
> Nico
>
>>
>>
>> On IE7 + IE8 more failing test:
>> - SymbolTest>>testAt
>> - StringTest>>testAt
>> - StringTest>>testCopyWithoutAll
>>
>>
>> I will work with Amber tomorrow, I can check.
>>
>>
>> Laurent
>>
>>
>>         Cheers,
>>         Nico
>>
>>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: OrderedCollection + fixed sized Array

Amber Milan Eskridge
In reply to this post by gokr
Oh :(

I see no need for fixed-sized arrays since both will be implemented as
JS-Arrays(?) making a distinction where none really exists with no
additional benefit. As I understand it, Array and OrderedCollection
are different in ST, to avoid an implementation-related
performance/memory issue. Sounds therefore like Cargo-Cult-Programming
for my ears.

Can someone enlighten me?

2011/12/6 Göran Krampe <[hidden email]>:

> On 12/06/2011 11:36 AM, Nicolas Petton wrote:
>>
>> Collection
>>     HashedCollection
>>         Dictionary
>>     Set
>>     SortedCollection
>>     SequenceableCollection
>>         Array
>>         OrderedCollection
>>         CharacterArray
>>             String
>>             Symbol
>>
>> I think we'll be good to go with this hierarchy, and compatible enough
>> with the other Smalltalk dialects.
>
>
> Bloody brilliant I tell ya! :)
>
> regards, Göran
>
Reply | Threaded
Open this post in threaded view
|

Re: OrderedCollection + fixed sized Array

Hannes Hirzel
As Milan I'd like to know more about the guiding implementation principles.

The reason might just be that existing Smalltalk code works even if
Array and OrderedCollection are both a JavaScript array. In that sense
OrderedCollection in Amber is just a synonym for Array, right?

--Hannes

On 12/7/11, Amber Milan Eskridge <[hidden email]> wrote:

> Oh :(
>
> I see no need for fixed-sized arrays since both will be implemented as
> JS-Arrays(?) making a distinction where none really exists with no
> additional benefit. As I understand it, Array and OrderedCollection
> are different in ST, to avoid an implementation-related
> performance/memory issue. Sounds therefore like Cargo-Cult-Programming
> for my ears.
>
> Can someone enlighten me?
>
> 2011/12/6 Göran Krampe <[hidden email]>:
>> On 12/06/2011 11:36 AM, Nicolas Petton wrote:
>>>
>>> Collection
>>>     HashedCollection
>>>         Dictionary
>>>     Set
>>>     SortedCollection
>>>     SequenceableCollection
>>>         Array
>>>         OrderedCollection
>>>         CharacterArray
>>>             String
>>>             Symbol
>>>
>>> I think we'll be good to go with this hierarchy, and compatible enough
>>> with the other Smalltalk dialects.
>>
>>
>> Bloody brilliant I tell ya! :)
>>
>> regards, Göran
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: OrderedCollection + fixed sized Array

Amber Milan Eskridge
As I understand it, the difference is that Arrays in Smalltalk need to
have a fixed size because of the implementation-limitations of
Smalltalk in 1980. OrderedCollection is an implementation of "growing
Arrays" (using Array(s)) to circumvent this, when necessary.

Because JS-Arrays will be used for the implementation of ST-Arrays and
ST-OrderedCollections  and JS-Arrays do not have the limitations of
the 1980 ST-Arrays, OrderedCollection is not really needed(?), it
seems to me?

On Wed, Dec 7, 2011 at 12:18 PM, H. Hirzel <[hidden email]> wrote:

> As Milan I'd like to know more about the guiding implementation principles.
>
> The reason might just be that existing Smalltalk code works even if
> Array and OrderedCollection are both a JavaScript array. In that sense
> OrderedCollection in Amber is just a synonym for Array, right?
>
> --Hannes
>
> On 12/7/11, Amber Milan Eskridge <[hidden email]> wrote:
>> Oh :(
>>
>> I see no need for fixed-sized arrays since both will be implemented as
>> JS-Arrays(?) making a distinction where none really exists with no
>> additional benefit. As I understand it, Array and OrderedCollection
>> are different in ST, to avoid an implementation-related
>> performance/memory issue. Sounds therefore like Cargo-Cult-Programming
>> for my ears.
>>
>> Can someone enlighten me?
>>
>> 2011/12/6 Göran Krampe <[hidden email]>:
>>> On 12/06/2011 11:36 AM, Nicolas Petton wrote:
>>>>
>>>> Collection
>>>>     HashedCollection
>>>>         Dictionary
>>>>     Set
>>>>     SortedCollection
>>>>     SequenceableCollection
>>>>         Array
>>>>         OrderedCollection
>>>>         CharacterArray
>>>>             String
>>>>             Symbol
>>>>
>>>> I think we'll be good to go with this hierarchy, and compatible enough
>>>> with the other Smalltalk dialects.
>>>
>>>
>>> Bloody brilliant I tell ya! :)
>>>
>>> regards, Göran
>>>
>>
Reply | Threaded
Open this post in threaded view
|

Re: OrderedCollection + fixed sized Array

Nicolas Petton
You are right. Amber doesn't need OrderedCollection. But what I care
about here is compatibility. Amber should be compatible with other
dialects to some degree, and I think OrderedCollection is part of it.

Now, does Array in Amber have to be fixed-size? Not sure.
OrderedCollection could just be there for compatibility and convenience.

Cheers,
Nico

On Wed, 2011-12-07 at 13:29 +0100, Amber Milan Eskridge wrote:

> As I understand it, the difference is that Arrays in Smalltalk need to
> have a fixed size because of the implementation-limitations of
> Smalltalk in 1980. OrderedCollection is an implementation of "growing
> Arrays" (using Array(s)) to circumvent this, when necessary.
>
> Because JS-Arrays will be used for the implementation of ST-Arrays and
> ST-OrderedCollections  and JS-Arrays do not have the limitations of
> the 1980 ST-Arrays, OrderedCollection is not really needed(?), it
> seems to me?
>
> On Wed, Dec 7, 2011 at 12:18 PM, H. Hirzel <[hidden email]> wrote:
> > As Milan I'd like to know more about the guiding implementation principles.
> >
> > The reason might just be that existing Smalltalk code works even if
> > Array and OrderedCollection are both a JavaScript array. In that sense
> > OrderedCollection in Amber is just a synonym for Array, right?
> >
> > --Hannes
> >
> > On 12/7/11, Amber Milan Eskridge <[hidden email]> wrote:
> >> Oh :(
> >>
> >> I see no need for fixed-sized arrays since both will be implemented as
> >> JS-Arrays(?) making a distinction where none really exists with no
> >> additional benefit. As I understand it, Array and OrderedCollection
> >> are different in ST, to avoid an implementation-related
> >> performance/memory issue. Sounds therefore like Cargo-Cult-Programming
> >> for my ears.
> >>
> >> Can someone enlighten me?
> >>
> >> 2011/12/6 Göran Krampe <[hidden email]>:
> >>> On 12/06/2011 11:36 AM, Nicolas Petton wrote:
> >>>>
> >>>> Collection
> >>>>     HashedCollection
> >>>>         Dictionary
> >>>>     Set
> >>>>     SortedCollection
> >>>>     SequenceableCollection
> >>>>         Array
> >>>>         OrderedCollection
> >>>>         CharacterArray
> >>>>             String
> >>>>             Symbol
> >>>>
> >>>> I think we'll be good to go with this hierarchy, and compatible enough
> >>>> with the other Smalltalk dialects.
> >>>
> >>>
> >>> Bloody brilliant I tell ya! :)
> >>>
> >>> regards, Göran
> >>>
> >>


Reply | Threaded
Open this post in threaded view
|

Re: OrderedCollection + fixed sized Array

Amber Milan Eskridge
Oh, okay.

Could it be just an empty subclass for compatibility?
Or just putting Array class under the symbol #Array and #OrderedCollection?

Thanks for all the good work! :)

On Wed, Dec 7, 2011 at 1:33 PM, Nicolas Petton <[hidden email]> wrote:

> You are right. Amber doesn't need OrderedCollection. But what I care
> about here is compatibility. Amber should be compatible with other
> dialects to some degree, and I think OrderedCollection is part of it.
>
> Now, does Array in Amber have to be fixed-size? Not sure.
> OrderedCollection could just be there for compatibility and convenience.
>
> Cheers,
> Nico
>
> On Wed, 2011-12-07 at 13:29 +0100, Amber Milan Eskridge wrote:
>> As I understand it, the difference is that Arrays in Smalltalk need to
>> have a fixed size because of the implementation-limitations of
>> Smalltalk in 1980. OrderedCollection is an implementation of "growing
>> Arrays" (using Array(s)) to circumvent this, when necessary.
>>
>> Because JS-Arrays will be used for the implementation of ST-Arrays and
>> ST-OrderedCollections  and JS-Arrays do not have the limitations of
>> the 1980 ST-Arrays, OrderedCollection is not really needed(?), it
>> seems to me?
>>
>> On Wed, Dec 7, 2011 at 12:18 PM, H. Hirzel <[hidden email]> wrote:
>> > As Milan I'd like to know more about the guiding implementation principles.
>> >
>> > The reason might just be that existing Smalltalk code works even if
>> > Array and OrderedCollection are both a JavaScript array. In that sense
>> > OrderedCollection in Amber is just a synonym for Array, right?
>> >
>> > --Hannes
>> >
>> > On 12/7/11, Amber Milan Eskridge <[hidden email]> wrote:
>> >> Oh :(
>> >>
>> >> I see no need for fixed-sized arrays since both will be implemented as
>> >> JS-Arrays(?) making a distinction where none really exists with no
>> >> additional benefit. As I understand it, Array and OrderedCollection
>> >> are different in ST, to avoid an implementation-related
>> >> performance/memory issue. Sounds therefore like Cargo-Cult-Programming
>> >> for my ears.
>> >>
>> >> Can someone enlighten me?
>> >>
>> >> 2011/12/6 Göran Krampe <[hidden email]>:
>> >>> On 12/06/2011 11:36 AM, Nicolas Petton wrote:
>> >>>>
>> >>>> Collection
>> >>>>     HashedCollection
>> >>>>         Dictionary
>> >>>>     Set
>> >>>>     SortedCollection
>> >>>>     SequenceableCollection
>> >>>>         Array
>> >>>>         OrderedCollection
>> >>>>         CharacterArray
>> >>>>             String
>> >>>>             Symbol
>> >>>>
>> >>>> I think we'll be good to go with this hierarchy, and compatible enough
>> >>>> with the other Smalltalk dialects.
>> >>>
>> >>>
>> >>> Bloody brilliant I tell ya! :)
>> >>>
>> >>> regards, Göran
>> >>>
>> >>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] new Symbol class and real object identity

Amber Milan Eskridge
In reply to this post by Amber Milan Eskridge
One question, are #keywordMessages:withColons: as Symbols now possible?

On Wed, Dec 7, 2011 at 11:18 AM, Amber Milan Eskridge
<[hidden email]> wrote:

> Wow, great news!
>
> On Tue, Dec 6, 2011 at 11:31 AM, Nicolas Petton
> <[hidden email]> wrote:
>> On Tue, 2011-12-06 at 08:00 +0100, laurent laffont wrote:
>>>
>>> On Mon, Dec 5, 2011 at 9:57 PM, Nicolas Petton
>>> <[hidden email]> wrote:
>>>         Hi,
>>>
>>>         Amber got a new class: Symbol. I adapted the parser to compile
>>>         #foo as a
>>>         symbol, and they perform like expected: they are unique.
>>>
>>>         Object identity has been improved, now #== behaves like in any
>>>         other
>>>         Smalltalk, and test the #identityHash. Unit tests reflect
>>>         these changes.
>>>
>>>         The Kernel now has 90 unit tests. They're all green here, but
>>>         if someone
>>>         could test on safari (IE7, Laurent?) that would be great.
>>>
>>>
>>> On all IE these two tests are failing:
>>> - BlockClosureTest>>testCompiledSource: function(){return (1) + (1);}
>>> but was: function (){return (1) + (1);}
>>> because of a space between function and (). Do we care about this
>>> space ?
>>
>> Not at all. I fixed the test.
>>
>>> - JSObjectProxyTest>>testPropertyThatReturnsEmptyString because in IE
>>> hash always return at least # (I've written this test so that crap is
>>> my fault :)
>> OK, I'll fix that.
>>
>> Nico
>>
>>>
>>>
>>> On IE7 + IE8 more failing test:
>>> - SymbolTest>>testAt
>>> - StringTest>>testAt
>>> - StringTest>>testCopyWithoutAll
>>>
>>>
>>> I will work with Amber tomorrow, I can check.
>>>
>>>
>>> Laurent
>>>
>>>
>>>         Cheers,
>>>         Nico
>>>
>>>
>>
>>
Reply | Threaded
Open this post in threaded view
|

Re: OrderedCollection + fixed sized Array

Dale Henrichs
In reply to this post by Nicolas Petton
Nicolas,

Arrays in GemStone aren't fixed-size either and OrderedCollections were added for compatibility...

Dale

----- Original Message -----
| From: "Nicolas Petton" <[hidden email]>
| To: [hidden email]
| Sent: Wednesday, December 7, 2011 4:33:56 AM
| Subject: Re: [amber-lang] OrderedCollection + fixed sized Array
|
| You are right. Amber doesn't need OrderedCollection. But what I care
| about here is compatibility. Amber should be compatible with other
| dialects to some degree, and I think OrderedCollection is part of it.
|
| Now, does Array in Amber have to be fixed-size? Not sure.
| OrderedCollection could just be there for compatibility and
| convenience.
|
| Cheers,
| Nico
|
| On Wed, 2011-12-07 at 13:29 +0100, Amber Milan Eskridge wrote:
| > As I understand it, the difference is that Arrays in Smalltalk need
| > to
| > have a fixed size because of the implementation-limitations of
| > Smalltalk in 1980. OrderedCollection is an implementation of
| > "growing
| > Arrays" (using Array(s)) to circumvent this, when necessary.
| >
| > Because JS-Arrays will be used for the implementation of ST-Arrays
| > and
| > ST-OrderedCollections  and JS-Arrays do not have the limitations of
| > the 1980 ST-Arrays, OrderedCollection is not really needed(?), it
| > seems to me?
| >
| > On Wed, Dec 7, 2011 at 12:18 PM, H. Hirzel
| > <[hidden email]> wrote:
| > > As Milan I'd like to know more about the guiding implementation
| > > principles.
| > >
| > > The reason might just be that existing Smalltalk code works even
| > > if
| > > Array and OrderedCollection are both a JavaScript array. In that
| > > sense
| > > OrderedCollection in Amber is just a synonym for Array, right?
| > >
| > > --Hannes
| > >
| > > On 12/7/11, Amber Milan Eskridge <[hidden email]>
| > > wrote:
| > >> Oh :(
| > >>
| > >> I see no need for fixed-sized arrays since both will be
| > >> implemented as
| > >> JS-Arrays(?) making a distinction where none really exists with
| > >> no
| > >> additional benefit. As I understand it, Array and
| > >> OrderedCollection
| > >> are different in ST, to avoid an implementation-related
| > >> performance/memory issue. Sounds therefore like
| > >> Cargo-Cult-Programming
| > >> for my ears.
| > >>
| > >> Can someone enlighten me?
| > >>
| > >> 2011/12/6 Göran Krampe <[hidden email]>:
| > >>> On 12/06/2011 11:36 AM, Nicolas Petton wrote:
| > >>>>
| > >>>> Collection
| > >>>>     HashedCollection
| > >>>>         Dictionary
| > >>>>     Set
| > >>>>     SortedCollection
| > >>>>     SequenceableCollection
| > >>>>         Array
| > >>>>         OrderedCollection
| > >>>>         CharacterArray
| > >>>>             String
| > >>>>             Symbol
| > >>>>
| > >>>> I think we'll be good to go with this hierarchy, and
| > >>>> compatible enough
| > >>>> with the other Smalltalk dialects.
| > >>>
| > >>>
| > >>> Bloody brilliant I tell ya! :)
| > >>>
| > >>> regards, Göran
| > >>>
| > >>
|
|
|
Reply | Threaded
Open this post in threaded view
|

Re: OrderedCollection + fixed sized Array

Nicolas Petton
In reply to this post by Amber Milan Eskridge
On Wed, 2011-12-07 at 17:03 +0100, Amber Milan Eskridge wrote:
> Oh, okay.
>
> Could it be just an empty subclass for compatibility?
> Or just putting Array class under the symbol #Array and #OrderedCollection?

Because of the way Amber wrap JS constructors to Smalltalk classes, that
means OrderedCollection and Array would be the *same object*. Now why
not.

Cheers,
Nico

>
> Thanks for all the good work! :)
>
> On Wed, Dec 7, 2011 at 1:33 PM, Nicolas Petton <[hidden email]> wrote:
> > You are right. Amber doesn't need OrderedCollection. But what I care
> > about here is compatibility. Amber should be compatible with other
> > dialects to some degree, and I think OrderedCollection is part of it.
> >
> > Now, does Array in Amber have to be fixed-size? Not sure.
> > OrderedCollection could just be there for compatibility and convenience.
> >
> > Cheers,
> > Nico
> >
> > On Wed, 2011-12-07 at 13:29 +0100, Amber Milan Eskridge wrote:
> >> As I understand it, the difference is that Arrays in Smalltalk need to
> >> have a fixed size because of the implementation-limitations of
> >> Smalltalk in 1980. OrderedCollection is an implementation of "growing
> >> Arrays" (using Array(s)) to circumvent this, when necessary.
> >>
> >> Because JS-Arrays will be used for the implementation of ST-Arrays and
> >> ST-OrderedCollections  and JS-Arrays do not have the limitations of
> >> the 1980 ST-Arrays, OrderedCollection is not really needed(?), it
> >> seems to me?
> >>
> >> On Wed, Dec 7, 2011 at 12:18 PM, H. Hirzel <[hidden email]> wrote:
> >> > As Milan I'd like to know more about the guiding implementation principles.
> >> >
> >> > The reason might just be that existing Smalltalk code works even if
> >> > Array and OrderedCollection are both a JavaScript array. In that sense
> >> > OrderedCollection in Amber is just a synonym for Array, right?
> >> >
> >> > --Hannes
> >> >
> >> > On 12/7/11, Amber Milan Eskridge <[hidden email]> wrote:
> >> >> Oh :(
> >> >>
> >> >> I see no need for fixed-sized arrays since both will be implemented as
> >> >> JS-Arrays(?) making a distinction where none really exists with no
> >> >> additional benefit. As I understand it, Array and OrderedCollection
> >> >> are different in ST, to avoid an implementation-related
> >> >> performance/memory issue. Sounds therefore like Cargo-Cult-Programming
> >> >> for my ears.
> >> >>
> >> >> Can someone enlighten me?
> >> >>
> >> >> 2011/12/6 Göran Krampe <[hidden email]>:
> >> >>> On 12/06/2011 11:36 AM, Nicolas Petton wrote:
> >> >>>>
> >> >>>> Collection
> >> >>>>     HashedCollection
> >> >>>>         Dictionary
> >> >>>>     Set
> >> >>>>     SortedCollection
> >> >>>>     SequenceableCollection
> >> >>>>         Array
> >> >>>>         OrderedCollection
> >> >>>>         CharacterArray
> >> >>>>             String
> >> >>>>             Symbol
> >> >>>>
> >> >>>> I think we'll be good to go with this hierarchy, and compatible enough
> >> >>>> with the other Smalltalk dialects.
> >> >>>
> >> >>>
> >> >>> Bloody brilliant I tell ya! :)
> >> >>>
> >> >>> regards, Göran
> >> >>>
> >> >>
> >
> >


Reply | Threaded
Open this post in threaded view
|

Re: [ANN] new Symbol class and real object identity

Nicolas Petton
In reply to this post by Amber Milan Eskridge
On Wed, 2011-12-07 at 17:17 +0100, Amber Milan Eskridge wrote:
> One question, are #keywordMessages:withColons: as Symbols now possible?

I don't understand :)

>
> On Wed, Dec 7, 2011 at 11:18 AM, Amber Milan Eskridge
> <[hidden email]> wrote:
> > Wow, great news!
> >
> > On Tue, Dec 6, 2011 at 11:31 AM, Nicolas Petton
> > <[hidden email]> wrote:
> >> On Tue, 2011-12-06 at 08:00 +0100, laurent laffont wrote:
> >>>
> >>> On Mon, Dec 5, 2011 at 9:57 PM, Nicolas Petton
> >>> <[hidden email]> wrote:
> >>>         Hi,
> >>>
> >>>         Amber got a new class: Symbol. I adapted the parser to compile
> >>>         #foo as a
> >>>         symbol, and they perform like expected: they are unique.
> >>>
> >>>         Object identity has been improved, now #== behaves like in any
> >>>         other
> >>>         Smalltalk, and test the #identityHash. Unit tests reflect
> >>>         these changes.
> >>>
> >>>         The Kernel now has 90 unit tests. They're all green here, but
> >>>         if someone
> >>>         could test on safari (IE7, Laurent?) that would be great.
> >>>
> >>>
> >>> On all IE these two tests are failing:
> >>> - BlockClosureTest>>testCompiledSource: function(){return (1) + (1);}
> >>> but was: function (){return (1) + (1);}
> >>> because of a space between function and (). Do we care about this
> >>> space ?
> >>
> >> Not at all. I fixed the test.
> >>
> >>> - JSObjectProxyTest>>testPropertyThatReturnsEmptyString because in IE
> >>> hash always return at least # (I've written this test so that crap is
> >>> my fault :)
> >> OK, I'll fix that.
> >>
> >> Nico
> >>
> >>>
> >>>
> >>> On IE7 + IE8 more failing test:
> >>> - SymbolTest>>testAt
> >>> - StringTest>>testAt
> >>> - StringTest>>testCopyWithoutAll
> >>>
> >>>
> >>> I will work with Amber tomorrow, I can check.
> >>>
> >>>
> >>> Laurent
> >>>
> >>>
> >>>         Cheers,
> >>>         Nico
> >>>
> >>>
> >>
> >>


Reply | Threaded
Open this post in threaded view
|

Re: OrderedCollection + fixed sized Array

Nicolas Petton
In reply to this post by Dale Henrichs
Interesting. What's the difference between Array and OrderedCollection
in GemStone then?

On Wed, 2011-12-07 at 09:10 -0800, Dale Henrichs wrote:

> Nicolas,
>
> Arrays in GemStone aren't fixed-size either and OrderedCollections were added for compatibility...
>
> Dale
>
> ----- Original Message -----
> | From: "Nicolas Petton" <[hidden email]>
> | To: [hidden email]
> | Sent: Wednesday, December 7, 2011 4:33:56 AM
> | Subject: Re: [amber-lang] OrderedCollection + fixed sized Array
> |
> | You are right. Amber doesn't need OrderedCollection. But what I care
> | about here is compatibility. Amber should be compatible with other
> | dialects to some degree, and I think OrderedCollection is part of it.
> |
> | Now, does Array in Amber have to be fixed-size? Not sure.
> | OrderedCollection could just be there for compatibility and
> | convenience.
> |
> | Cheers,
> | Nico
> |
> | On Wed, 2011-12-07 at 13:29 +0100, Amber Milan Eskridge wrote:
> | > As I understand it, the difference is that Arrays in Smalltalk need
> | > to
> | > have a fixed size because of the implementation-limitations of
> | > Smalltalk in 1980. OrderedCollection is an implementation of
> | > "growing
> | > Arrays" (using Array(s)) to circumvent this, when necessary.
> | >
> | > Because JS-Arrays will be used for the implementation of ST-Arrays
> | > and
> | > ST-OrderedCollections  and JS-Arrays do not have the limitations of
> | > the 1980 ST-Arrays, OrderedCollection is not really needed(?), it
> | > seems to me?
> | >
> | > On Wed, Dec 7, 2011 at 12:18 PM, H. Hirzel
> | > <[hidden email]> wrote:
> | > > As Milan I'd like to know more about the guiding implementation
> | > > principles.
> | > >
> | > > The reason might just be that existing Smalltalk code works even
> | > > if
> | > > Array and OrderedCollection are both a JavaScript array. In that
> | > > sense
> | > > OrderedCollection in Amber is just a synonym for Array, right?
> | > >
> | > > --Hannes
> | > >
> | > > On 12/7/11, Amber Milan Eskridge <[hidden email]>
> | > > wrote:
> | > >> Oh :(
> | > >>
> | > >> I see no need for fixed-sized arrays since both will be
> | > >> implemented as
> | > >> JS-Arrays(?) making a distinction where none really exists with
> | > >> no
> | > >> additional benefit. As I understand it, Array and
> | > >> OrderedCollection
> | > >> are different in ST, to avoid an implementation-related
> | > >> performance/memory issue. Sounds therefore like
> | > >> Cargo-Cult-Programming
> | > >> for my ears.
> | > >>
> | > >> Can someone enlighten me?
> | > >>
> | > >> 2011/12/6 Göran Krampe <[hidden email]>:
> | > >>> On 12/06/2011 11:36 AM, Nicolas Petton wrote:
> | > >>>>
> | > >>>> Collection
> | > >>>>     HashedCollection
> | > >>>>         Dictionary
> | > >>>>     Set
> | > >>>>     SortedCollection
> | > >>>>     SequenceableCollection
> | > >>>>         Array
> | > >>>>         OrderedCollection
> | > >>>>         CharacterArray
> | > >>>>             String
> | > >>>>             Symbol
> | > >>>>
> | > >>>> I think we'll be good to go with this hierarchy, and
> | > >>>> compatible enough
> | > >>>> with the other Smalltalk dialects.
> | > >>>
> | > >>>
> | > >>> Bloody brilliant I tell ya! :)
> | > >>>
> | > >>> regards, Göran
> | > >>>
> | > >>
> |
> |
> |


Reply | Threaded
Open this post in threaded view
|

Re: OrderedCollection + fixed sized Array

Dale Henrichs
In terms of internals no difference: they both grow "in-place" with no need to copy ... GemStone collections are implemented internally as trees, so they can be extended dynamically.

So in the end the difference is which methods are implemented:

  OrderedCollection behaves like a standard OrderedCollection
  Array behaves like a standard Array

Dale

----- Original Message -----
| From: "Nicolas Petton" <[hidden email]>
| To: [hidden email]
| Sent: Wednesday, December 7, 2011 1:14:08 PM
| Subject: Re: [amber-lang] OrderedCollection + fixed sized Array
|
| Interesting. What's the difference between Array and
| OrderedCollection
| in GemStone then?
|
| On Wed, 2011-12-07 at 09:10 -0800, Dale Henrichs wrote:
| > Nicolas,
| >
| > Arrays in GemStone aren't fixed-size either and OrderedCollections
| > were added for compatibility...
| >
| > Dale
| >
| > ----- Original Message -----
| > | From: "Nicolas Petton" <[hidden email]>
| > | To: [hidden email]
| > | Sent: Wednesday, December 7, 2011 4:33:56 AM
| > | Subject: Re: [amber-lang] OrderedCollection + fixed sized Array
| > |
| > | You are right. Amber doesn't need OrderedCollection. But what I
| > | care
| > | about here is compatibility. Amber should be compatible with
| > | other
| > | dialects to some degree, and I think OrderedCollection is part of
| > | it.
| > |
| > | Now, does Array in Amber have to be fixed-size? Not sure.
| > | OrderedCollection could just be there for compatibility and
| > | convenience.
| > |
| > | Cheers,
| > | Nico
| > |
| > | On Wed, 2011-12-07 at 13:29 +0100, Amber Milan Eskridge wrote:
| > | > As I understand it, the difference is that Arrays in Smalltalk
| > | > need
| > | > to
| > | > have a fixed size because of the implementation-limitations of
| > | > Smalltalk in 1980. OrderedCollection is an implementation of
| > | > "growing
| > | > Arrays" (using Array(s)) to circumvent this, when necessary.
| > | >
| > | > Because JS-Arrays will be used for the implementation of
| > | > ST-Arrays
| > | > and
| > | > ST-OrderedCollections  and JS-Arrays do not have the
| > | > limitations of
| > | > the 1980 ST-Arrays, OrderedCollection is not really needed(?),
| > | > it
| > | > seems to me?
| > | >
| > | > On Wed, Dec 7, 2011 at 12:18 PM, H. Hirzel
| > | > <[hidden email]> wrote:
| > | > > As Milan I'd like to know more about the guiding
| > | > > implementation
| > | > > principles.
| > | > >
| > | > > The reason might just be that existing Smalltalk code works
| > | > > even
| > | > > if
| > | > > Array and OrderedCollection are both a JavaScript array. In
| > | > > that
| > | > > sense
| > | > > OrderedCollection in Amber is just a synonym for Array,
| > | > > right?
| > | > >
| > | > > --Hannes
| > | > >
| > | > > On 12/7/11, Amber Milan Eskridge
| > | > > <[hidden email]>
| > | > > wrote:
| > | > >> Oh :(
| > | > >>
| > | > >> I see no need for fixed-sized arrays since both will be
| > | > >> implemented as
| > | > >> JS-Arrays(?) making a distinction where none really exists
| > | > >> with
| > | > >> no
| > | > >> additional benefit. As I understand it, Array and
| > | > >> OrderedCollection
| > | > >> are different in ST, to avoid an implementation-related
| > | > >> performance/memory issue. Sounds therefore like
| > | > >> Cargo-Cult-Programming
| > | > >> for my ears.
| > | > >>
| > | > >> Can someone enlighten me?
| > | > >>
| > | > >> 2011/12/6 Göran Krampe <[hidden email]>:
| > | > >>> On 12/06/2011 11:36 AM, Nicolas Petton wrote:
| > | > >>>>
| > | > >>>> Collection
| > | > >>>>     HashedCollection
| > | > >>>>         Dictionary
| > | > >>>>     Set
| > | > >>>>     SortedCollection
| > | > >>>>     SequenceableCollection
| > | > >>>>         Array
| > | > >>>>         OrderedCollection
| > | > >>>>         CharacterArray
| > | > >>>>             String
| > | > >>>>             Symbol
| > | > >>>>
| > | > >>>> I think we'll be good to go with this hierarchy, and
| > | > >>>> compatible enough
| > | > >>>> with the other Smalltalk dialects.
| > | > >>>
| > | > >>>
| > | > >>> Bloody brilliant I tell ya! :)
| > | > >>>
| > | > >>> regards, Göran
| > | > >>>
| > | > >>
| > |
| > |
| > |
|
|
|
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] new Symbol class and real object identity

Amber Milan Eskridge
In reply to this post by Nicolas Petton
In the version I currently use, I can not create Strings with colon in
them using the #-notation.


On Wed, Dec 7, 2011 at 10:06 PM, Nicolas Petton
<[hidden email]> wrote:

> On Wed, 2011-12-07 at 17:17 +0100, Amber Milan Eskridge wrote:
>> One question, are #keywordMessages:withColons: as Symbols now possible?
>
> I don't understand :)
>
>>
>> On Wed, Dec 7, 2011 at 11:18 AM, Amber Milan Eskridge
>> <[hidden email]> wrote:
>> > Wow, great news!
>> >
>> > On Tue, Dec 6, 2011 at 11:31 AM, Nicolas Petton
>> > <[hidden email]> wrote:
>> >> On Tue, 2011-12-06 at 08:00 +0100, laurent laffont wrote:
>> >>>
>> >>> On Mon, Dec 5, 2011 at 9:57 PM, Nicolas Petton
>> >>> <[hidden email]> wrote:
>> >>>         Hi,
>> >>>
>> >>>         Amber got a new class: Symbol. I adapted the parser to compile
>> >>>         #foo as a
>> >>>         symbol, and they perform like expected: they are unique.
>> >>>
>> >>>         Object identity has been improved, now #== behaves like in any
>> >>>         other
>> >>>         Smalltalk, and test the #identityHash. Unit tests reflect
>> >>>         these changes.
>> >>>
>> >>>         The Kernel now has 90 unit tests. They're all green here, but
>> >>>         if someone
>> >>>         could test on safari (IE7, Laurent?) that would be great.
>> >>>
>> >>>
>> >>> On all IE these two tests are failing:
>> >>> - BlockClosureTest>>testCompiledSource: function(){return (1) + (1);}
>> >>> but was: function (){return (1) + (1);}
>> >>> because of a space between function and (). Do we care about this
>> >>> space ?
>> >>
>> >> Not at all. I fixed the test.
>> >>
>> >>> - JSObjectProxyTest>>testPropertyThatReturnsEmptyString because in IE
>> >>> hash always return at least # (I've written this test so that crap is
>> >>> my fault :)
>> >> OK, I'll fix that.
>> >>
>> >> Nico
>> >>
>> >>>
>> >>>
>> >>> On IE7 + IE8 more failing test:
>> >>> - SymbolTest>>testAt
>> >>> - StringTest>>testAt
>> >>> - StringTest>>testCopyWithoutAll
>> >>>
>> >>>
>> >>> I will work with Amber tomorrow, I can check.
>> >>>
>> >>>
>> >>> Laurent
>> >>>
>> >>>
>> >>>         Cheers,
>> >>>         Nico
>> >>>
>> >>>
>> >>
>> >>
>
>
12