Re: [Pharo-users] canonical way to convert Symbol into Class (retrieve class by its name)

2018-02-13 Thread Herbert Vojčík
Denis Kudriashov wrote: 2018-02-13 10:25 GMT+01:00 Marcus Denker >: Sometimes I think we should treat globals more in a “late bound” fashion. e.g. right now we say that “Undeclared” vars are to be avoided at any cost.

Re: [Pharo-users] canonical way to convert Symbol into Class (retrieve class by its name)

2018-02-13 Thread Sean P. DeNigris
Marcus Denker-4 wrote > Sometimes I think we should treat globals more in a “late bound” fashion. Late bound = power. I remember being very disappointed when I realized that classes are early bound by methods (resolved in literals). This makes things like class-side stubbing very difficult

Re: [Pharo-users] canonical way to convert Symbol into Class (retrieve class by its name)

2018-02-13 Thread Marcus Denker
> On 13 Feb 2018, at 11:32, Ben Coman wrote: > > > > On 13 February 2018 at 17:25, Marcus Denker > wrote: > Sometimes I think we should treat globals more in a “late bound” fashion. > > > This may remove a big

Re: [Pharo-users] canonical way to convert Symbol into Class (retrieve class by its name)

2018-02-13 Thread Ben Coman
On 13 February 2018 at 17:25, Marcus Denker wrote: > Sometimes I think we should treat globals more in a “late bound” fashion. > > This may remove a big reason for needing asClass, which was introduced so you could DoIt on a script to load a package and then operate on a

Re: [Pharo-users] canonical way to convert Symbol into Class (retrieve class by its name)

2018-02-13 Thread Denis Kudriashov
2018-02-13 10:25 GMT+01:00 Marcus Denker : > Sometimes I think we should treat globals more in a “late bound” fashion. > > e.g. right now we say that “Undeclared” vars are to be avoided at any cost. > > But we could just treat them like we treat messages that are send that

Re: [Pharo-users] canonical way to convert Symbol into Class (retrieve class by its name)

2018-02-13 Thread Marcus Denker
Sometimes I think we should treat globals more in a “late bound” fashion. e.g. right now we say that “Undeclared” vars are to be avoided at any cost. But we could just treat them like we treat messages that are send that do not exist. Forcing “#classNamed: “ for all unknown globals is a bit

Re: [Pharo-users] canonical way to convert Symbol into Class (retrieve class by its name)

2018-02-11 Thread Richard Sargent
There are two use cases that come immediately to mind. They may be the two most important. "As a Compiler, I need to be able to resolve a Symbol to a known Object." "As a Browser, I need to be able to identify the possible resolutions of a String to known Objects." I can elaborate on those, but

Re: [Pharo-users] canonical way to convert Symbol into Class (retrieve class by its name)

2018-02-11 Thread Denis Kudriashov
2018-02-11 21:08 GMT+01:00 Stephane Ducasse : > Denis > > we should introduce classNamed: now we can have traits and globals too :( > Yes, we need to think about it. > Idea? may be can still classNamed: > > Stef > > > On Sun, Feb 11, 2018 at 8:55 PM, Denis Kudriashov

Re: [Pharo-users] canonical way to convert Symbol into Class (retrieve class by its name)

2018-02-11 Thread Hernán Morales Durand
2018-02-11 16:55 GMT-03:00 Denis Kudriashov : > > > 2018-02-11 20:36 GMT+01:00 Hernán Morales Durand : >> >> 2018-02-11 16:10 GMT-03:00 Denis Kudriashov : >> > Hi Hernan. >> > >> > 2018-02-11 19:57 GMT+01:00 Hernán Morales

Re: [Pharo-users] canonical way to convert Symbol into Class (retrieve class by its name)

2018-02-11 Thread Stephane Ducasse
Denis we should introduce classNamed: now we can have traits and globals too :( Idea? may be can still classNamed: Stef On Sun, Feb 11, 2018 at 8:55 PM, Denis Kudriashov wrote: > > > 2018-02-11 20:36 GMT+01:00 Hernán Morales Durand : >> >>

Re: [Pharo-users] canonical way to convert Symbol into Class (retrieve class by its name)

2018-02-11 Thread Denis Kudriashov
2018-02-11 20:36 GMT+01:00 Hernán Morales Durand : > 2018-02-11 16:10 GMT-03:00 Denis Kudriashov : > > Hi Hernan. > > > > 2018-02-11 19:57 GMT+01:00 Hernán Morales Durand < > hernan.mora...@gmail.com>: > >> > >> Hi Denis > >> > >> 2018-02-10 15:18

Re: [Pharo-users] canonical way to convert Symbol into Class (retrieve class by its name)

2018-02-11 Thread Hernán Morales Durand
2018-02-11 16:10 GMT-03:00 Denis Kudriashov : > Hi Hernan. > > 2018-02-11 19:57 GMT+01:00 Hernán Morales Durand : >> >> Hi Denis >> >> 2018-02-10 15:18 GMT-03:00 Denis Kudriashov : >> > >> > 2018-02-10 20:59 GMT+03:00 Stephane

Re: [Pharo-users] canonical way to convert Symbol into Class (retrieve class by its name)

2018-02-11 Thread Denis Kudriashov
Hi Hernan. 2018-02-11 19:57 GMT+01:00 Hernán Morales Durand : > Hi Denis > > 2018-02-10 15:18 GMT-03:00 Denis Kudriashov : > > > > 2018-02-10 20:59 GMT+03:00 Stephane Ducasse : > >> > >> Please to not use an unary on Symbol

Re: [Pharo-users] canonical way to convert Symbol into Class (retrieve class by its name)

2018-02-10 Thread Stephane Ducasse
Agreed! In that case denis we should add a bug entry and clean the complete image. And no asClass sucks and we do not want to use thisContext. Why can we do simple thing and avoid to add more accidental complexity. Stef On Sat, Feb 10, 2018 at 7:18 PM, Denis Kudriashov

Re: [Pharo-users] canonical way to convert Symbol into Class (retrieve class by its name)

2018-02-10 Thread Denis Kudriashov
2018-02-10 20:59 GMT+03:00 Stephane Ducasse : > Please to not use an unary on Symbol > Dispatch on something. > > self class environment at: #Array > is the best > We should not use collection API for reflection calls. It makes them very difficult to find. Let's use

Re: [Pharo-users] canonical way to convert Symbol into Class (retrieve class by its name)

2018-02-10 Thread Stephane Ducasse
Please to not use an unary on Symbol Dispatch on something. self class environment at: #Array is the best For Modules, we made progress and got bitten by many issues and teaching load. Stef On Sat, Feb 10, 2018 at 4:50 PM, Clément Bera wrote: > On Sat, Feb 10, 2018 at

Re: [Pharo-users] canonical way to convert Symbol into Class (retrieve class by its name)

2018-02-10 Thread Clément Bera
On Sat, Feb 10, 2018 at 4:34 PM, Hernán Morales Durand < hernan.mora...@gmail.com> wrote: > Hi Clément, > > First time I read about modules in Pharo. > What is a module exactly? What's the problem to solve? > It's similar to namespaces with some different, arguably better, features. Honestly I

Re: [Pharo-users] canonical way to convert Symbol into Class (retrieve class by its name)

2018-02-10 Thread Hernán Morales Durand
Hi Clément, First time I read about modules in Pharo. What is a module exactly? What's the problem to solve? Cheers, Hernán 2018-02-10 9:47 GMT-03:00 Clément Bera : > Hi, > > In short, everything that is not namespace/module compatible will be >

Re: [Pharo-users] canonical way to convert Symbol into Class (retrieve class by its name)

2018-02-10 Thread Esteban A. Maringolo
2018-02-10 11:33 GMT-03:00 Peter Uhnák : >> c) self class environment at: #Array >> => this will work in the future if your code is a class which >> environment/namespace/module includes the Array class you would expect > > Let's say that namespaces are added; Array is now in

Re: [Pharo-users] canonical way to convert Symbol into Class (retrieve class by its name)

2018-02-10 Thread Clément Bera
Modules can import other modules to be able to use their classes directly. Anyway, this is theory, there is no module implementation currently. But the idea in the recent versions of Pharo (5-6-7) was to start moving away from things like (Smalltalk at: #className) or (#className asClass) since

Re: [Pharo-users] canonical way to convert Symbol into Class (retrieve class by its name)

2018-02-10 Thread Peter Uhnák
> c) self class environment at: #Array > => this will work in the future if your code is a class which environment/namespace/module includes the Array class you would expect Let's say that namespaces are added; Array is now in the module Collections.Array My code is now in module

Re: [Pharo-users] canonical way to convert Symbol into Class (retrieve class by its name)

2018-02-10 Thread Clément Bera
Hi, In short, everything that is not namespace/module compatible will be deprecated/changed/removed in the future, so it is not recommended to use it. a.2) #Array asClassInEnvironment: Smalltalk globals b.1) Smalltalk globals at: #Array => Ok-ish, note that you may need to change 'Smalltalk

Re: [Pharo-users] canonical way to convert Symbol into Class (retrieve class by its name)

2018-02-10 Thread jtuc...@objektfabrik.de
Peter, I have no answer for you as I am not a Pharo expert. It may be part of an answer to your question "why?", however. I think most if not all of the alternatives you mention are equally good as long as you assume there is only one place to look for Classes. As soon as you introduce