Pharo-dev
By thread
pharo-dev@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
October 2010
- 130 participants
- 1604 messages
Re: [Pharo-project] what happened with Shout colors in Pharo 1.1?
by Simon Denier
On 23 oct. 2010, at 19:13, Mariano Martinez Peck wrote:
>
> To customize colors, two solutions:
> 1) hack SHTextStylerST80>>defaultStyleTable
>
> did you do this? can you share?
Well that's the standard mechanism which was already in place. Just take a look at the comment to learn the format. It's a bit cumbersome to use though.
To change style for instance vars/class vars
(instVar ( blue muchDarker ) )
(classVar ( blue muchDarker ) )
To change style for class (actually it's more like access to global variables)
(poolConstant ( blue muchDarker ) )
(globalVar ( blue muchDarker ) )
>
> 2) load latest Shout and use Settings (then you should be able to save/load your style), since there is now a Settings interface
>
>
> The problem is that I have my own style also....and when you save an style I think you save it completly...I guess you cannot merge, so I will loose my own changes.
> Anyway, can you export and share the style so that I can take a look?
Yes, we talked about that with Alain at Esug. It would be cool if the 'choose packages' button, which filters entries in the settings, would also apply to saving style. That way we could only save partial settings.
Anyway, there's not much to change through the Settings browser. Easier to show there:
Before:
After:
--
Simon
Oct. 25, 2010
[Pharo-project] [update 1.2] #12214
by Marcus Denker
12214
-----
Issue 3156: StandardWindow should not redefine #initialExtent
Issue 2899: Slice creation should add dirty packages are dependent
Issue 2766: World Screen capture should be adapted to Pharo
Issue 2256: #sortBy: should be deprecated (minus the deprication call in sortBy:.. will come later)
--
Marcus Denker -- http://www.marcusdenker.de
INRIA Lille -- Nord Europe. Team RMoD.
Oct. 25, 2010
Re: [Pharo-project] Smells looking at collections
by Levente Uzonyi
On Sun, 24 Oct 2010, Eliot Miranda wrote:
> Hi Levente,
>
> in my experience playing with the Dan and Alan Borning's multiple
> inheritance implementation getting things to work was one thing, reasonably
> straighforward, but getting tool support right (file-out format so that
> things filed back in correctly, etc) was another, an dth ebulk of the work.
> Looking at your proposal below I see no problem getting it to work but see
> lots of problems integrating it, e.g. with Monticello, etc. Traits is
You're right, integration is hard. It would probably be harder than the
integration of Traits was.
> already integrated with Monticello, supported with tests, etc. As such it
> is a much less risky or effortful proposition than a new scheme. So with
> that in mind are there important functional benefits of your scheme's direct
> state access as compared with traits that use accessors to access state that
> each user of a trait must implement? i.e. what are the key benefits you see
> in direct inst var access?
I see four benefits:
- a bit better performance on current VMs
- no name conflict (accessors)
- accessor methods can also be reused
- the ability to reuse the code of existing classes (this may cause
problems)
Let's see the same example as a Trait:
Trait named: #TBidirectionalLink
uses: #()
category: 'ClassCompositionExample'
TBidirectionalLink >> unlink
self previous next: self next.
self next previous: self previous
TBidirectionalLink >> linkAfter: aBidirectionalLink
self previous: aBidirectionalLink.
self next: aBidirectionalLink next.
aBidirectionalLink next: self.
self next previous: self
And the user:
ECSelectorEntry subclass: #ODatedEntry
uses: TBidirectionalLink
instanceVariableNames: 'date next previous'
classVariableNames: ''
poolDictionaries: ''
category: 'Ocompletion'
ODatedEntry (and all other users of TBidirectionalLink) has to implement
four methods (the accessors):
ODatedEntry >> next
^next
ODatedEntry >> next: anODatedEntry
next := anODatedEntry
ODatedEntry >> previous
^previous
ODatedEntry >> previous: anODatedEntry
previous := anODatedEntry
This is only possible if ODatedEntry (or a superclass of it) doesn't
implement any of these methods, otherwise the Trait can't be used.
Levente
>
> best
> Eliot
>
> 2010/10/24 Levente Uzonyi <leves(a)elte.hu>
>
>> On Sun, 24 Oct 2010, Stéphane Ducasse wrote:
>>
>>
>>>>>
>>>>>> 2) well, this is difficult to get the money for the butter and the
>>>>>>> butter - we are trying.
>>>>>>>
>>>>>>
>>>>>> If you can compose classes the way you can add a trait to a class now
>>>>>> with class and optional method level instance+class variable mapping, then
>>>>>> you're done. It would be a lot simpler to use it _and_ it would also be a
>>>>>> lot easier to implement it. Especially the tools part.
>>>>>>
>>>>>
>>>>> I'm interested to hear more about that.
>>>>>
>>>>
>>> so can you explain what you meant because I did not understand it.
>>>
>>
>> Okay, here is an example of my class composition idea. It works like
>> Traits, but it supports state and there's no distinction between a trait and
>> a class. Let's say I have a class named BidirectionalLink which can be used
>> as a link in a linked list (with a head element). This will be used as a
>> stateful trait. It's definition is like this:
>>
>> Object subclass: #BidirectionalLink
>> instanceVariableNames: 'next previous'
>> classVariableNames: ''
>> poolDictionaries: ''
>> category: 'ClassCompositionExample'
>>
>> It has a few methods:
>>
>> BidirectionalLink >> next
>> ^next
>>
>> BidirectionalLink >> next: aBidirectionalLink
>> next := aBidirectionalLink
>>
>> BidirectionalLink >> previous
>> ^previous
>>
>> BidirectionalLink >> previous: aBidirectionalLink
>> previous := aBidirectionalLink
>>
>> BidirectionalLink >> unlink
>> previous next: next.
>> next previous: previous
>>
>> BidirectionalLink >> linkAfter: aBidirectionalLink
>> previous := aBidirectionalLink.
>> next := aBidirectionalLink next.
>> aBidirectionalLink next: self.
>> next previous: self
>>
>> I have an existing class, let's call it ODatedEntry :). It has the
>> following definition:
>>
>> ECSelectorEntry subclass: #ODatedEntry
>> instanceVariableNames: 'date'
>> classVariableNames: ''
>> poolDictionaries: ''
>> category: 'Ocompletion'
>>
>> As you can see, it inherits some state and behavior from ECSelectorEntry.
>> My goal is to use the instances of this class in a linked list. So these
>> objects should implement the same protocol with the same behavior as
>> BidirectionalLink. I can't make it a subclass of BidirectionalLink, because
>> I also need the behavior and state from ECSelectorEntry and we don't have
>> multiple inheritance. So I'll compose the two classes. First I add the
>> necessary instance variables to the class. Let's call them nextEntry and
>> previousEntry:
>>
>> ECSelectorEntry subclass: #ODatedEntry
>> instanceVariableNames: 'date nextEntry previousEntry'
>> classVariableNames: ''
>> poolDictionaries: ''
>> category: 'Ocompletion'
>>
>> Then do the composition:
>>
>> ECSelectorEntry subclass: #ODatedEntry
>> uses: BidirectionalLink
>> instanceVariableNames: 'date nextEntry previousEntry'
>> classVariableNames: ''
>> poolDictionaries: ''
>> category: 'Ocompletion'
>>
>> Now this doesn't work, because ODatedEntry doesn't have instance variables
>> named next and previous, but the methods of BidirectionalLink would like to
>> use them. Of course I could have used those names in the previous step and
>> (with a working implementation) this would just work out of the box. But the
>> example is about the instance variable mapping. Let's say ~ is the
>> composition operator which defines variable mapping for a class or a method.
>> Then I can write the following:
>>
>> ECSelectorEntry subclass: #ODatedEntry
>> uses: BidirectionalLink ~ { #nextEntry -> #next. #previousEntry ->
>> #previous }
>> instanceVariableNames: 'date nextEntry previousEntry'
>> classVariableNames: ''
>> poolDictionaries: ''
>> category: 'Ocompletion'
>>
>> This means: take all methods from BidirectionalLink, but replace the
>> variable named next with nextEntry and previous with previousEntry.
>> So now ODatedEntry understands #next, #next:, #previous, #unlink, etc.
>>
>> This is the basic concept. There are some open questions, like:
>> - what happens when a composed method (or a method sent by a composed
>> method, etc) has a super send?
>> - will the class also get the methods of the superclasses of the "trait"?
>> - how does it work on the class side?
>> - what about class variables?
>> - what if I don't want to use all methods, just a few?
>>
>>
>>>
>>> Tell us more. The problem we faced was
>>>>> - offset access = you cannot reuse bytecode of a trait because
>>>>> the order of the offset can be different in each trait users
>>>>>
>>>>
>>>> If you mean that a CompiledMethod of a trait cannot be added to the
>>>> class' method dictionary, than that's not an issue. The current Trait
>>>> implementation was changed, because shared CompiledMethods caused other
>>>> problems.
>>>>
>>>
>>> no this is not what I meant
>>>
>>> If you mean that the same bytecodes can't be used, than that's neither a
>>>> problem, because you can and should be compile the method again. Sharing
>>>> trailer bytes may cause problems.
>>>> So adding a method from a trait to a class is simply recompiling it in
>>>> the class' context.
>>>>
>>>
>>> this is what we wanted to avoid.
>>> Also because you may have to recompile all the other methods of the class
>>> hierarchy because if a trait add an instance
>>> variable then you should recompile the subclasses when a trait get added
>>> with a state in the superclass.
>>>
>>
>> My idea is that traits don't add instance variables. The user of the trait
>> maps the trait's variables to their own by name. So if a trait gets
>> a new variable, then only the trait and subclasses have to be recompiled.
>> The recompilation is postponed until a method of the trait which uses the
>> new instance variable is added to a class.
>>
>>
>>> Instance variables should be used by name during compilation. If there's
>>>> a name collision then use the instance variable map I mentioned above.
>>>>
>>>
>>> what is that the instance variable map?
>>> take the time to write an example
>>>
>>
>> See above.
>>
>>
>> Levente
>>
>>
>>> - initialization of instances variables at the trait level and the
>>>>> composition at the class levele
>>>>>
>>>>
>>>> You can always rename a trait's method in your class. So if the trait has
>>>> an #initialize method, then simply rename it to #initializeFooBar and send
>>>> it from the class' #initialize method.
>>>>
>>>
>>> Yes this is what the javascript implementation does but this is not that
>>> nice but may be there is no better solution.
>>>
>>> So indeed we could think about adding state.
>>>
>>>
>>>
>>>
>>>>
>>>> Levente
>>>>
>>>>
>>>>>
>>>>>> 3) again if nobody does anything and we just all cry on ourselves then
>>>>>>> nothing will happen.
>>>>>>>
>>>>>>
>>>>>> Tools are a must. No tools - no users.
>>>>>>
>>>>>
>>>>> Exact.
>>>>>
>>>>> So for now identifying traits and learning is the way. Then we can
>>>>>>> refactor, redesign
>>>>>>>
>>>>>>
>>>>>> Well, Traits are in Squeak since 2006, IIRC they were available a few
>>>>>> years earlier. So in the last X (at least 4) years the only good candidate
>>>>>> to become a Trait was Magnitude.
>>>>>>
>>>>>
>>>>> Come on.
>>>>> I will not answer to such statement because I'm positive thinking.
>>>>>
>>>>> Stef
>>>>> _______________________________________________
>>>>> Pharo-project mailing list
>>>>> Pharo-project(a)lists.gforge.inria.fr
>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>>>
>>>> _______________________________________________
>>>> Pharo-project mailing list
>>>> Pharo-project(a)lists.gforge.inria.fr
>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>>
>>>
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> Pharo-project(a)lists.gforge.inria.fr
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> Pharo-project(a)lists.gforge.inria.fr
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>
Oct. 25, 2010
Re: [Pharo-project] akuhn/SUnit: run faster tests first & step through tests
by Niko Schwarz
Couldn't Adrian be the maintainer? I could step in, too.
I don't really know what you have in mind for a testing framework. We
have our own independent and fully compatible fork of SUnit:
akuhn/SUnit, which is quite a strong code basis. And on top of that we
have Phexample, which has its own
name, some extra features and gives a clear point where Pharo is
different from the rest.
Just a suggestion: Let Adrian maintain akuhn/SUnit, perhaps minus the
"should" syntax that you don't like (as in: #(a b c) size should = 3),
and make akuhn/SUnit part of Pharo core. The new features (having tests depend
on one another, "should" syntax) go into Phexample, and I could
maintain that.
Cheers,
Niko
On Sun, Oct 24, 2010 at 8:37 AM, Stéphane Ducasse
<stephane.ducasse(a)inria.fr> wrote:
> Lack of maintainers, too many unwanted features, lack of explanation,
> large changes...
>
> And this is not that several persons did not look at the code. It got more than the average.
>
> Now I'm thinking that with discussion and care we should really get another testing framework with the same API that SUnit
> because if we want that PharoSunit is the same as Sunit then we are doomed to be backward compatible and no
> real improvements.
>
> Stef
>
> On Oct 23, 2010, at 10:58 PM, Adrian Kuhn wrote:
>
>> Sad to hear that.
>>
>> Technical difficulties, or just lack of customers? ^^
>>
>> --AA
>>
>> On Oct 23, 2010, at 08:05 , Stéphane Ducasse wrote:
>>
>>> It was too difficult to integrate.
>>>
>>> Stef
>>>
>>> On Oct 23, 2010, at 2:01 PM, Niko Schwarz wrote:
>>>
>>>> What's the status of akuhn/SUnit? I couldn't find his code in 1.2 core.
>>>>
>>>> Niko
>>>>
>>>> On Wed, Feb 3, 2010 at 1:13 PM, Stéphane Ducasse
>>>> <stephane.ducasse(a)inria.fr> wrote:
>>>>> this loads well in the latest 1,1 core :)
>>>>> so now we should really have a look and these cool changes
>>>>>
>>>>> Stef
>>>>>
>>>>> On Jan 6, 2010, at 2:38 PM, Adrian Kuhn wrote:
>>>>>
>>>>>> SystemChangeNotifier uniqueInstance
>>>>>> Â Â Â Â Â Â Â noMoreNotificationsFor: TestCase.
>>>>>> Â Â Gofer it
>>>>>> Â Â Â Â Â Â disablePackageCache;
>>>>>> Â Â Â Â Â Â squeaksource: 'akuhn';
>>>>>> Â Â Â Â Â Â package: 'SUnit';
>>>>>> Â Â Â Â Â Â package: 'SUnitGUI';
>>>>>> Â Â Â Â Â Â load.
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Pharo-project mailing list
>>>>> Pharo-project(a)lists.gforge.inria.fr
>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> http://scg.unibe.ch/staff/Schwarz
>>>> twitter.com/nes1983
>>>> Tel: +41 076 235 8683
>>>>
>>>> _______________________________________________
>>>> Pharo-project mailing list
>>>> Pharo-project(a)lists.gforge.inria.fr
>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>
>
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
--
http://scg.unibe.ch/staff/Schwarz
twitter.com/nes1983
Tel: +41 076 235 8683
Oct. 25, 2010
Re: [Pharo-project] Learning on Sockets
by laurent laffont
Thank you Noury.
Indeed for those interested in, I've just remembered that PBE is on github.
So we can read it here
http://github.com/SquareBracketAssociates/PharoByExample-english/blob/maste…
Cheers,
Laurent.
On Mon, Oct 25, 2010 at 8:40 AM, Noury Bouraqadi <bouraqadi(a)gmail.com>wrote:
> I can send you my PBE chapter on Socket (private email).
>
> Noury
> On 24 oct. 2010, at 11:51, laurent laffont wrote:
>
> > Hi,
> >
> > I want to record a screencast on basic networking and also explore this
> idea: http://forum.world.st/Community-in-the-IDE-tp2543540p2543540.html
> >
> > Do you have some links on documentation and/or good code to look at ? I'm
> searching for best practices / modelizations to write a chat server and
> client.
> >
> > Actually I've read and tried those:
> > http://book.pharo-project.org/book/networking/Socket
> > http://wiki.squeak.org/squeak/325
> >
> >
> > Cheers,
> >
> > Laurent Laffont
> >
> > Pharo Smalltalk Screencasts: http://www.pharocasts.com/
> > Blog: http://magaloma.blogspot.com/
> > _______________________________________________
> > Pharo-project mailing list
> > Pharo-project(a)lists.gforge.inria.fr
> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
Oct. 25, 2010
Re: [Pharo-project] Learning on Sockets
by Noury Bouraqadi
I can send you my PBE chapter on Socket (private email).
Noury
On 24 oct. 2010, at 11:51, laurent laffont wrote:
> Hi,
>
> I want to record a screencast on basic networking and also explore this idea: http://forum.world.st/Community-in-the-IDE-tp2543540p2543540.html
>
> Do you have some links on documentation and/or good code to look at ? I'm searching for best practices / modelizations to write a chat server and client.
>
> Actually I've read and tried those:
> http://book.pharo-project.org/book/networking/Socket
> http://wiki.squeak.org/squeak/325
>
>
> Cheers,
>
> Laurent Laffont
>
> Pharo Smalltalk Screencasts: http://www.pharocasts.com/
> Blog: http://magaloma.blogspot.com/
> _______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Oct. 25, 2010
Re: [Pharo-project] [ANN] ImageMap PharoKernel-12196
by Lukas Renggli
Ouch too bad, the image needs to get smaller to have a visual look at it :-)
On 22 October 2010 09:34, Pavel Krivanek <pavel.krivanek(a)gmail.com> wrote:
> Hi Lukas,
>
> I tried to generate the graph for the PharoKernel on a better machine,
> it consumed 6.2 GB of RAM, now it is running for 20 hours and it is
> still not complete :-)
>
> -- Pavel
>
> On Wed, Oct 20, 2010 at 10:53 PM, Pavel Krivanek
> <pavel.krivanek(a)gmail.com> wrote:
>> Hi Lukas,
>>
>> you can try it:
>> http://www.grandjihlava.cz/tmp/ImageGraph/ImageMap.st
>>
>> the command that generates the graph is
>> dot -Tsvg imageGraph.dot > imageGraph.svg
>>
>> Unfortunatelly my laptop has only 2GB so I have not enough RAM to
>> generate the graph for whole PharoKernel image ;-) The input file for
>> GraphViz has 67MB ;-)
>>
>> This is the resultant graph for the first 500 objects
>> http://www.grandjihlava.cz/tmp/ImageGraph/imageGraph.svg
>>
>> Cheers,
>> -- Pavel
>>
>> On Tue, Oct 19, 2010 at 9:15 PM, Lukas Renggli <renggli(a)gmail.com> wrote:
>>> Wow, this is really cool.
>>>
>>> Did you also try to visualize the object-graph using GraphViz?
>>>
>>> Lukas
>>>
>>> On 19 October 2010 20:49, Pavel Krivanek <pavel.krivanek(a)gmail.com> wrote:
>>>> Hi,
>>>>
>>>> I generated the PharoKernel ImageMap (hypertext representation of the
>>>> image content). You can see it here:
>>>>
>>>> http://goo.gl/nY2o
>>>>
>>>> The source code is here: http://goo.gl/J4T0
>>>> CSS style is here: http://goo.gl/Pxw2
>>>>
>>>> Use it carefully, for 2,2MB image it generates 77,6MB of HTML files :-)
>>>>
>>>> Cheers,
>>>> -- Pavel
>>>>
>>>> _______________________________________________
>>>> Pharo-project mailing list
>>>> Pharo-project(a)lists.gforge.inria.fr
>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>>
>>>
>>>
>>>
>>> --
>>> Lukas Renggli
>>> www.lukas-renggli.ch
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> Pharo-project(a)lists.gforge.inria.fr
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
--
Lukas Renggli
www.lukas-renggli.ch
Oct. 25, 2010
Re: [Pharo-project] Smells looking at collections
by Stéphane Ducasse
Eliot the main interest is in not having the responsibility to initialize the state of traits by the composite.
Now since we know that doing for real is difficult this is why with did Nile: we build from scratch a real lib using traits
and we wanted to see if we wanted state. The results were not really positive.
Now also what people may not know is that the implementation of traits we have was a complete rewrite of the one
of nathanael because proto are good but are proto. We try to keep xp for the research. Now I would like to take the time to rethink traits
and its implementation.
Stef
On Oct 25, 2010, at 4:07 AM, Eliot Miranda wrote:
> Hi Levente,
>
> in my experience playing with the Dan and Alan Borning's multiple inheritance implementation getting things to work was one thing, reasonably straighforward, but getting tool support right (file-out format so that things filed back in correctly, etc) was another, an dth ebulk of the work. Looking at your proposal below I see no problem getting it to work but see lots of problems integrating it, e.g. with Monticello, etc. Traits is already integrated with Monticello, supported with tests, etc. As such it is a much less risky or effortful proposition than a new scheme. So with that in mind are there important functional benefits of your scheme's direct state access as compared with traits that use accessors to access state that each user of a trait must implement? i.e. what are the key benefits you see in direct inst var access?
>
> best
> Eliot
>
> 2010/10/24 Levente Uzonyi <leves(a)elte.hu>
> On Sun, 24 Oct 2010, Stéphane Ducasse wrote:
>
>
>
> 2) well, this is difficult to get the money for the butter and the butter - we are trying.
>
> If you can compose classes the way you can add a trait to a class now with class and optional method level instance+class variable mapping, then you're done. It would be a lot simpler to use it _and_ it would also be a lot easier to implement it. Especially the tools part.
>
> I'm interested to hear more about that.
>
> so can you explain what you meant because I did not understand it.
>
> Okay, here is an example of my class composition idea. It works like Traits, but it supports state and there's no distinction between a trait and a class. Let's say I have a class named BidirectionalLink which can be used as a link in a linked list (with a head element). This will be used as a stateful trait. It's definition is like this:
>
> Object subclass: #BidirectionalLink
> instanceVariableNames: 'next previous'
> classVariableNames: ''
> poolDictionaries: ''
> category: 'ClassCompositionExample'
>
> It has a few methods:
>
> BidirectionalLink >> next
> ^next
>
> BidirectionalLink >> next: aBidirectionalLink
> next := aBidirectionalLink
>
> BidirectionalLink >> previous
> ^previous
>
> BidirectionalLink >> previous: aBidirectionalLink
> previous := aBidirectionalLink
>
> BidirectionalLink >> unlink
> previous next: next.
> next previous: previous
>
> BidirectionalLink >> linkAfter: aBidirectionalLink
> previous := aBidirectionalLink.
> next := aBidirectionalLink next.
> aBidirectionalLink next: self.
> next previous: self
>
> I have an existing class, let's call it ODatedEntry :). It has the following definition:
>
> ECSelectorEntry subclass: #ODatedEntry
> instanceVariableNames: 'date'
> classVariableNames: ''
> poolDictionaries: ''
> category: 'Ocompletion'
>
> As you can see, it inherits some state and behavior from ECSelectorEntry. My goal is to use the instances of this class in a linked list. So these objects should implement the same protocol with the same behavior as BidirectionalLink. I can't make it a subclass of BidirectionalLink, because I also need the behavior and state from ECSelectorEntry and we don't have multiple inheritance. So I'll compose the two classes. First I add the necessary instance variables to the class. Let's call them nextEntry and previousEntry:
>
> ECSelectorEntry subclass: #ODatedEntry
> instanceVariableNames: 'date nextEntry previousEntry'
> classVariableNames: ''
> poolDictionaries: ''
> category: 'Ocompletion'
>
> Then do the composition:
>
> ECSelectorEntry subclass: #ODatedEntry
> uses: BidirectionalLink
> instanceVariableNames: 'date nextEntry previousEntry'
> classVariableNames: ''
> poolDictionaries: ''
> category: 'Ocompletion'
>
> Now this doesn't work, because ODatedEntry doesn't have instance variables named next and previous, but the methods of BidirectionalLink would like to use them. Of course I could have used those names in the previous step and (with a working implementation) this would just work out of the box. But the example is about the instance variable mapping. Let's say ~ is the composition operator which defines variable mapping for a class or a method. Then I can write the following:
>
> ECSelectorEntry subclass: #ODatedEntry
> uses: BidirectionalLink ~ { #nextEntry -> #next. #previousEntry -> #previous }
> instanceVariableNames: 'date nextEntry previousEntry'
> classVariableNames: ''
> poolDictionaries: ''
> category: 'Ocompletion'
>
> This means: take all methods from BidirectionalLink, but replace the variable named next with nextEntry and previous with previousEntry.
> So now ODatedEntry understands #next, #next:, #previous, #unlink, etc.
>
> This is the basic concept. There are some open questions, like:
> - what happens when a composed method (or a method sent by a composed method, etc) has a super send?
> - will the class also get the methods of the superclasses of the "trait"?
> - how does it work on the class side?
> - what about class variables?
> - what if I don't want to use all methods, just a few?
>
>
>
> Tell us more. The problem we faced was
> - offset access = you cannot reuse bytecode of a trait because the order of the offset can be different in each trait users
>
> If you mean that a CompiledMethod of a trait cannot be added to the class' method dictionary, than that's not an issue. The current Trait implementation was changed, because shared CompiledMethods caused other problems.
>
> no this is not what I meant
>
> If you mean that the same bytecodes can't be used, than that's neither a problem, because you can and should be compile the method again. Sharing trailer bytes may cause problems.
> So adding a method from a trait to a class is simply recompiling it in the class' context.
>
> this is what we wanted to avoid.
> Also because you may have to recompile all the other methods of the class hierarchy because if a trait add an instance
> variable then you should recompile the subclasses when a trait get added with a state in the superclass.
>
> My idea is that traits don't add instance variables. The user of the trait maps the trait's variables to their own by name. So if a trait gets
> a new variable, then only the trait and subclasses have to be recompiled. The recompilation is postponed until a method of the trait which uses the new instance variable is added to a class.
>
>
> Instance variables should be used by name during compilation. If there's a name collision then use the instance variable map I mentioned above.
>
> what is that the instance variable map?
> take the time to write an example
>
> See above.
>
>
> Levente
>
>
> - initialization of instances variables at the trait level and the composition at the class levele
>
> You can always rename a trait's method in your class. So if the trait has an #initialize method, then simply rename it to #initializeFooBar and send it from the class' #initialize method.
>
> Yes this is what the javascript implementation does but this is not that nice but may be there is no better solution.
>
> So indeed we could think about adding state.
>
>
>
>
>
> Levente
>
>
>
> 3) again if nobody does anything and we just all cry on ourselves then nothing will happen.
>
> Tools are a must. No tools - no users.
>
> Exact.
>
> So for now identifying traits and learning is the way. Then we can refactor, redesign
>
> Well, Traits are in Squeak since 2006, IIRC they were available a few years earlier. So in the last X (at least 4) years the only good candidate to become a Trait was Magnitude.
>
> Come on.
> I will not answer to such statement because I'm positive thinking.
>
> Stef
> _______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
> _______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Oct. 25, 2010
Re: [Pharo-project] export information to PDF
by Stéphane Ducasse
if it works yes and if it does not pollutes everything.
So Esteban if you can package this behavior into a package we are interested. Probably look in 3.9
but I'm not sure that it was working there.
On Oct 25, 2010, at 12:42 AM, Esteban Lorenzano wrote:
> Some time ago, there was a functionality to export a morph as a .ps file, I don't remember in which pharo version that function was lost...maybe it is in a package, and can be loaded, I really don't know, but it should be nice :)
>
> Cheers,
> Esteban
>
> On 2010-10-24 09:58:09 -0300, name name <onor16(a)gmail.com> said:
>
>> Hello,
>> Could you tell me how can I export (or where I can found ) information that
>> I can get with a getter into a .pdf file?
>> Thanks
>> <span class=3D"ul-threaded" style=3D"margin: 0.5em 0pt 0pt -20px;"><span cl=
>> ass=3D"text-cell">=A0=A0=A0=A0 Hello,<br><br>Could you tell me how can I ex=
>> port (or where I can found )=20
>> =A0information that I can get with a getter into a .pdf file?
>> <br><br>Thanks
>> =09
>> =09
>> =09
>> </span></span>
>> _______________________________________________
>> Pharo-project mailing list
>> Pharo-project(a)lists.gforge.inria.fr
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
>
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Oct. 25, 2010
Re: [Pharo-project] Smells looking at collections
by Igor Stasenko
On 24 October 2010 23:45, Stéphane Ducasse <stephane.ducasse(a)inria.fr> wrote:
>>>
>>>>
>>>>> 2) well, this is difficult to get the money for the butter and the butter - we are trying.
>>>>
>>>> If you can compose classes the way you can add a trait to a class now with class and optional method level instance+class variable mapping, then you're done. It would be a lot simpler to use it _and_ it would also be a lot easier to implement it. Especially the tools part.
>>>
>>> I'm interested to hear more about that.
>
> so can you explain what you meant because I did not understand it.
>
>
>>> Tell us more. The problem we faced was
>>> Â Â Â - offset access = you cannot reuse bytecode of a trait because the order of the offset can be different in each trait users
>>
>> If you mean that a CompiledMethod of a trait cannot be added to the class' method dictionary, than that's not an issue. The current Trait implementation was changed, because shared CompiledMethods caused other problems.
>
> no this is not what I meant
>
>> If you mean that the same bytecodes can't be used, than that's neither a problem, because you can and should be compile the method again. Sharing trailer bytes may cause problems.
>> So adding a method from a trait to a class is simply recompiling it in the class' context.
>
> this is what we wanted to avoid.
Why? I think it having many benefits comparing to 'compiled once' idea.
We're slowly moving towards multiple environemnts, right?
So, what if i may want to use same trait in two different
environments, and one of its methods
using #Foo variable, which depending on environment could be one or
another class,
or be a classvar with different value.
It could be quite powerful thing for testing purposes. Suppose you
wanna test something against new implementation of old class.
Then you don't need to waste a time and replace Foo -> Bar, you just
need to put it in use in different environment,
where Foo implemented differently.
There are other things.. Suppose my class using different compiler
(#compilerClass). It means that any methods in class should be
compiled using that compiler. And trait methods should obey the same
rule without exception.
> Also because you may have to recompile all the other methods of the class hierarchy because if a trait add an instance
> variable then you should recompile the subclasses when a trait get added with a state in the superclass.
>
Yes, same as if you adding an extra ivar to existing class, which
having subclasses.
Nothing really scary.
>> Instance variables should be used by name during compilation. If there's a name collision then use the instance variable map I mentioned above.
>
> what is that the instance variable map?
> take the time to write an example
>
>>> Â Â Â - initialization of instances variables at the trait level and the composition at the class levele
>>
>> You can always rename a trait's method in your class. So if the trait has an #initialize method, then simply rename it to #initializeFooBar and send it from the class' #initialize method.
>
> Yes this is what the javascript implementation does but this is not that nice but may be there is no better solution.
>
> So indeed we could think about adding state.
>
>
>
>>
>>
>> Levente
>>
>>>
>>>>
>>>>> 3) again if nobody does anything and we just all cry on ourselves then nothing will happen.
>>>>
>>>> Tools are a must. No tools - no users.
>>>
>>> Exact.
>>>
>>>>> So for now identifying traits and learning is the way. Then we can refactor, redesign
>>>>
>>>> Well, Traits are in Squeak since 2006, IIRC they were available a few years earlier. So in the last X (at least 4) years the only good candidate to become a Trait was Magnitude.
>>>
>>> Come on.
>>> I will not answer to such statement because I'm positive thinking.
>>>
>>> Stef
>>> _______________________________________________
>>> Pharo-project mailing list
>>> Pharo-project(a)lists.gforge.inria.fr
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>> _______________________________________________
>> Pharo-project mailing list
>> Pharo-project(a)lists.gforge.inria.fr
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
--
Best regards,
Igor Stasenko AKA sig.
Oct. 25, 2010