On 26 August 2010 08:20, Hernán Morales Durand <[hidden email]> wrote:
> 2010/8/25 Igor Stasenko <[hidden email]>: >>> >> >> Meaning could be anything. It depends from context where i using this object. >> From machine's point of view there is no meaning, only semantic. >> > > Igor, there are *TONS* of books about meaning (Saussure, Eco, > Wittgenstein, etc), meaning is everything but anything. The richer > understanding of meaning the better you are understanding systems. > > And there is no semantic from a machine's point of view (it was a > claim of strong AI for many years). > Well, from machine POV, there is nothing but just electric signals, which form bytes, and those bytes form various structures in memory. I agree, that anything extra, what we putting into it (meaning, semantic) is a human-centric. >> So, i am asking, what _technical_ benefits it would brings us. > > From a functionalist point of view, there are no additional benefits. > >> Because from meaning point of view, a symbol #foo reads foo, >> as well as selector foo, and only we (humans) know that it is selector >> in one context, >> or just a simple 'unique string' in another one. >> >>>> >>>> i like the idea of shrinking a Symbol's protocol and putting it into >>>> lean and clean place - Symbol. >>>> But this is not strong enough. >>>> In practice, such shrinking, could lead to explosion of complexity in >>>> many other places. >>>> >>>> >>>> 'foo' = #foo ->true >>>> #foo = 'foo' -> true >>>> >>>> #foo asSelector = #foo ?? >>> >>> clearly no, we are saying that a symbol should be different from a selector, >>> therefore they should never be equal no matter if their >>> "printable" representation is the same (as in this example #foo) >>>> >>>> if so, then >>>> #foo hash = #foo asSelector hash ? >>> >>> could or could not... depends on the implementation, who cares? >>> >>>> >>>> and , obviously >>>> #foo == #foo asSelector => false >>> >>> yes, and #foo = #foo asSelector --> false >>> >>>> >>>> which means, that mixing selectors and symbols in a single collection >>>> will be very bad idea, >>>> and source of bugs and confusion. >>> >>> why? >>> It is not the same the relationship between a symbol and a string that with >>> a symbol and a selector. >>> We could say that a symbol and a string represent a sequence of characters, >>> so if they represent the same sequence of characters they have to be equal, >>> that is why #foo = 'foo', (that means 'foo' asUniqueString = 'foo' where >>> asUniqueString is the real meaning of the # in front of the symbols...), but >>> a selector does not represent a sequence of character, it represents the >>> name of a message. Therefore for me a selector has a "name" that is a >>> symbol, but a selector IS NOT a symbol, because can answer messages like >>> numOfArgs:, sendTo: etc. >> >> it could have a sense to use different entity, when you would need to >> hold additional state. >> I can imagine a class, like 'measure unit', with two variables - value >> and units. >> So, you can express 1 cm, 1 mm, 1 km, 100 kg using such object. >> But in case of selectors , you expressing a symbol, and there is no >> need for additional state. >> > > A selector could have an intention, a duration or time of life (have > you ever heard about mRNA?), an impact factor, a context (to validate > its application), etc. A lot of very interesting and new things could > be done! > Ok, may be there is no need for this at all, but there is no need for > hundreds of natural or artifficial languages too. > >>>> >>>> But what gives us a uniqueness of symbols is, that we don't need to >>>> use #= for comparing them, >>>> but #== , which is much faster. Right? >>> >>> well, I think that using #== is a wrong design decision, for me you should >>> only use #== if you are dealing with "memory" issues, if you really want two >>> objects to be in the same memory position, therefore it is an implementation >>> issue, but no if you are designing for extensibility.... >>> >>>> >>>> Now, if you introduce selectors, there is no uniqueness anymore, >>> >>> why? >>> >> >> well, because two things which having same name should be equal. >> Otherwise it makes no sense to use same name for them. > > And what we do with polysemic names? :) > Let me guess: we are deduce its meaning depending on context, where its used. That's exactly the case with symbol/selector :) >> Keep in mind, that symbols are made for humans. Machine feels pretty well with >> pointers and don't needs to know anything about names. >> >>>> >>>> since >>>> selector is a symbol (since it is a subclass of it), >>> >>> why? I would not make it a subclass... using a subclass only to reuse code >>> it is a bad design decision from my point of view, Selector should be a >>> class by itself whose instances know a name, that are instances of Symbol >>>> >>>> and must honor >>>> the rules of its ancestor.. >>>> but its not. >>>> The only way how to deal with that is to make particular symbol >>>> (sub)instance to be either >>>> an instance of Symbol or Selector but not both. >>>> This means that in system you could have either >>>> #foo >>>> or >>>> #foo asSelector >>>> but not both, otherwise you will violate the uniqueness rule. >>> >>> the problem you see is, as I said above, because you are subclassing symbol >>> which is not what I would do. >>> >> >> So, you want a completely separate class for selectors, >> which by sending #name (for instance) will answer a symbol which >> identifies them? >> I see, use delegation instead of inheritance. >> > > Sorry I cannot comment about implementation because I'm not too > interested in super technical issues, but I recognize the difficulty > :) > Anyways, thanks for discussion. :) > Cheers, > > Hernán > > _______________________________________________ > Pharo-users mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users > -- Best regards, Igor Stasenko AKA sig. _______________________________________________ Pharo-users mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users |
In reply to this post by Hernan Wilkinson-3
Can I make a last plea for the simplicity and uniformity of the current model? I suspect that this change is a premature optimisation that will lose us flexibility, for no apparent benefit.
On Thu, Aug 26, 2010 at 12:28 PM, Hernan Wilkinson <[hidden email]> wrote: as I said in my first mail, I think it is a good idea from the design point of view, should it be implemented now? I dont think so, as you say, there are other more important things to do in pharo, but the idea is good. -- Marcin Tustin Mobile: 07773787105 Office: 020 3400 3259 _______________________________________________ Pharo-users mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users |
an optimisation? for me this change looks for exactly what you plea, simplicity and uniformity... at the end this change makes symbol and selector more cohesive, and we all know that the more cohesive an object is the more simply and uniform it is, because it represents just one thing, no like symbols now that they can be symbols or selectors (therefore they are not as cohesive as having two different abstractions) and we, human, have to decide what they are instead of letting the objects decide...
On Thu, Aug 26, 2010 at 8:43 AM, Marcin Tustin <[hidden email]> wrote: Can I make a last plea for the simplicity and uniformity of the current model? I suspect that this change is a premature optimisation that will lose us flexibility, for no apparent benefit. -- Hernán Wilkinson
Agile Software Development, Teaching & Coaching Mobile: +54 - 11 - 4470 - 7207 email: [hidden email] site: http://www.10Pines.com _______________________________________________ Pharo-users mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users |
Uniformity is when we represent our various significands using the same data type (in smalltalk using objects with the same protocol). For example, this allows us to treat all things in our image as objects, which gives us the flexibility to do everything in the object protocol to every kind of thing, without having to decide that we do only some things to classes, only other things to objects, and only other things again to constants (as in Java).
This change will introduce heterogeneity, which prevents us using the (now two) things in the same way. The reason to do this is if it would be a category error to do symbol operations on a selector, as it locks us into a particular view of the way the world should work, which is what the designers of java did when they posited classes, objects, and constants as being entirely separate. This has the "advantage" that you can't accidentally put a constant in an array, for example, because they wanted to restrict flexibility, in order to protect users from mistakes.
I don't see a risk of our current approach causing errors, and I don't see that it creates unnecessary complexity, so I am confused as to why this change is desirable.
On Thu, Aug 26, 2010 at 5:52 PM, Hernan Wilkinson <[hidden email]> wrote: an optimisation? for me this change looks for exactly what you plea, simplicity and uniformity... at the end this change makes symbol and selector more cohesive, and we all know that the more cohesive an object is the more simply and uniform it is, because it represents just one thing, no like symbols now that they can be symbols or selectors (therefore they are not as cohesive as having two different abstractions) and we, human, have to decide what they are instead of letting the objects decide... -- Marcin Tustin Mobile: 07773787105 Office: 020 3400 3259 _______________________________________________ Pharo-users mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users |
On Thu, Aug 26, 2010 at 2:02 PM, Marcin Tustin <[hidden email]> wrote:
well... I don't agree... starting from the fact that there are no data types in the object paradigm, just objects.
sorry, I don't understand.
but, for me, a symbol is not a selector. What is the meaning of asking a selector for its size? for me makes more sense to ask the selector's name for its size.
what is the meaning of asking a symbol for the number of arguments? if that symbol does not represent a selector there is no reason for the symbol to respond that question.
I dont understand if this is good or bad for you... for me the separation that java does with object, classes and data types is a mess, it is just not uniform, I prefer the smalltalk way :-)
I never made that mistake in Smalltalk and Smalltalk does not prevent me for that...
ok, we don't have to agree, but just answer yourself this question: the proposed change is more cohesive or not? and remember that more cohesive objects means more simplicity and uniformity... if you don't agree that cohesion implies that, well.... we should be discussing other things first :-)
-- Hernán Wilkinson
Agile Software Development, Teaching & Coaching Mobile: +54 - 11 - 4470 - 7207 email: [hidden email] site: http://www.10Pines.com _______________________________________________ Pharo-users mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users |
I don't think that we have a problem with cohesion at present (as cohesion is not a quantity, I would not say we have more or less, but a more or less problematic situation). Cohesion does not promote uniformity. It promotes simplicity in tracking the dependencies between functions (messages) and mutable state in objects. This is a different kind of simplicity from the simplicity that having a single protocol provides us.
On Thu, Aug 26, 2010 at 6:18 PM, Hernan Wilkinson <[hidden email]> wrote:
_______________________________________________ Pharo-users mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users |
Administrator
|
In reply to this post by Igor Stasenko
While fixing Issue 15523: "Code Cruft Rule Only Matches One-Liners", I reeeeeally wanted: Selector UnarySelector BinarySelector KeywordSelector so that I could double dispatch. It made me remember this old interesting thread. So, in addition to the conceptual clarity reification would provide, this provided a clear (to me) case of technical benefit. We could eliminate the ~20 or so senders of isUnary, ~20 of isBinary, and ~20 isKeyword in the Kernel for a start...
Cheers,
Sean |
Back in the time of ModularSmalltalk and S#, we had fierce discussions on a symbol resolution to implement selector namespaces. We had something like that:
Symbol + Namespace = selector As a result, several namespaces could define a method with the same selector on a same class, thus avoiding clashes between class extensions. Cheers, Alexandre > On May 13, 2015, at 9:46 AM, Sean P. DeNigris <[hidden email]> wrote: > > Igor Stasenko wrote >> Symbol + ??? => Selector >> >> give me a strong reason. >> >> i like the idea of shrinking a Symbol's protocol and putting it into >> lean and clean place - Symbol. > > While fixing Issue 15523: "Code Cruft Rule Only Matches One-Liners", I > reeeeeally wanted: > Selector > UnarySelector > BinarySelector > KeywordSelector > so that I could double dispatch. It made me remember this old interesting > thread. So, in addition to the conceptual clarity reification would provide, > this provided a clear (to me) case of technical benefit. We could eliminate > the ~20 or so senders of isUnary, ~20 of isBinary, and ~20 isKeyword in the > Kernel for a start... > > > > ----- > Cheers, > Sean > -- > View this message in context: http://forum.world.st/funny-idea-Symbol-vs-Selector-tp2335774p4826193.html > Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com. > -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. |
Free forum by Nabble | Edit this page |