Pharo-dev
By thread
pharo-dev@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- August
- 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
- 3 participants
- 144616 messages
Bloc question
by Alexandre Bergel
Hi!
In the class BlElement, what are the meaning of the variables: misc cursor
?
Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Aug. 26, 2016
[ANN] TaskIt v0.2
by Guille Polito
Hi all,
With Santi we wanted to share a new release of TaskIt, a concurrency
management library for Pharo. TaskIt development is done entirely in
github, using iceberg. Works like a charm. Please find below attached
the changes log with more information.
Cheers,
Guille & Santi
TaskIt
https://github.com/sbragagnolo/taskit
TaskIt is a library that ease Process usage in Pharo. It provides
abstractions to execute and synchronize concurrent tasks, and several
pre-built mechanisms that are useful for many application developers.
This chapter explores starts by familiarizing the reader with TaskIt's
abstractions, guided by examples and code snippets. At the end, we
discuss TaskIt extension points and possible customizations.
ChangesLog TaskIt v0.2
Major Features
* Task Runners
o NewProcessTaskRunner
o LocalProcessTaskRunner
o Worker
o WorkerPool
* Futures with callbacks
* Future combinators
* Future synchronous access
* Services
Infrastructure
* Travis CIhttps://travis-ci.org/sbragagnolo/taskit
* Documentationhttps://github.com/sbragagnolo/taskit/blob/master/README.md
Minor changes log (from commits)
* Enhanced class comments
* TKTWorker processes are terminated in case the worker is collected.
See Issues#8 <https://github.com/sbragagnolo/taskit/issues/8>and#5
<https://github.com/sbragagnolo/taskit/issues/5>
* Process Dashboard. - Adds TKTTaskItProcessProvider by default with
the extension package - Hides job and task fields since there are
not reachable any more.
Aug. 26, 2016
Re: [Pharo-dev] About Pharo 60
by phil@highoctane.be
List:
* image size management under control
* no more gradients in that UI (even in the light theme)
* modern "Material style" UI
* FASTER Nautilus
* better console support (in/out)
* Pharo VM as something I can embed in other programs
* something like npm.js for the packages list along with external package
manager to build my images
* integration with Hadoop ecosystem
* super easy to write REST clients and servers (including Swagger support)
Phil
On Fri, Aug 26, 2016 at 10:15 AM, stepharo <stepharo(a)free.fr> wrote:
> Thanks Peter
>
> I cannot find the list, but there were some things we discussed during
> consortium call a month or so ago. Maybe Esteban can find it?
>
> I want for Christmas
>
> * Better Spec
> * Roadmap so we know where we are going,
> * with clean API,
> * so we can build really live UIs (where you can drag windows around,
> close them, dock them, etc.
> * so we are ready for Bloc (can be for Easter too :))
> * Stability
> * I crash daily
>
> Obviously I can and I try to help with Spec, but I do not have the time or
> resources to lead it, and since we don't have any roadmap it's hard to go
> forward.
>
>
> I should say that I'm a bit stuck to understand where to start and
> what we want to achieve.
> The firs things I would do
> - Reading all the code to get a feel.
> - I would like to rename the class consistently a Model should be
> named Presenter and the Model whose name do not contain Model should still
> be renamed to contain Presenter.
>
> I need to review the changes made by marion and that have been
> published.
>
> Stef
>
>
>
>
>
>
>
Aug. 26, 2016
Re: [Pharo-dev] About asClass and friend
by phil@highoctane.be
On Fri, Aug 26, 2016 at 10:07 AM, Guille Polito <guillermopolito(a)gmail.com>
wrote:
> Hi!
>
> 1) I think we are failing also at communicating one point better. It is
> not that people is arguing against #asClass because it's ugly and bad and a
> terrible villain. Ok, maybe a bit, but also:
>
> The point is that #asClass, as it looks handy and easy to use, it may
> not work in the future.
>
> Why?
>
> Because if you imaging a Pharo with modules, explicit imports, and even
> namespaces, then you may have several classes with the same name. And then
> you may have name clashes. And #asClass will not have a single obvious
> result. And that makes #asClass both impractical and with no sense at the
> same time.
>
> One other reality:
>
> - We are thinking about a problem we do not yet have... :)
>
> 2) Then, I agree with Doru, with Luc and with (E)(Ste(f|ban)). But I also
> agree with Phil and myself. And my position says:
>
> - Let the kernel be clean. There should not be an #asClass or similar
> implementation as part of the kernel. This extension should exist not as
> part of the kernel but as part of other package (I'd vote for
> ScriptingExtensions for example).
>
> - Let the kernel be clean (bis). We should not have users of such
> *scripting nicety* inside the kernel. We should put in place a lint rule to
> validate that.
>
100% agreeing with that. I understand that concern. Not a stranger to Java
ClassLoading madness in JEE, well, yeah.
>
> - But we should let people use #asClass if they want in their code! And
> thus we should not deprecate it. We should not control what Phil does to
> get business. I agree that Pharo itself should not use #asClass, but also
> that (a good implementation of) #asClass or similar should be available for
> him. At the end, there will be so many packages and libraries out there
> that we have to realize we can only guarantee that Pharo gives you an
> empowering environment and people will use it and do whatever they want :).
>
One reason I like Pharo is also that I can work *without* all of that
package annoying concern in my user level code. Just one flat namespace,
easy to deal with.
VisualWorks does something like that with a default namespace as it seems.
Now, namespaced packages are good, but only if one needs them.
Comparing the Pharo with the Java codebases I've got here, well, navigating
Pharo is much easier and one can really grok a good amount of stuff.
The kernel and user space separation has been somewhat there for ages. Unix
anyone? I don't care about how the kernel is done as long as I have my API
available and I can load the .so I need.
>
> I updated the issue with some of these ideas
>
> https://pharo.fogbugz.com/f/cases/18987/Extract-asClass-and-
> friends-in-a-separate-package-and-deprecate
>
> Guille
>
> -------- Original Message --------
>
>> Hi,
>>
>> On Aug 26, 2016, at 9:10 AM, Esteban Lorenzano <estebanlm(a)gmail.com>
>>> wrote:
>>>
>>> On 26 Aug 2016, at 08:49, Luc Fabresse <luc.fabresse(a)gmail.com> wrote:
>>>>
>>>> Hi,
>>>>
>>>> My point of view is:
>>>>
>>>> 1) in code/core, we should use (we already said that with Camille in
>>>> the past ;-)):
>>>>
>>>> self environmentAt: #Blah
>>>>
>>>> Object>>environmentAt: aSymbol
>>>> ^ self class environmentAt: aSymbol
>>>>
>>>> Object class>>environmentAt: aSymbol
>>>> ...
>>>>
>>>> The idea is that we can then customize name resolution, per object, per
>>>> class and per module in the future.
>>>>
>>> +1
>>>
>>> 2) For scripting purpose, asClass is indeed useful (GTInspector, ...).
>>>> I would start simple as said before, re-package it and add a rule as
>>>> suggested by Denis.
>>>> Now, I am not sure that making asClass supporting name resolution in
>>>> another environment is really useful.
>>>> And if we do it using thisContext, some developers may use that instead
>>>> of "obj environmentAt: XXX" which would be bad.
>>>>
>>> I dislike a lot the thisContext resolution idea.
>>> If is bad is bad⦠and it will be bad also for scripting. I know, now it
>>> does not looks like adding value, but think about: #asClass is monolithic
>>> and #asClass with thisContext âlooks monolithicâ, IMO promoting a bad way
>>> of thinking problems in Pharo thus inducing confusion for non expert users.
>>>
>> No problem from my side. It was a proposal. I wanted to learn a bit and I
>> was looking for concrete arguments to learn from because I am likely
>> missing something. I still do not know why it is bad, but it is really not
>> important for the current issue.
>>
>> So, we agree that:
>> - move asClass together with all other in a separate package.
>> - introduce deprecation.
>>
>> I created an issue:
>> https://pharo.fogbugz.com/f/cases/18987/Extract-asClass-and-
>> friends-in-a-separate-package-and-deprecate
>>
>> Doru
>>
>>
>>
>> Esteban
>>>
>>> my 2KÄ,
>>>>
>>>> #Luc
>>>>
>>>> 2016-08-26 6:56 GMT+02:00 Tudor Girba <tudor(a)tudorgirba.com>:
>>>> Hi,
>>>>
>>>>
>>>>
>>>> On Aug 26, 2016, at 6:37 AM, stepharo <stepharo(a)free.fr> wrote:
>>>>>
>>>>> Thanks doru.
>>>>>
>>>>> I do not like when people think that we are complaining just because
>>>>> something changes.
>>>>>
>>>>> It should change for the better and we all agree on that.
>>>>>
>>>> Certainly. There are many points of view and many constraints. This is
>>>> why it is so important that we all bring forward those constraints because
>>>> only like this we can reach a global maximum.
>>>>
>>>> So, about asClass, everyone agrees that it should be moved to another
>>>> package. The open questions are:
>>>> - do we add an automatic deprecation for those that use it in code, or
>>>> - do we make use of thisContext to retrieve the environment?
>>>> (or both)
>>>>
>>>> Also, what about the asClassInEnvironment: method? Can it be used in
>>>> code, or do we better discourage its usage altogether? I am thinking that
>>>> if we have to write:
>>>> #MyClass asClassInEnvironment: self class environment
>>>> is even longer than:
>>>> self environment at: #MyClass
>>>> so, I think there is little point to it.
>>>>
>>>> In fact, for scripting what I find useful is not so much less
>>>> characters, but the lack of parentheses, hence unary methods. That is why
>>>> asClass is worth being salvaged for scripting (even with a solution that is
>>>> slower with thisContext), but the rest maybe can be removed. What do you
>>>> think?
>>>>
>>>> Cheers,
>>>> Doru
>>>>
>>>> Stef
>>>>>
>>>>>
>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> There exists already a method for that:
>>>>>>>>>> Symbol>>asClassInEnvironment:
>>>>>>>>>>
>>>>>>>>>> But, what if we introduce:
>>>>>>>>>>
>>>>>>>>>> Symbol>>asClassFrom: anObject
>>>>>>>>>> ^ self asClassInEnvironment: anObject class environment
>>>>>>>>>>
>>>>>>>>>> ?
>>>>>>>>>>
>>>>>>>>> The problem is asClass unary.
>>>>>>>>>
>>>>>>>>> All the tools should be parametrized by an environment.
>>>>>>>>>
>>>>>>>> Yes, but asClassFrom: would not be unary but would save us from
>>>>>>>> typing an extra "class environment" :).
>>>>>>>>
>>>>>>> Yes I see.
>>>>>>> But inside Pharo core tools we are ready to type
>>>>>>> environment as a message that dispatch to something else than a
>>>>>>> symbol.
>>>>>>>
>>>>>> Sure.
>>>>>>
>>>>>> This would allow us to still script and be dynamic.
>>>>>>>>>>
>>>>>>>>>> Furthermore, as #asClass is meant to be mainly used for
>>>>>>>>>> convenience, not performance, I would also propose to make it lookup in
>>>>>>>>>> thisContext and take the environment from there. I know that his might
>>>>>>>>>> sound like magic, but it would be the default that we are looking for (to
>>>>>>>>>> always lookup through the current environment dynamically).
>>>>>>>>>>
>>>>>>>>> argh I will die....:)
>>>>>>>>> No use of thisContext or only in the scripting package.
>>>>>>>>> :D
>>>>>>>>>
>>>>>>>>> Yes, yes. I just talked with Guille. Moving these scripting
>>>>>>>>> methods outside of the Kernel is clearly a must.
>>>>>>>>>
>>>>>>>> I think that each time you use them we will preempt cross
>>>>>>> compilation and others.
>>>>>>>
>>>>>> Yes, we agree that this method should not be used inside code.
>>>>>>
>>>>>> I was just thinking that we can make it so that we do not break any
>>>>>>>>> code while still making it dynamic.
>>>>>>>>>
>>>>>>>> I do not like your definition of dynamic. Sending a message to an
>>>>>>> object is dynamic.
>>>>>>> What you imply is compact. I can understand it when typing in
>>>>>>> playground.
>>>>>>>
>>>>>> By dynamic I meant the dispatch through âself class environmentâ or
>>>>>> âself environmentâ which is what people will use by default.
>>>>>>
>>>>>>
>>>>>> Like with scripting solutions there is a performance penalty, but
>>>>>>>>> that is fine if people choose to pay it (like in the case of
>>>>>>>>> Symbol>>#value:).
>>>>>>>>>
>>>>>>>> Yes for scripts. Not for core code.
>>>>>>> Since people tend to be a bit lazy I think that having rules will
>>>>>>> make sense.
>>>>>>>
>>>>>> Definitely.
>>>>>>
>>>>>> Doru
>>>>>>
>>>>>> Cheers,
>>>>>>>>> Doru
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> What do you think?
>>>>>>>>>>
>>>>>>>>>> Cheers,
>>>>>>>>>> Doru
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Aug 25, 2016, at 8:34 AM, Yuriy Tymchuk <yuriy.tymchuk(a)me.com>
>>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>> Just my 2 cents:
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> instead of
>>>>>>>>>>>
>>>>>>>>>>> #name asClass
>>>>>>>>>>>
>>>>>>>>>>> we have to use
>>>>>>>>>>>
>>>>>>>>>>> self class environment at: #name.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Maybe instead of #at: we can have #classNamed:? Or something
>>>>>>>>>>> similar? Because 1) itâs not obvious that the method will give you a class,
>>>>>>>>>>> what if in the future and environment can also have a mapping of something
>>>>>>>>>>> else like packages?
>>>>>>>>>>>
>>>>>>>>>>> Uko
>>>>>>>>>>>
>>>>>>>>>>> On 25 Aug 2016, at 07:21, stepharo <stepharo(a)free.fr> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>> Hi guys
>>>>>>>>>>>>
>>>>>>>>>>>> We got a meeting at ESUG with all the compiler guys and james
>>>>>>>>>>>> from gemstone.
>>>>>>>>>>>>
>>>>>>>>>>>> Our goal is to have a full tool suite that can be parametrized
>>>>>>>>>>>> by environments (so that
>>>>>>>>>>>>
>>>>>>>>>>>> we can compile code in other space, or compile other code
>>>>>>>>>>>> inside pharo).
>>>>>>>>>>>>
>>>>>>>>>>>> I personnally started this effort one decade ago. Now the
>>>>>>>>>>>> introduction
>>>>>>>>>>>>
>>>>>>>>>>>> of #asClass and friend is simply destroying all our efforts.
>>>>>>>>>>>> There was a discussion
>>>>>>>>>>>>
>>>>>>>>>>>> in the past but we are not listened.
>>>>>>>>>>>>
>>>>>>>>>>>> We will
>>>>>>>>>>>>
>>>>>>>>>>>> - packaged these extensions in a separate package
>>>>>>>>>>>>
>>>>>>>>>>>> - add rules to ban the use of such method in Pharo
>>>>>>>>>>>>
>>>>>>>>>>>> - fix all the use (again) to use the correct way to do it.
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> I can understand that for scripting this is easier but it
>>>>>>>>>>>> cannot be at that cost and impact.
>>>>>>>>>>>>
>>>>>>>>>>>> I hope that we will understand but we have to do something else
>>>>>>>>>>>> than
>>>>>>>>>>>>
>>>>>>>>>>>> fixing code that breaks our effort.
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Stef, Marcus, Guille and Luc
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> --
>>>>>>>>>> www.tudorgirba.com
>>>>>>>>>> www.feenk.com
>>>>>>>>>>
>>>>>>>>>> "It's not what we do that matters most, it's how we do it."
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>> www.tudorgirba.com
>>>>>>>> www.feenk.com
>>>>>>>>
>>>>>>>> "Quality cannot be an afterthought."
>>>>>>>>
>>>>>>> --
>>>>>> www.tudorgirba.com
>>>>>> www.feenk.com
>>>>>>
>>>>>> "Every thing has its own flow."
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>> --
>>>> www.tudorgirba.com
>>>> www.feenk.com
>>>>
>>>> "Every thing should have the right to be different."
>>>>
>>> --
>> www.tudorgirba.com
>> www.feenk.com
>>
>> "Be rather willing to give than demanding to get."
>>
>>
>>
>>
>>
>>
>>
>>
>
>
>
Aug. 26, 2016
Re: [Pharo-dev] About asClass and friend
by phil@highoctane.be
On Fri, Aug 26, 2016 at 9:10 AM, Esteban Lorenzano <estebanlm(a)gmail.com>
wrote:
>
> On 26 Aug 2016, at 08:49, Luc Fabresse <luc.fabresse(a)gmail.com> wrote:
>
> Hi,
>
> My point of view is:
>
> 1) in code/core, we should use (we already said that with Camille in the
> past ;-)):
>
> self environmentAt: #Blah
>
> Object>>environmentAt: aSymbol
> ^ self class environmentAt: aSymbol
>
> Object class>>environmentAt: aSymbol
> ...
>
> The idea is that we can then customize name resolution, per object, per
> class and per module in the future.
>
>
> +1
>
>
> 2) For scripting purpose, asClass is indeed useful (GTInspector, ...).
> I would start simple as said before, re-package it and add a rule as
> suggested by Denis.
> Now, I am not sure that making asClass supporting name resolution in
> another environment is really useful.
> And if we do it using thisContext, some developers may use that instead of
> "obj environmentAt: XXX" which would be bad.
>
>
> I dislike a lot the thisContext resolution idea.
> If is bad is bad⦠and it will be bad also for scripting. I know, now it
> does not looks like adding value, but think about: #asClass is monolithic
> and #asClass with thisContext âlooks monolithicâ, IMO promoting a bad way
> of thinking problems in Pharo thus inducing confusion for non expert users.
>
This makes me think about DynamicVariables for some reason. Will we get
interference in that "context" ?
Phil
>
> Esteban
>
>
> my 2KÄ,
>
> #Luc
>
> 2016-08-26 6:56 GMT+02:00 Tudor Girba <tudor(a)tudorgirba.com>:
>
>> Hi,
>>
>>
>>
>> > On Aug 26, 2016, at 6:37 AM, stepharo <stepharo(a)free.fr> wrote:
>> >
>> > Thanks doru.
>> >
>> > I do not like when people think that we are complaining just because
>> something changes.
>> >
>> > It should change for the better and we all agree on that.
>>
>> Certainly. There are many points of view and many constraints. This is
>> why it is so important that we all bring forward those constraints because
>> only like this we can reach a global maximum.
>>
>> So, about asClass, everyone agrees that it should be moved to another
>> package. The open questions are:
>> - do we add an automatic deprecation for those that use it in code, or
>> - do we make use of thisContext to retrieve the environment?
>> (or both)
>>
>> Also, what about the asClassInEnvironment: method? Can it be used in
>> code, or do we better discourage its usage altogether? I am thinking that
>> if we have to write:
>> #MyClass asClassInEnvironment: self class environment
>> is even longer than:
>> self environment at: #MyClass
>> so, I think there is little point to it.
>>
>> In fact, for scripting what I find useful is not so much less characters,
>> but the lack of parentheses, hence unary methods. That is why asClass is
>> worth being salvaged for scripting (even with a solution that is slower
>> with thisContext), but the rest maybe can be removed. What do you think?
>>
>> Cheers,
>> Doru
>>
>> >
>> > Stef
>> >
>> >
>> >>>>>> Hi,
>> >>>>>>
>> >>>>>> There exists already a method for that:
>> >>>>>> Symbol>>asClassInEnvironment:
>> >>>>>>
>> >>>>>> But, what if we introduce:
>> >>>>>>
>> >>>>>> Symbol>>asClassFrom: anObject
>> >>>>>> ^ self asClassInEnvironment: anObject class environment
>> >>>>>>
>> >>>>>> ?
>> >>>>> The problem is asClass unary.
>> >>>>>
>> >>>>> All the tools should be parametrized by an environment.
>> >>>> Yes, but asClassFrom: would not be unary but would save us from
>> typing an extra "class environment" :).
>> >>> Yes I see.
>> >>> But inside Pharo core tools we are ready to type
>> >>> environment as a message that dispatch to something else than a
>> symbol.
>> >> Sure.
>> >>
>> >>>>>> This would allow us to still script and be dynamic.
>> >>>>>>
>> >>>>>> Furthermore, as #asClass is meant to be mainly used for
>> convenience, not performance, I would also propose to make it lookup in
>> thisContext and take the environment from there. I know that his might
>> sound like magic, but it would be the default that we are looking for (to
>> always lookup through the current environment dynamically).
>> >>>>> argh I will die....:)
>> >>>>> No use of thisContext or only in the scripting package.
>> >>>>> :D
>> >>>>>
>> >>>>> Yes, yes. I just talked with Guille. Moving these scripting methods
>> outside of the Kernel is clearly a must.
>> >>> I think that each time you use them we will preempt cross compilation
>> and others.
>> >> Yes, we agree that this method should not be used inside code.
>> >>
>> >>>>> I was just thinking that we can make it so that we do not break any
>> code while still making it dynamic.
>> >>> I do not like your definition of dynamic. Sending a message to an
>> object is dynamic.
>> >>> What you imply is compact. I can understand it when typing in
>> playground.
>> >> By dynamic I meant the dispatch through âself class environmentâ or
>> âself environmentâ which is what people will use by default.
>> >>
>> >>
>> >>>>> Like with scripting solutions there is a performance penalty, but
>> that is fine if people choose to pay it (like in the case of
>> Symbol>>#value:).
>> >>> Yes for scripts. Not for core code.
>> >>> Since people tend to be a bit lazy I think that having rules will
>> make sense.
>> >> Definitely.
>> >>
>> >> Doru
>> >>
>> >>>>> Cheers,
>> >>>>> Doru
>> >>>>>
>> >>>>>
>> >>>>>> What do you think?
>> >>>>>>
>> >>>>>> Cheers,
>> >>>>>> Doru
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>>> On Aug 25, 2016, at 8:34 AM, Yuriy Tymchuk <yuriy.tymchuk(a)me.com>
>> wrote:
>> >>>>>>>
>> >>>>>>> Just my 2 cents:
>> >>>>>>>
>> >>>>>>>
>> >>>>>>> instead of
>> >>>>>>>
>> >>>>>>> #name asClass
>> >>>>>>>
>> >>>>>>> we have to use
>> >>>>>>>
>> >>>>>>> self class environment at: #name.
>> >>>>>>>
>> >>>>>>>
>> >>>>>>> Maybe instead of #at: we can have #classNamed:? Or something
>> similar? Because 1) itâs not obvious that the method will give you a class,
>> what if in the future and environment can also have a mapping of something
>> else like packages?
>> >>>>>>>
>> >>>>>>> Uko
>> >>>>>>>
>> >>>>>>>> On 25 Aug 2016, at 07:21, stepharo <stepharo(a)free.fr> wrote:
>> >>>>>>>>
>> >>>>>>>> Hi guys
>> >>>>>>>>
>> >>>>>>>> We got a meeting at ESUG with all the compiler guys and james
>> from gemstone.
>> >>>>>>>>
>> >>>>>>>> Our goal is to have a full tool suite that can be parametrized
>> by environments (so that
>> >>>>>>>>
>> >>>>>>>> we can compile code in other space, or compile other code inside
>> pharo).
>> >>>>>>>>
>> >>>>>>>> I personnally started this effort one decade ago. Now the
>> introduction
>> >>>>>>>>
>> >>>>>>>> of #asClass and friend is simply destroying all our efforts.
>> There was a discussion
>> >>>>>>>>
>> >>>>>>>> in the past but we are not listened.
>> >>>>>>>>
>> >>>>>>>> We will
>> >>>>>>>>
>> >>>>>>>> - packaged these extensions in a separate package
>> >>>>>>>>
>> >>>>>>>> - add rules to ban the use of such method in Pharo
>> >>>>>>>>
>> >>>>>>>> - fix all the use (again) to use the correct way to do it.
>> >>>>>>>>
>> >>>>>>>>
>> >>>>>>>> I can understand that for scripting this is easier but it cannot
>> be at that cost and impact.
>> >>>>>>>>
>> >>>>>>>> I hope that we will understand but we have to do something else
>> than
>> >>>>>>>>
>> >>>>>>>> fixing code that breaks our effort.
>> >>>>>>>>
>> >>>>>>>>
>> >>>>>>>> Stef, Marcus, Guille and Luc
>> >>>>>>>>
>> >>>>>>>>
>> >>>>>> --
>> >>>>>> www.tudorgirba.com
>> >>>>>> www.feenk.com
>> >>>>>>
>> >>>>>> "It's not what we do that matters most, it's how we do it."
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>> --
>> >>>> www.tudorgirba.com
>> >>>> www.feenk.com
>> >>>>
>> >>>> "Quality cannot be an afterthought."
>> >> --
>> >> www.tudorgirba.com
>> >> www.feenk.com
>> >>
>> >> "Every thing has its own flow."
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >
>> >
>>
>> --
>> www.tudorgirba.com
>> www.feenk.com
>>
>> "Every thing should have the right to be different."
>>
>>
>>
>>
>>
>>
>
>
Aug. 26, 2016
Re: [Pharo-dev] About asClass and friend
by phil@highoctane.be
On Fri, Aug 26, 2016 at 8:49 AM, Luc Fabresse <luc.fabresse(a)gmail.com>
wrote:
> Hi,
>
> My point of view is:
>
> 1) in code/core, we should use (we already said that with Camille in the
> past ;-)):
>
> self environmentAt: #Blah
>
Makes sense, looks nice.
>
> Object>>environmentAt: aSymbol
> ^ self class environmentAt: aSymbol
>
> Object class>>environmentAt: aSymbol
> ...
>
> The idea is that we can then customize name resolution, per object, per
> class and per module in the future.
>
> 2) For scripting purpose, asClass is indeed useful (GTInspector, ...).
> I would start simple as said before, re-package it and add a rule as
> suggested by Denis.
> Now, I am not sure that making asClass supporting name resolution in
> another environment is really useful.
>
For me, #Symbol asClass is really for yet unknown things with scripts
(build or configuration).
To avoid those pesky errors in the loading process.
I just love being able to do
(#ConfigurationOfXYZ asClass project ... ) load
in an image building script that doesn't yet have a clue of
ConfigurationOfXYZ b/c Gofer will load the packages.
Same story when loading specific packages based on a configuration file
symbol.
config:
Config equipmentSupportPackageSpec: #EquipmentXYZSupportPackage.
Config>>equipmentSupportPackage
^ self equipmentSupportPackageSpec asClass new
I can live with the new way but this just feels handy as hell.
> And if we do it using thisContext, some developers may use that instead of
> "obj environmentAt: XXX" which would be bad.
>
>
> my 2KÄ,
>
Thanks for chiming in.
Phil
>
> #Luc
>
> 2016-08-26 6:56 GMT+02:00 Tudor Girba <tudor(a)tudorgirba.com>:
>
>> Hi,
>>
>>
>>
>> > On Aug 26, 2016, at 6:37 AM, stepharo <stepharo(a)free.fr> wrote:
>> >
>> > Thanks doru.
>> >
>> > I do not like when people think that we are complaining just because
>> something changes.
>> >
>> > It should change for the better and we all agree on that.
>>
>> Certainly. There are many points of view and many constraints. This is
>> why it is so important that we all bring forward those constraints because
>> only like this we can reach a global maximum.
>>
>> So, about asClass, everyone agrees that it should be moved to another
>> package. The open questions are:
>> - do we add an automatic deprecation for those that use it in code, or
>> - do we make use of thisContext to retrieve the environment?
>> (or both)
>>
>> Also, what about the asClassInEnvironment: method? Can it be used in
>> code, or do we better discourage its usage altogether? I am thinking that
>> if we have to write:
>> #MyClass asClassInEnvironment: self class environment
>> is even longer than:
>> self environment at: #MyClass
>> so, I think there is little point to it.
>>
>> In fact, for scripting what I find useful is not so much less characters,
>> but the lack of parentheses, hence unary methods. That is why asClass is
>> worth being salvaged for scripting (even with a solution that is slower
>> with thisContext), but the rest maybe can be removed. What do you think?
>>
>> Cheers,
>> Doru
>>
>> >
>> > Stef
>> >
>> >
>> >>>>>> Hi,
>> >>>>>>
>> >>>>>> There exists already a method for that:
>> >>>>>> Symbol>>asClassInEnvironment:
>> >>>>>>
>> >>>>>> But, what if we introduce:
>> >>>>>>
>> >>>>>> Symbol>>asClassFrom: anObject
>> >>>>>> ^ self asClassInEnvironment: anObject class environment
>> >>>>>>
>> >>>>>> ?
>> >>>>> The problem is asClass unary.
>> >>>>>
>> >>>>> All the tools should be parametrized by an environment.
>> >>>> Yes, but asClassFrom: would not be unary but would save us from
>> typing an extra "class environment" :).
>> >>> Yes I see.
>> >>> But inside Pharo core tools we are ready to type
>> >>> environment as a message that dispatch to something else than a
>> symbol.
>> >> Sure.
>> >>
>> >>>>>> This would allow us to still script and be dynamic.
>> >>>>>>
>> >>>>>> Furthermore, as #asClass is meant to be mainly used for
>> convenience, not performance, I would also propose to make it lookup in
>> thisContext and take the environment from there. I know that his might
>> sound like magic, but it would be the default that we are looking for (to
>> always lookup through the current environment dynamically).
>> >>>>> argh I will die....:)
>> >>>>> No use of thisContext or only in the scripting package.
>> >>>>> :D
>> >>>>>
>> >>>>> Yes, yes. I just talked with Guille. Moving these scripting methods
>> outside of the Kernel is clearly a must.
>> >>> I think that each time you use them we will preempt cross compilation
>> and others.
>> >> Yes, we agree that this method should not be used inside code.
>> >>
>> >>>>> I was just thinking that we can make it so that we do not break any
>> code while still making it dynamic.
>> >>> I do not like your definition of dynamic. Sending a message to an
>> object is dynamic.
>> >>> What you imply is compact. I can understand it when typing in
>> playground.
>> >> By dynamic I meant the dispatch through âself class environmentâ or
>> âself environmentâ which is what people will use by default.
>> >>
>> >>
>> >>>>> Like with scripting solutions there is a performance penalty, but
>> that is fine if people choose to pay it (like in the case of
>> Symbol>>#value:).
>> >>> Yes for scripts. Not for core code.
>> >>> Since people tend to be a bit lazy I think that having rules will
>> make sense.
>> >> Definitely.
>> >>
>> >> Doru
>> >>
>> >>>>> Cheers,
>> >>>>> Doru
>> >>>>>
>> >>>>>
>> >>>>>> What do you think?
>> >>>>>>
>> >>>>>> Cheers,
>> >>>>>> Doru
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>>> On Aug 25, 2016, at 8:34 AM, Yuriy Tymchuk <yuriy.tymchuk(a)me.com>
>> wrote:
>> >>>>>>>
>> >>>>>>> Just my 2 cents:
>> >>>>>>>
>> >>>>>>>
>> >>>>>>> instead of
>> >>>>>>>
>> >>>>>>> #name asClass
>> >>>>>>>
>> >>>>>>> we have to use
>> >>>>>>>
>> >>>>>>> self class environment at: #name.
>> >>>>>>>
>> >>>>>>>
>> >>>>>>> Maybe instead of #at: we can have #classNamed:? Or something
>> similar? Because 1) itâs not obvious that the method will give you a class,
>> what if in the future and environment can also have a mapping of something
>> else like packages?
>> >>>>>>>
>> >>>>>>> Uko
>> >>>>>>>
>> >>>>>>>> On 25 Aug 2016, at 07:21, stepharo <stepharo(a)free.fr> wrote:
>> >>>>>>>>
>> >>>>>>>> Hi guys
>> >>>>>>>>
>> >>>>>>>> We got a meeting at ESUG with all the compiler guys and james
>> from gemstone.
>> >>>>>>>>
>> >>>>>>>> Our goal is to have a full tool suite that can be parametrized
>> by environments (so that
>> >>>>>>>>
>> >>>>>>>> we can compile code in other space, or compile other code inside
>> pharo).
>> >>>>>>>>
>> >>>>>>>> I personnally started this effort one decade ago. Now the
>> introduction
>> >>>>>>>>
>> >>>>>>>> of #asClass and friend is simply destroying all our efforts.
>> There was a discussion
>> >>>>>>>>
>> >>>>>>>> in the past but we are not listened.
>> >>>>>>>>
>> >>>>>>>> We will
>> >>>>>>>>
>> >>>>>>>> - packaged these extensions in a separate package
>> >>>>>>>>
>> >>>>>>>> - add rules to ban the use of such method in Pharo
>> >>>>>>>>
>> >>>>>>>> - fix all the use (again) to use the correct way to do it.
>> >>>>>>>>
>> >>>>>>>>
>> >>>>>>>> I can understand that for scripting this is easier but it cannot
>> be at that cost and impact.
>> >>>>>>>>
>> >>>>>>>> I hope that we will understand but we have to do something else
>> than
>> >>>>>>>>
>> >>>>>>>> fixing code that breaks our effort.
>> >>>>>>>>
>> >>>>>>>>
>> >>>>>>>> Stef, Marcus, Guille and Luc
>> >>>>>>>>
>> >>>>>>>>
>> >>>>>> --
>> >>>>>> www.tudorgirba.com
>> >>>>>> www.feenk.com
>> >>>>>>
>> >>>>>> "It's not what we do that matters most, it's how we do it."
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>> --
>> >>>> www.tudorgirba.com
>> >>>> www.feenk.com
>> >>>>
>> >>>> "Quality cannot be an afterthought."
>> >> --
>> >> www.tudorgirba.com
>> >> www.feenk.com
>> >>
>> >> "Every thing has its own flow."
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >
>> >
>>
>> --
>> www.tudorgirba.com
>> www.feenk.com
>>
>> "Every thing should have the right to be different."
>>
>>
>>
>>
>>
>>
>
Aug. 26, 2016
Re: [Pharo-dev] About Pharo 60
by stepharo
Thanks Peter
> I cannot find the list, but there were some things we discussed during
> consortium call a month or so ago. Maybe Esteban can find it?
>
> I want for Christmas
>
> * Better Spec
> * Roadmap so we know where we are going,
> * with clean API,
> * so we can build really live UIs (where you can drag windows
> around, close them, dock them, etc.
> * so we are ready for Bloc (can be for Easter too :))
> * Stability
> * I crash daily
>
> Obviously I can and I try to help with Spec, but I do not have the
> time or resources to lead it, and since we don't have any roadmap it's
> hard to go forward.
I should say that I'm a bit stuck to understand where to start and
what we want to achieve.
The firs things I would do
- Reading all the code to get a feel.
- I would like to rename the class consistently a Model should
be named Presenter and the Model whose name do not contain Model should
still be renamed to contain Presenter.
I need to review the changes made by marion and that have been
published.
Stef
>
>
Aug. 26, 2016
Re: [Pharo-dev] UIprocess around when loading broken code
by Guille Polito
- I evaluated this
SyntaxErrorNotification inClass: Object category: 'test' withCode:
'incorrect' doitFlag: false errorMessage: 'error' location: 1.
- fixed the code in the opening window,
- did ctrl+s
and voilà , I had two UI processes.
Looks like it but I'm getting out of battery right now to do some more
testing.
Guille
-------- Original Message --------
> Hi
>
>
> yesterday I started to port omnibase to pharo and it uses the old API
> apicall:
>
> so it breaks when loading.
>
> I got some windows showing errors and after the image was full of new
> UIProcess.
> Can someone try to reproduce it and I think that we should fix it?
>
>
> Stef
>
>
Aug. 26, 2016
Re: [Pharo-dev] About asClass and friend
by Guille Polito
Hi!
1) I think we are failing also at communicating one point better. It is
not that people is arguing against #asClass because it's ugly and bad
and a terrible villain. Ok, maybe a bit, but also:
The point is that #asClass, as it looks handy and easy to use, it
may not work in the future.
Why?
Because if you imaging a Pharo with modules, explicit imports, and
even namespaces, then you may have several classes with the same name.
And then you may have name clashes. And #asClass will not have a single
obvious result. And that makes #asClass both impractical and with no
sense at the same time.
One other reality:
- We are thinking about a problem we do not yet have... :)
2) Then, I agree with Doru, with Luc and with (E)(Ste(f|ban)). But I
also agree with Phil and myself. And my position says:
- Let the kernel be clean. There should not be an #asClass or similar
implementation as part of the kernel. This extension should exist not as
part of the kernel but as part of other package (I'd vote for
ScriptingExtensions for example).
- Let the kernel be clean (bis). We should not have users of such
*scripting nicety* inside the kernel. We should put in place a lint rule
to validate that.
- But we should let people use #asClass if they want in their code! And
thus we should not deprecate it. We should not control what Phil does to
get business. I agree that Pharo itself should not use #asClass, but
also that (a good implementation of) #asClass or similar should be
available for him. At the end, there will be so many packages and
libraries out there that we have to realize we can only guarantee that
Pharo gives you an empowering environment and people will use it and do
whatever they want :).
I updated the issue with some of these ideas
https://pharo.fogbugz.com/f/cases/18987/Extract-asClass-and-friends-in-a-se…
Guille
-------- Original Message --------
> Hi,
>
>> On Aug 26, 2016, at 9:10 AM, Esteban Lorenzano <estebanlm(a)gmail.com> wrote:
>>
>>> On 26 Aug 2016, at 08:49, Luc Fabresse <luc.fabresse(a)gmail.com> wrote:
>>>
>>> Hi,
>>>
>>> My point of view is:
>>>
>>> 1) in code/core, we should use (we already said that with Camille in the past ;-)):
>>>
>>> self environmentAt: #Blah
>>>
>>> Object>>environmentAt: aSymbol
>>> ^ self class environmentAt: aSymbol
>>>
>>> Object class>>environmentAt: aSymbol
>>> ...
>>>
>>> The idea is that we can then customize name resolution, per object, per class and per module in the future.
>> +1
>>
>>> 2) For scripting purpose, asClass is indeed useful (GTInspector, ...).
>>> I would start simple as said before, re-package it and add a rule as suggested by Denis.
>>> Now, I am not sure that making asClass supporting name resolution in another environment is really useful.
>>> And if we do it using thisContext, some developers may use that instead of "obj environmentAt: XXX" which would be bad.
>> I dislike a lot the thisContext resolution idea.
>> If is bad is bad⦠and it will be bad also for scripting. I know, now it does not looks like adding value, but think about: #asClass is monolithic and #asClass with thisContext âlooks monolithicâ, IMO promoting a bad way of thinking problems in Pharo thus inducing confusion for non expert users.
> No problem from my side. It was a proposal. I wanted to learn a bit and I was looking for concrete arguments to learn from because I am likely missing something. I still do not know why it is bad, but it is really not important for the current issue.
>
> So, we agree that:
> - move asClass together with all other in a separate package.
> - introduce deprecation.
>
> I created an issue:
> https://pharo.fogbugz.com/f/cases/18987/Extract-asClass-and-friends-in-a-se…
>
> Doru
>
>
>
>> Esteban
>>
>>> my 2KÄ,
>>>
>>> #Luc
>>>
>>> 2016-08-26 6:56 GMT+02:00 Tudor Girba <tudor(a)tudorgirba.com>:
>>> Hi,
>>>
>>>
>>>
>>>> On Aug 26, 2016, at 6:37 AM, stepharo <stepharo(a)free.fr> wrote:
>>>>
>>>> Thanks doru.
>>>>
>>>> I do not like when people think that we are complaining just because something changes.
>>>>
>>>> It should change for the better and we all agree on that.
>>> Certainly. There are many points of view and many constraints. This is why it is so important that we all bring forward those constraints because only like this we can reach a global maximum.
>>>
>>> So, about asClass, everyone agrees that it should be moved to another package. The open questions are:
>>> - do we add an automatic deprecation for those that use it in code, or
>>> - do we make use of thisContext to retrieve the environment?
>>> (or both)
>>>
>>> Also, what about the asClassInEnvironment: method? Can it be used in code, or do we better discourage its usage altogether? I am thinking that if we have to write:
>>> #MyClass asClassInEnvironment: self class environment
>>> is even longer than:
>>> self environment at: #MyClass
>>> so, I think there is little point to it.
>>>
>>> In fact, for scripting what I find useful is not so much less characters, but the lack of parentheses, hence unary methods. That is why asClass is worth being salvaged for scripting (even with a solution that is slower with thisContext), but the rest maybe can be removed. What do you think?
>>>
>>> Cheers,
>>> Doru
>>>
>>>> Stef
>>>>
>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> There exists already a method for that:
>>>>>>>>> Symbol>>asClassInEnvironment:
>>>>>>>>>
>>>>>>>>> But, what if we introduce:
>>>>>>>>>
>>>>>>>>> Symbol>>asClassFrom: anObject
>>>>>>>>> ^ self asClassInEnvironment: anObject class environment
>>>>>>>>>
>>>>>>>>> ?
>>>>>>>> The problem is asClass unary.
>>>>>>>>
>>>>>>>> All the tools should be parametrized by an environment.
>>>>>>> Yes, but asClassFrom: would not be unary but would save us from typing an extra "class environment" :).
>>>>>> Yes I see.
>>>>>> But inside Pharo core tools we are ready to type
>>>>>> environment as a message that dispatch to something else than a symbol.
>>>>> Sure.
>>>>>
>>>>>>>>> This would allow us to still script and be dynamic.
>>>>>>>>>
>>>>>>>>> Furthermore, as #asClass is meant to be mainly used for convenience, not performance, I would also propose to make it lookup in thisContext and take the environment from there. I know that his might sound like magic, but it would be the default that we are looking for (to always lookup through the current environment dynamically).
>>>>>>>> argh I will die....:)
>>>>>>>> No use of thisContext or only in the scripting package.
>>>>>>>> :D
>>>>>>>>
>>>>>>>> Yes, yes. I just talked with Guille. Moving these scripting methods outside of the Kernel is clearly a must.
>>>>>> I think that each time you use them we will preempt cross compilation and others.
>>>>> Yes, we agree that this method should not be used inside code.
>>>>>
>>>>>>>> I was just thinking that we can make it so that we do not break any code while still making it dynamic.
>>>>>> I do not like your definition of dynamic. Sending a message to an object is dynamic.
>>>>>> What you imply is compact. I can understand it when typing in playground.
>>>>> By dynamic I meant the dispatch through âself class environmentâ or âself environmentâ which is what people will use by default.
>>>>>
>>>>>
>>>>>>>> Like with scripting solutions there is a performance penalty, but that is fine if people choose to pay it (like in the case of Symbol>>#value:).
>>>>>> Yes for scripts. Not for core code.
>>>>>> Since people tend to be a bit lazy I think that having rules will make sense.
>>>>> Definitely.
>>>>>
>>>>> Doru
>>>>>
>>>>>>>> Cheers,
>>>>>>>> Doru
>>>>>>>>
>>>>>>>>
>>>>>>>>> What do you think?
>>>>>>>>>
>>>>>>>>> Cheers,
>>>>>>>>> Doru
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> On Aug 25, 2016, at 8:34 AM, Yuriy Tymchuk <yuriy.tymchuk(a)me.com> wrote:
>>>>>>>>>>
>>>>>>>>>> Just my 2 cents:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> instead of
>>>>>>>>>>
>>>>>>>>>> #name asClass
>>>>>>>>>>
>>>>>>>>>> we have to use
>>>>>>>>>>
>>>>>>>>>> self class environment at: #name.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Maybe instead of #at: we can have #classNamed:? Or something similar? Because 1) itâs not obvious that the method will give you a class, what if in the future and environment can also have a mapping of something else like packages?
>>>>>>>>>>
>>>>>>>>>> Uko
>>>>>>>>>>
>>>>>>>>>>> On 25 Aug 2016, at 07:21, stepharo <stepharo(a)free.fr> wrote:
>>>>>>>>>>>
>>>>>>>>>>> Hi guys
>>>>>>>>>>>
>>>>>>>>>>> We got a meeting at ESUG with all the compiler guys and james from gemstone.
>>>>>>>>>>>
>>>>>>>>>>> Our goal is to have a full tool suite that can be parametrized by environments (so that
>>>>>>>>>>>
>>>>>>>>>>> we can compile code in other space, or compile other code inside pharo).
>>>>>>>>>>>
>>>>>>>>>>> I personnally started this effort one decade ago. Now the introduction
>>>>>>>>>>>
>>>>>>>>>>> of #asClass and friend is simply destroying all our efforts. There was a discussion
>>>>>>>>>>>
>>>>>>>>>>> in the past but we are not listened.
>>>>>>>>>>>
>>>>>>>>>>> We will
>>>>>>>>>>>
>>>>>>>>>>> - packaged these extensions in a separate package
>>>>>>>>>>>
>>>>>>>>>>> - add rules to ban the use of such method in Pharo
>>>>>>>>>>>
>>>>>>>>>>> - fix all the use (again) to use the correct way to do it.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> I can understand that for scripting this is easier but it cannot be at that cost and impact.
>>>>>>>>>>>
>>>>>>>>>>> I hope that we will understand but we have to do something else than
>>>>>>>>>>>
>>>>>>>>>>> fixing code that breaks our effort.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Stef, Marcus, Guille and Luc
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> www.tudorgirba.com
>>>>>>>>> www.feenk.com
>>>>>>>>>
>>>>>>>>> "It's not what we do that matters most, it's how we do it."
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>> --
>>>>>>> www.tudorgirba.com
>>>>>>> www.feenk.com
>>>>>>>
>>>>>>> "Quality cannot be an afterthought."
>>>>> --
>>>>> www.tudorgirba.com
>>>>> www.feenk.com
>>>>>
>>>>> "Every thing has its own flow."
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>> --
>>> www.tudorgirba.com
>>> www.feenk.com
>>>
>>> "Every thing should have the right to be different."
> --
> www.tudorgirba.com
> www.feenk.com
>
> "Be rather willing to give than demanding to get."
>
>
>
>
>
>
>
Aug. 26, 2016
Re: [Pharo-dev] About asClass and friend
by Tudor Girba
Hi,
> On Aug 26, 2016, at 9:10 AM, Esteban Lorenzano <estebanlm(a)gmail.com> wrote:
>
>>
>> On 26 Aug 2016, at 08:49, Luc Fabresse <luc.fabresse(a)gmail.com> wrote:
>>
>> Hi,
>>
>> My point of view is:
>>
>> 1) in code/core, we should use (we already said that with Camille in the past ;-)):
>>
>> self environmentAt: #Blah
>>
>> Object>>environmentAt: aSymbol
>> ^ self class environmentAt: aSymbol
>>
>> Object class>>environmentAt: aSymbol
>> ...
>>
>> The idea is that we can then customize name resolution, per object, per class and per module in the future.
>
> +1
>
>>
>> 2) For scripting purpose, asClass is indeed useful (GTInspector, ...).
>> I would start simple as said before, re-package it and add a rule as suggested by Denis.
>> Now, I am not sure that making asClass supporting name resolution in another environment is really useful.
>> And if we do it using thisContext, some developers may use that instead of "obj environmentAt: XXX" which would be bad.
>
> I dislike a lot the thisContext resolution idea.
> If is bad is bad⦠and it will be bad also for scripting. I know, now it does not looks like adding value, but think about: #asClass is monolithic and #asClass with thisContext âlooks monolithicâ, IMO promoting a bad way of thinking problems in Pharo thus inducing confusion for non expert users.
No problem from my side. It was a proposal. I wanted to learn a bit and I was looking for concrete arguments to learn from because I am likely missing something. I still do not know why it is bad, but it is really not important for the current issue.
So, we agree that:
- move asClass together with all other in a separate package.
- introduce deprecation.
I created an issue:
https://pharo.fogbugz.com/f/cases/18987/Extract-asClass-and-friends-in-a-se…
Doru
> Esteban
>
>>
>> my 2KÄ,
>>
>> #Luc
>>
>> 2016-08-26 6:56 GMT+02:00 Tudor Girba <tudor(a)tudorgirba.com>:
>> Hi,
>>
>>
>>
>> > On Aug 26, 2016, at 6:37 AM, stepharo <stepharo(a)free.fr> wrote:
>> >
>> > Thanks doru.
>> >
>> > I do not like when people think that we are complaining just because something changes.
>> >
>> > It should change for the better and we all agree on that.
>>
>> Certainly. There are many points of view and many constraints. This is why it is so important that we all bring forward those constraints because only like this we can reach a global maximum.
>>
>> So, about asClass, everyone agrees that it should be moved to another package. The open questions are:
>> - do we add an automatic deprecation for those that use it in code, or
>> - do we make use of thisContext to retrieve the environment?
>> (or both)
>>
>> Also, what about the asClassInEnvironment: method? Can it be used in code, or do we better discourage its usage altogether? I am thinking that if we have to write:
>> #MyClass asClassInEnvironment: self class environment
>> is even longer than:
>> self environment at: #MyClass
>> so, I think there is little point to it.
>>
>> In fact, for scripting what I find useful is not so much less characters, but the lack of parentheses, hence unary methods. That is why asClass is worth being salvaged for scripting (even with a solution that is slower with thisContext), but the rest maybe can be removed. What do you think?
>>
>> Cheers,
>> Doru
>>
>> >
>> > Stef
>> >
>> >
>> >>>>>> Hi,
>> >>>>>>
>> >>>>>> There exists already a method for that:
>> >>>>>> Symbol>>asClassInEnvironment:
>> >>>>>>
>> >>>>>> But, what if we introduce:
>> >>>>>>
>> >>>>>> Symbol>>asClassFrom: anObject
>> >>>>>> ^ self asClassInEnvironment: anObject class environment
>> >>>>>>
>> >>>>>> ?
>> >>>>> The problem is asClass unary.
>> >>>>>
>> >>>>> All the tools should be parametrized by an environment.
>> >>>> Yes, but asClassFrom: would not be unary but would save us from typing an extra "class environment" :).
>> >>> Yes I see.
>> >>> But inside Pharo core tools we are ready to type
>> >>> environment as a message that dispatch to something else than a symbol.
>> >> Sure.
>> >>
>> >>>>>> This would allow us to still script and be dynamic.
>> >>>>>>
>> >>>>>> Furthermore, as #asClass is meant to be mainly used for convenience, not performance, I would also propose to make it lookup in thisContext and take the environment from there. I know that his might sound like magic, but it would be the default that we are looking for (to always lookup through the current environment dynamically).
>> >>>>> argh I will die....:)
>> >>>>> No use of thisContext or only in the scripting package.
>> >>>>> :D
>> >>>>>
>> >>>>> Yes, yes. I just talked with Guille. Moving these scripting methods outside of the Kernel is clearly a must.
>> >>> I think that each time you use them we will preempt cross compilation and others.
>> >> Yes, we agree that this method should not be used inside code.
>> >>
>> >>>>> I was just thinking that we can make it so that we do not break any code while still making it dynamic.
>> >>> I do not like your definition of dynamic. Sending a message to an object is dynamic.
>> >>> What you imply is compact. I can understand it when typing in playground.
>> >> By dynamic I meant the dispatch through âself class environmentâ or âself environmentâ which is what people will use by default.
>> >>
>> >>
>> >>>>> Like with scripting solutions there is a performance penalty, but that is fine if people choose to pay it (like in the case of Symbol>>#value:).
>> >>> Yes for scripts. Not for core code.
>> >>> Since people tend to be a bit lazy I think that having rules will make sense.
>> >> Definitely.
>> >>
>> >> Doru
>> >>
>> >>>>> Cheers,
>> >>>>> Doru
>> >>>>>
>> >>>>>
>> >>>>>> What do you think?
>> >>>>>>
>> >>>>>> Cheers,
>> >>>>>> Doru
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>>> On Aug 25, 2016, at 8:34 AM, Yuriy Tymchuk <yuriy.tymchuk(a)me.com> wrote:
>> >>>>>>>
>> >>>>>>> Just my 2 cents:
>> >>>>>>>
>> >>>>>>>
>> >>>>>>> instead of
>> >>>>>>>
>> >>>>>>> #name asClass
>> >>>>>>>
>> >>>>>>> we have to use
>> >>>>>>>
>> >>>>>>> self class environment at: #name.
>> >>>>>>>
>> >>>>>>>
>> >>>>>>> Maybe instead of #at: we can have #classNamed:? Or something similar? Because 1) itâs not obvious that the method will give you a class, what if in the future and environment can also have a mapping of something else like packages?
>> >>>>>>>
>> >>>>>>> Uko
>> >>>>>>>
>> >>>>>>>> On 25 Aug 2016, at 07:21, stepharo <stepharo(a)free.fr> wrote:
>> >>>>>>>>
>> >>>>>>>> Hi guys
>> >>>>>>>>
>> >>>>>>>> We got a meeting at ESUG with all the compiler guys and james from gemstone.
>> >>>>>>>>
>> >>>>>>>> Our goal is to have a full tool suite that can be parametrized by environments (so that
>> >>>>>>>>
>> >>>>>>>> we can compile code in other space, or compile other code inside pharo).
>> >>>>>>>>
>> >>>>>>>> I personnally started this effort one decade ago. Now the introduction
>> >>>>>>>>
>> >>>>>>>> of #asClass and friend is simply destroying all our efforts. There was a discussion
>> >>>>>>>>
>> >>>>>>>> in the past but we are not listened.
>> >>>>>>>>
>> >>>>>>>> We will
>> >>>>>>>>
>> >>>>>>>> - packaged these extensions in a separate package
>> >>>>>>>>
>> >>>>>>>> - add rules to ban the use of such method in Pharo
>> >>>>>>>>
>> >>>>>>>> - fix all the use (again) to use the correct way to do it.
>> >>>>>>>>
>> >>>>>>>>
>> >>>>>>>> I can understand that for scripting this is easier but it cannot be at that cost and impact.
>> >>>>>>>>
>> >>>>>>>> I hope that we will understand but we have to do something else than
>> >>>>>>>>
>> >>>>>>>> fixing code that breaks our effort.
>> >>>>>>>>
>> >>>>>>>>
>> >>>>>>>> Stef, Marcus, Guille and Luc
>> >>>>>>>>
>> >>>>>>>>
>> >>>>>> --
>> >>>>>> www.tudorgirba.com
>> >>>>>> www.feenk.com
>> >>>>>>
>> >>>>>> "It's not what we do that matters most, it's how we do it."
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>> --
>> >>>> www.tudorgirba.com
>> >>>> www.feenk.com
>> >>>>
>> >>>> "Quality cannot be an afterthought."
>> >> --
>> >> www.tudorgirba.com
>> >> www.feenk.com
>> >>
>> >> "Every thing has its own flow."
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >
>> >
>>
>> --
>> www.tudorgirba.com
>> www.feenk.com
>>
>> "Every thing should have the right to be different."
--
www.tudorgirba.com
www.feenk.com
"Be rather willing to give than demanding to get."
Aug. 26, 2016