[Pharo-dev] Old ClassBuilder remove!

Martin Dias tinchodias at gmail.com
Mon Nov 25 10:08:03 EST 2013


With the object's format reified in Layouts, we could rewrite a method like
this by a double-dispatch:

Object >>
fuelAccept: aGeneralMapper
"Be careful because the order is important. For example, weak are also
variable, but we need that weak objects send #visitWeakObject: and not
#visitVariableObject: "
 self class isFixed
ifTrue: [ ^ aGeneralMapper visitFixedObject: self ].
self class isWeak
 ifTrue: [ ^ aGeneralMapper visitWeakObject: self ].
self class isPointers
ifTrue: [ ^ aGeneralMapper visitVariableObject: self ].
 self class isBytes
ifTrue: [ ^ aGeneralMapper visitBytesObject: self ].
self class isWords
 ifTrue: [ ^ aGeneralMapper visitWordsObject: self ].
self error: 'Something is wrong!'

Martín


On Mon, Nov 25, 2013 at 4:04 PM, Martin Dias <tinchodias at gmail.com> wrote:

> Mmm... if slots support annotations, maybe the user can tag an instance
> variable with a "ignore" tag.
>
> At this moment, the user can override #fuelIgnoredInstanceVariableNames to
> do that, answering a list of variable names.
>
> Martín
>
>
> On Sat, Nov 23, 2013 at 5:46 PM, Stéphane Ducasse <
> stephane.ducasse at inria.fr> wrote:
>
>>
>> > How does this affect serialization / materialization engines like Fuel?
>>
>> Not now
>> We will have to work to make the compiler smarter and define special Slot
>> class.
>>
>>
>> >> On 21 nov. 2013, at 13:44, kilon alios <kilon.alios at gmail.com> wrote:
>> >>
>> >> any links why newcomers like me should be impressed ? Whats the
>> advantages ?
>> >>
>> >>
>> >> That's just cleaning. The old class builder was an incredibly complex
>> piece
>> >> of code that is now replaced with the Slot class builder.
>> >> The later is based on slots and is much more understandable and thus
>> much
>> >> easier to maintain.
>> >> It's been integrated some time ago thanks to Martin.
>> >>
>> >> Slots are the work of Toon and Camillo and enables a lot of useful
>> features:
>> >>
>> http://rmod.lille.inria.fr/archives/papers/Verw11a-OOSPLA11-FlexibleObjectLayouts.pdf
>> >> They are based on the reification of class layouts
>> (variable,weak,fixed and
>> >> co) and instance variables (slots).
>> >> Slots are an abstraction added on top of low-level class "fields".
>> >> It means that one will be able to create a customized slot class that
>> define
>> >> the logic to read and write a slot:
>> >>
>> >> Object subclass: #MyClass
>> >> slots: { x => MyFancySlot }
>> >> category: 'Playground'
>> >>
>> >> Then when a method read or writes x, the logic you defined in
>> MyFancySlot is
>> >> executed.
>> >> All that still need to be absorbed by Opal so it's not available right
>> now
>> >> but it will (Pharo 4)!
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> On Thu, Nov 21, 2013 at 2:21 PM, Tudor Girba <tudor at tudorgirba.com>
>> wrote:
>> >>>
>> >>> Triple impressive! This is another sample of an apparently tiny change
>> >>> that actually has deep impact on the future of our beloved
>> environment.
>> >>>
>> >>> Ladies and gentlemen, I know you are busy, but please take the time to
>> >>> acknowledge it :)
>> >>>
>> >>> Doru
>> >>>
>> >>>
>> >>>
>> >>>
>> >>> On Thu, Nov 21, 2013 at 12:58 PM, Martin Dias <tinchodias at gmail.com>
>> >>> wrote:
>> >>>>
>> >>>> wow, impressive!
>> >>>>
>> >>>>
>> >>>> On Thu, Nov 21, 2013 at 9:02 AM, Marcus Denker <
>> marcus.denker at inria.fr>
>> >>>> wrote:
>> >>>>>
>> >>>>> Hi,
>> >>>>>
>> >>>>> Yesterday Camille did the change to finally remove the old class
>> >>>>> builder!
>> >>>>> (just a removal + a small change to NativeBoost to use the new class
>> >>>>> builder to create anonymous classes).
>> >>>>>
>> >>>>> This means
>> >>>>>        - 1000 Loc of completely un-understandable code removed.
>> >>>>>        -  we now 100% run on the new class builder from the Slot
>> >>>>> Project.
>> >>>>>
>> >>>>> Next on the list (not all for Pharo3):
>> >>>>>
>> >>>>>        - remove PackageInfo
>> >>>>>        - old Browser + CodeHolder hierarchy
>> >>>>>        - PseudoClass&Co —> Ring
>> >>>>>        - old AST+Compiler (this in Pharo4)
>> >>>>>
>> >>>>> We already did (all in Pharo3):
>> >>>>>        -> remove URI
>> >>>>>        -> deprecated Url for ZnUrl
>> >>>>>        -> removed HTTPSocket facade
>> >>>>>        -> MIMEType retired for ZnMimeType
>> >>>>>        -> old Debugger is removed
>> >>>>>        -> Class categories are replaced by Protocols
>> >>>>>
>> >>>>> I am quite sure that these cleanups will enable us to build a lot of
>> >>>>> very interesting things
>> >>>>> in the future.
>> >>>>>
>> >>>>>        Marcus
>> >>>>
>> >>>>
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> www.tudorgirba.com
>> >>>
>> >>> "Every thing has its own flow"
>> >>
>> >>
>> >>
>> >
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20131125/0cf592e0/attachment-0002.html>


More information about the Pharo-dev mailing list