Ok, I write the changeset, but I don't like it hehehehe.
What about puting isMacintosh, isUnix and isWindows in SmalltalkImage ? I think those methods are useful and perhaps many people in different packages are doing things like this: ^SmalltalkImage current platformName = 'Mac OS' This is not nice. Tomorrow we change the platformName and we have to modify a lot of code. For example, I searched the string "SmalltalkImage current platformName = 'Mac OS'" and it is in a lot of places. I think we should get rid of them. what do you think? best, Mariano On Tue, Jul 28, 2009 at 3:18 PM, Adrian Lienhard <[hidden email]> wrote: Yes, if you tested it and think it is good, please change the status _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
We have OSPlatform. For instance:
MacOSXPlatform isActivePlatform HTH, Adrian On Jul 28, 2009, at 18:55 , Mariano Martinez Peck wrote: > Ok, I write the changeset, but I don't like it hehehehe. > > What about puting isMacintosh, isUnix and isWindows in > SmalltalkImage ? > I think those methods are useful and perhaps many people in different > packages are doing things like this: > ^SmalltalkImage current platformName = 'Mac OS' > > This is not nice. Tomorrow we change the platformName and we have to > modify > a lot of code. > > For example, I searched the string "SmalltalkImage current > platformName = > 'Mac OS'" and it is in a lot of places. I think we should get rid of > them. > > what do you think? > > best, > > Mariano > > > > On Tue, Jul 28, 2009 at 3:18 PM, Adrian Lienhard <[hidden email]> > wrote: > >> Yes, if you tested it and think it is good, please change the status >> to verified. >> >> Cheers, >> Adrian >> >> On Jul 28, 2009, at 17:12 , Miguel Cobá wrote: >> >>> should the ticket be marked as verified? >>> >>> >>> On Tue, Jul 28, 2009 at 10:10 AM, Miguel Cobá<[hidden email]> >>> wrote: >>>> It works ok on my >>>> >>>> Debian Linux 5.0 (Lenny) i386. >>>> Debian Linux 5.0 (Lenny) amd64. >>>> >>>> Miguel Cobá >>>> >>>> 2009/7/28 Mariano Martinez Peck <[hidden email]>: >>>>> >>>>> >>>>> On Tue, Jul 28, 2009 at 11:58 AM, Adrian Lienhard >>>>> <[hidden email]> wrote: >>>>>> >>>>>> On Jul 28, 2009, at 14:51 , Mariano Martinez Peck wrote: >>>>>> >>>>>>> On Tue, Jul 28, 2009 at 5:42 AM, Damien Cassou < >> [hidden email] >>>>>>>> wrote: >>>>>>> >>>>>>>> 2009/7/27 Mariano Martinez Peck <[hidden email]>: >>>>>>>>> HostSystemMenusTest class>>expectedFailures >>>>>>>>> >>>>>>>>> SmalltalkImage current platformName = 'Mac OS' ifFalse:[ >>>>>>>>> ^#(#testXXX #testYYY)]. >>>>>>>>> ]. >>>>>>>>> ^#() >>>>>>>> >>>>>>>> Expected failures are indications of bugs that are not yet >>>>>>>> corrected. >>>>>>>> Does not seem to apply here. >>>>>>> >>>>>>> >>>>>>> ahhh okok. So...shall we go for torsten solution ? >>>>>> >>>>>> Yes. >>>>> >>>>> http://code.google.com/p/pharo/issues/detail?id=996 >>>>> >>>>> I also attached a possible changeset. >>>>> >>>>> best, >>>>> >>>>> Mariano >>>>> >>>>>> >>>>>> Adrian >>>>>> >>>>>> >>>>>>> >>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> Damien Cassou >>>>>>>> http://damiencassou.seasidehosting.st >>>>>>>> >>>>>>>> "Lambdas are relegated to relative obscurity until Java makes >>>>>>>> them >>>>>>>> popular by not having them." James Iry >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Pharo-project mailing list >>>>>>>> [hidden email] >>>>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >>>>>>>> >>>>>>> _______________________________________________ >>>>>>> Pharo-project mailing list >>>>>>> [hidden email] >>>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo- >>>>>>> project >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Pharo-project mailing list >>>>>> [hidden email] >>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >>>>> >>>>> >>>>> _______________________________________________ >>>>> Pharo-project mailing list >>>>> [hidden email] >>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo- >>>>> project >>>>> >>>> >>> >>> _______________________________________________ >>> Pharo-project mailing list >>> [hidden email] >>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> >> >> _______________________________________________ >> Pharo-project mailing list >> [hidden email] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
On Tue, Jul 28, 2009 at 4:24 PM, Adrian Lienhard <[hidden email]> wrote: We have OSPlatform. For instance: Nice! I wasn't aware of them...so, what about changing SmalltalkImage current platformName = 'Mac OS' for MacOSXPlatform isActivePlatform In all places? Obviously, the same with the other platforms. Is there a reason I don't see? just time to do it ? thanks! Mariano
_______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
I think that it should be done at least in pharo core and more importantly,
create a new page in the wiki with the programming recommended tips/techniques and there to include all the tips that appear on the list: - Use the OSPlatform isActivePlatform and children - Not to use the Utilities deprecated classes - The case against SmalltalkImage current that appear in a thread a couple of days ago - etc and featured in the pharo website to avoid introducing this bad idioms again Miguel Cobá 2009/7/28 Mariano Martinez Peck <[hidden email]>: > > > On Tue, Jul 28, 2009 at 4:24 PM, Adrian Lienhard <[hidden email]> wrote: >> >> We have OSPlatform. For instance: >> >> MacOSXPlatform isActivePlatform > > Nice! I wasn't aware of them...so, what about changing > > SmalltalkImage current platformName = 'Mac OS' > > for > > MacOSXPlatform isActivePlatform > > In all places? Obviously, the same with the other platforms. > > Is there a reason I don't see? just time to do it ? > > thanks! > > Mariano > > >> >> HTH, >> Adrian >> >> On Jul 28, 2009, at 18:55 , Mariano Martinez Peck wrote: >> >> > Ok, I write the changeset, but I don't like it hehehehe. >> > >> > What about puting isMacintosh, isUnix and isWindows in >> > SmalltalkImage ? >> > I think those methods are useful and perhaps many people in different >> > packages are doing things like this: >> > ^SmalltalkImage current platformName = 'Mac OS' >> > >> > This is not nice. Tomorrow we change the platformName and we have to >> > modify >> > a lot of code. >> > >> > For example, I searched the string "SmalltalkImage current >> > platformName = >> > 'Mac OS'" and it is in a lot of places. I think we should get rid of >> > them. >> > >> > what do you think? >> > >> > best, >> > >> > Mariano >> > >> > >> > >> > On Tue, Jul 28, 2009 at 3:18 PM, Adrian Lienhard <[hidden email]> >> > wrote: >> > >> >> Yes, if you tested it and think it is good, please change the status >> >> to verified. >> >> >> >> Cheers, >> >> Adrian >> >> >> >> On Jul 28, 2009, at 17:12 , Miguel Cobá wrote: >> >> >> >>> should the ticket be marked as verified? >> >>> >> >>> >> >>> On Tue, Jul 28, 2009 at 10:10 AM, Miguel Cobá<[hidden email]> >> >>> wrote: >> >>>> It works ok on my >> >>>> >> >>>> Debian Linux 5.0 (Lenny) i386. >> >>>> Debian Linux 5.0 (Lenny) amd64. >> >>>> >> >>>> Miguel Cobá >> >>>> >> >>>> 2009/7/28 Mariano Martinez Peck <[hidden email]>: >> >>>>> >> >>>>> >> >>>>> On Tue, Jul 28, 2009 at 11:58 AM, Adrian Lienhard >> >>>>> <[hidden email]> wrote: >> >>>>>> >> >>>>>> On Jul 28, 2009, at 14:51 , Mariano Martinez Peck wrote: >> >>>>>> >> >>>>>>> On Tue, Jul 28, 2009 at 5:42 AM, Damien Cassou < >> >> [hidden email] >> >>>>>>>> wrote: >> >>>>>>> >> >>>>>>>> 2009/7/27 Mariano Martinez Peck <[hidden email]>: >> >>>>>>>>> HostSystemMenusTest class>>expectedFailures >> >>>>>>>>> >> >>>>>>>>> SmalltalkImage current platformName = 'Mac OS' ifFalse:[ >> >>>>>>>>> ^#(#testXXX #testYYY)]. >> >>>>>>>>> ]. >> >>>>>>>>> ^#() >> >>>>>>>> >> >>>>>>>> Expected failures are indications of bugs that are not yet >> >>>>>>>> corrected. >> >>>>>>>> Does not seem to apply here. >> >>>>>>> >> >>>>>>> >> >>>>>>> ahhh okok. So...shall we go for torsten solution ? >> >>>>>> >> >>>>>> Yes. >> >>>>> >> >>>>> http://code.google.com/p/pharo/issues/detail?id=996 >> >>>>> >> >>>>> I also attached a possible changeset. >> >>>>> >> >>>>> best, >> >>>>> >> >>>>> Mariano >> >>>>> >> >>>>>> >> >>>>>> Adrian >> >>>>>> >> >>>>>> >> >>>>>>> >> >>>>>>> >> >>>>>>>> >> >>>>>>>> >> >>>>>>>> -- >> >>>>>>>> Damien Cassou >> >>>>>>>> http://damiencassou.seasidehosting.st >> >>>>>>>> >> >>>>>>>> "Lambdas are relegated to relative obscurity until Java makes >> >>>>>>>> them >> >>>>>>>> popular by not having them." James Iry >> >>>>>>>> >> >>>>>>>> _______________________________________________ >> >>>>>>>> Pharo-project mailing list >> >>>>>>>> [hidden email] >> >>>>>>>> >> >>>>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> >>>>>>>> >> >>>>>>> _______________________________________________ >> >>>>>>> Pharo-project mailing list >> >>>>>>> [hidden email] >> >>>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo- >> >>>>>>> project >> >>>>>> >> >>>>>> >> >>>>>> _______________________________________________ >> >>>>>> Pharo-project mailing list >> >>>>>> [hidden email] >> >>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> >>>>> >> >>>>> >> >>>>> _______________________________________________ >> >>>>> Pharo-project mailing list >> >>>>> [hidden email] >> >>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo- >> >>>>> project >> >>>>> >> >>>> >> >>> >> >>> _______________________________________________ >> >>> Pharo-project mailing list >> >>> [hidden email] >> >>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> >> >> >> >> >> _______________________________________________ >> >> Pharo-project mailing list >> >> [hidden email] >> >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> >> >> > _______________________________________________ >> > Pharo-project mailing list >> > [hidden email] >> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> >> >> _______________________________________________ >> Pharo-project mailing list >> [hidden email] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
On Tue, Jul 28, 2009 at 4:38 PM, Miguel Cobá <[hidden email]> wrote: I think that it should be done at least in pharo core and more importantly, Yes, I wanted to say to do it in Pharo core at least. Then, it's a task of each external package developer to change their code to use this methods.
_______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
I think that all such kind of queries (like isXXXPlatform) should be
not included and not used in a well-designed system. If you want some capability - then you should ask directly for it, irrespectively on what platform you are currently running. As an example, see the FileDirectory>>slash It is very confusing for people to see isXXXPlatform in code, because it tells almost nothing about what platform-specific feature you rely on. So, i'd prefer to see the code which asks some provider object about support of given capability (it could be OSPlatform), instead of placing isMacOS, isWindows , isUnix into code, which causing a lot of frustration to people who would want to port your code to other platforms, or simply check, if their platform provides required feature(s). Don't forget, that each time someone sees isMacOs, or isWindows etc.. he thinks: 'duh.. this thing wont work on my platform'. Instead of thinking in a different way: 'duh.. this thing depends on following OS feature, lets take a look if i can hack it to wire it up with my OS' 2009/7/28 Mariano Martinez Peck <[hidden email]>: > > > On Tue, Jul 28, 2009 at 4:38 PM, Miguel Cobá <[hidden email]> wrote: >> >> I think that it should be done at least in pharo core and more >> importantly, > > Yes, I wanted to say to do it in Pharo core at least. Then, it's a task of > each external package developer to change their code to use this methods. > >> >> create a new page in the wiki with the programming recommended >> tips/techniques >> and there to include all the tips that appear on the list: >> >> - Use the OSPlatform isActivePlatform and children >> - Not to use the Utilities deprecated classes >> - The case against SmalltalkImage current that appear in a thread a >> couple of days ago >> - etc >> >> and featured in the pharo website to avoid introducing this bad idioms >> again >> >> Miguel Cobá >> >> 2009/7/28 Mariano Martinez Peck <[hidden email]>: >> > >> > >> > On Tue, Jul 28, 2009 at 4:24 PM, Adrian Lienhard <[hidden email]> >> > wrote: >> >> >> >> We have OSPlatform. For instance: >> >> >> >> MacOSXPlatform isActivePlatform >> > >> > Nice! I wasn't aware of them...so, what about changing >> > >> > SmalltalkImage current platformName = 'Mac OS' >> > >> > for >> > >> > MacOSXPlatform isActivePlatform >> > >> > In all places? Obviously, the same with the other platforms. >> > >> > Is there a reason I don't see? just time to do it ? >> > >> > thanks! >> > >> > Mariano >> > >> > >> >> >> >> HTH, >> >> Adrian >> >> >> >> On Jul 28, 2009, at 18:55 , Mariano Martinez Peck wrote: >> >> >> >> > Ok, I write the changeset, but I don't like it hehehehe. >> >> > >> >> > What about puting isMacintosh, isUnix and isWindows in >> >> > SmalltalkImage ? >> >> > I think those methods are useful and perhaps many people in different >> >> > packages are doing things like this: >> >> > ^SmalltalkImage current platformName = 'Mac OS' >> >> > >> >> > This is not nice. Tomorrow we change the platformName and we have to >> >> > modify >> >> > a lot of code. >> >> > >> >> > For example, I searched the string "SmalltalkImage current >> >> > platformName = >> >> > 'Mac OS'" and it is in a lot of places. I think we should get rid of >> >> > them. >> >> > >> >> > what do you think? >> >> > >> >> > best, >> >> > >> >> > Mariano >> >> > >> >> > >> >> > >> >> > On Tue, Jul 28, 2009 at 3:18 PM, Adrian Lienhard <[hidden email]> >> >> > wrote: >> >> > >> >> >> Yes, if you tested it and think it is good, please change the status >> >> >> to verified. >> >> >> >> >> >> Cheers, >> >> >> Adrian >> >> >> >> >> >> On Jul 28, 2009, at 17:12 , Miguel Cobá wrote: >> >> >> >> >> >>> should the ticket be marked as verified? >> >> >>> >> >> >>> >> >> >>> On Tue, Jul 28, 2009 at 10:10 AM, Miguel >> >> >>> Cobá<[hidden email]> >> >> >>> wrote: >> >> >>>> It works ok on my >> >> >>>> >> >> >>>> Debian Linux 5.0 (Lenny) i386. >> >> >>>> Debian Linux 5.0 (Lenny) amd64. >> >> >>>> >> >> >>>> Miguel Cobá >> >> >>>> >> >> >>>> 2009/7/28 Mariano Martinez Peck <[hidden email]>: >> >> >>>>> >> >> >>>>> >> >> >>>>> On Tue, Jul 28, 2009 at 11:58 AM, Adrian Lienhard >> >> >>>>> <[hidden email]> wrote: >> >> >>>>>> >> >> >>>>>> On Jul 28, 2009, at 14:51 , Mariano Martinez Peck wrote: >> >> >>>>>> >> >> >>>>>>> On Tue, Jul 28, 2009 at 5:42 AM, Damien Cassou < >> >> >> [hidden email] >> >> >>>>>>>> wrote: >> >> >>>>>>> >> >> >>>>>>>> 2009/7/27 Mariano Martinez Peck <[hidden email]>: >> >> >>>>>>>>> HostSystemMenusTest class>>expectedFailures >> >> >>>>>>>>> >> >> >>>>>>>>> SmalltalkImage current platformName = 'Mac OS' ifFalse:[ >> >> >>>>>>>>> ^#(#testXXX #testYYY)]. >> >> >>>>>>>>> ]. >> >> >>>>>>>>> ^#() >> >> >>>>>>>> >> >> >>>>>>>> Expected failures are indications of bugs that are not yet >> >> >>>>>>>> corrected. >> >> >>>>>>>> Does not seem to apply here. >> >> >>>>>>> >> >> >>>>>>> >> >> >>>>>>> ahhh okok. So...shall we go for torsten solution ? >> >> >>>>>> >> >> >>>>>> Yes. >> >> >>>>> >> >> >>>>> http://code.google.com/p/pharo/issues/detail?id=996 >> >> >>>>> >> >> >>>>> I also attached a possible changeset. >> >> >>>>> >> >> >>>>> best, >> >> >>>>> >> >> >>>>> Mariano >> >> >>>>> >> >> >>>>>> >> >> >>>>>> Adrian >> >> >>>>>> >> >> >>>>>> >> >> >>>>>>> >> >> >>>>>>> >> >> >>>>>>>> >> >> >>>>>>>> >> >> >>>>>>>> -- >> >> >>>>>>>> Damien Cassou >> >> >>>>>>>> http://damiencassou.seasidehosting.st >> >> >>>>>>>> >> >> >>>>>>>> "Lambdas are relegated to relative obscurity until Java makes >> >> >>>>>>>> them >> >> >>>>>>>> popular by not having them." James Iry >> >> >>>>>>>> >> >> >>>>>>>> _______________________________________________ >> >> >>>>>>>> Pharo-project mailing list >> >> >>>>>>>> [hidden email] >> >> >>>>>>>> >> >> >>>>>>>> >> >> >>>>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> >> >>>>>>>> >> >> >>>>>>> _______________________________________________ >> >> >>>>>>> Pharo-project mailing list >> >> >>>>>>> [hidden email] >> >> >>>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo- >> >> >>>>>>> project >> >> >>>>>> >> >> >>>>>> >> >> >>>>>> _______________________________________________ >> >> >>>>>> Pharo-project mailing list >> >> >>>>>> [hidden email] >> >> >>>>>> >> >> >>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> >> >>>>> >> >> >>>>> >> >> >>>>> _______________________________________________ >> >> >>>>> Pharo-project mailing list >> >> >>>>> [hidden email] >> >> >>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo- >> >> >>>>> project >> >> >>>>> >> >> >>>> >> >> >>> >> >> >>> _______________________________________________ >> >> >>> Pharo-project mailing list >> >> >>> [hidden email] >> >> >>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> >> >> >> >> >> >> >> >> _______________________________________________ >> >> >> Pharo-project mailing list >> >> >> [hidden email] >> >> >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> >> >> >> >> > _______________________________________________ >> >> > Pharo-project mailing list >> >> > [hidden email] >> >> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> >> >> >> >> >> _______________________________________________ >> >> Pharo-project mailing list >> >> [hidden email] >> >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> > >> > >> > _______________________________________________ >> > Pharo-project mailing list >> > [hidden email] >> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> > >> >> _______________________________________________ >> Pharo-project mailing list >> [hidden email] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > -- Best regards, Igor Stasenko AKA sig. _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Miguel Cobá
Yes
and at the end we should have a kind of architecture for pharo. Stef On Jul 28, 2009, at 7:38 PM, Miguel Cobá wrote: > I think that it should be done at least in pharo core and more > importantly, > create a new page in the wiki with the programming recommended tips/ > techniques > and there to include all the tips that appear on the list: > > - Use the OSPlatform isActivePlatform and children > - Not to use the Utilities deprecated classes > - The case against SmalltalkImage current that appear in a thread a > couple of days ago > - etc > > and featured in the pharo website to avoid introducing this bad > idioms again > > Miguel Cobá > > 2009/7/28 Mariano Martinez Peck <[hidden email]>: >> >> >> On Tue, Jul 28, 2009 at 4:24 PM, Adrian Lienhard <[hidden email]> >> wrote: >>> >>> We have OSPlatform. For instance: >>> >>> MacOSXPlatform isActivePlatform >> >> Nice! I wasn't aware of them...so, what about changing >> >> SmalltalkImage current platformName = 'Mac OS' >> >> for >> >> MacOSXPlatform isActivePlatform >> >> In all places? Obviously, the same with the other platforms. >> >> Is there a reason I don't see? just time to do it ? >> >> thanks! >> >> Mariano >> >> >>> >>> HTH, >>> Adrian >>> >>> On Jul 28, 2009, at 18:55 , Mariano Martinez Peck wrote: >>> >>>> Ok, I write the changeset, but I don't like it hehehehe. >>>> >>>> What about puting isMacintosh, isUnix and isWindows in >>>> SmalltalkImage ? >>>> I think those methods are useful and perhaps many people in >>>> different >>>> packages are doing things like this: >>>> ^SmalltalkImage current platformName = 'Mac OS' >>>> >>>> This is not nice. Tomorrow we change the platformName and we have >>>> to >>>> modify >>>> a lot of code. >>>> >>>> For example, I searched the string "SmalltalkImage current >>>> platformName = >>>> 'Mac OS'" and it is in a lot of places. I think we should get rid >>>> of >>>> them. >>>> >>>> what do you think? >>>> >>>> best, >>>> >>>> Mariano >>>> >>>> >>>> >>>> On Tue, Jul 28, 2009 at 3:18 PM, Adrian Lienhard <[hidden email]> >>>> wrote: >>>> >>>>> Yes, if you tested it and think it is good, please change the >>>>> status >>>>> to verified. >>>>> >>>>> Cheers, >>>>> Adrian >>>>> >>>>> On Jul 28, 2009, at 17:12 , Miguel Cobá wrote: >>>>> >>>>>> should the ticket be marked as verified? >>>>>> >>>>>> >>>>>> On Tue, Jul 28, 2009 at 10:10 AM, Miguel Cobá<[hidden email] >>>>>> > >>>>>> wrote: >>>>>>> It works ok on my >>>>>>> >>>>>>> Debian Linux 5.0 (Lenny) i386. >>>>>>> Debian Linux 5.0 (Lenny) amd64. >>>>>>> >>>>>>> Miguel Cobá >>>>>>> >>>>>>> 2009/7/28 Mariano Martinez Peck <[hidden email]>: >>>>>>>> >>>>>>>> >>>>>>>> On Tue, Jul 28, 2009 at 11:58 AM, Adrian Lienhard >>>>>>>> <[hidden email]> wrote: >>>>>>>>> >>>>>>>>> On Jul 28, 2009, at 14:51 , Mariano Martinez Peck wrote: >>>>>>>>> >>>>>>>>>> On Tue, Jul 28, 2009 at 5:42 AM, Damien Cassou < >>>>> [hidden email] >>>>>>>>>>> wrote: >>>>>>>>>> >>>>>>>>>>> 2009/7/27 Mariano Martinez Peck <[hidden email]>: >>>>>>>>>>>> HostSystemMenusTest class>>expectedFailures >>>>>>>>>>>> >>>>>>>>>>>> SmalltalkImage current platformName = 'Mac OS' ifFalse:[ >>>>>>>>>>>> ^#(#testXXX #testYYY)]. >>>>>>>>>>>> ]. >>>>>>>>>>>> ^#() >>>>>>>>>>> >>>>>>>>>>> Expected failures are indications of bugs that are not yet >>>>>>>>>>> corrected. >>>>>>>>>>> Does not seem to apply here. >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> ahhh okok. So...shall we go for torsten solution ? >>>>>>>>> >>>>>>>>> Yes. >>>>>>>> >>>>>>>> http://code.google.com/p/pharo/issues/detail?id=996 >>>>>>>> >>>>>>>> I also attached a possible changeset. >>>>>>>> >>>>>>>> best, >>>>>>>> >>>>>>>> Mariano >>>>>>>> >>>>>>>>> >>>>>>>>> Adrian >>>>>>>>> >>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> -- >>>>>>>>>>> Damien Cassou >>>>>>>>>>> http://damiencassou.seasidehosting.st >>>>>>>>>>> >>>>>>>>>>> "Lambdas are relegated to relative obscurity until Java >>>>>>>>>>> makes >>>>>>>>>>> them >>>>>>>>>>> popular by not having them." James Iry >>>>>>>>>>> >>>>>>>>>>> _______________________________________________ >>>>>>>>>>> Pharo-project mailing list >>>>>>>>>>> [hidden email] >>>>>>>>>>> >>>>>>>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >>>>>>>>>>> >>>>>>>>>> _______________________________________________ >>>>>>>>>> Pharo-project mailing list >>>>>>>>>> [hidden email] >>>>>>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo- >>>>>>>>>> project >>>>>>>>> >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> Pharo-project mailing list >>>>>>>>> [hidden email] >>>>>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >>>>>>>> >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Pharo-project mailing list >>>>>>>> [hidden email] >>>>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo- >>>>>>>> project >>>>>>>> >>>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Pharo-project mailing list >>>>>> [hidden email] >>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >>>>> >>>>> >>>>> _______________________________________________ >>>>> Pharo-project mailing list >>>>> [hidden email] >>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo- >>>>> project >>>>> >>>> _______________________________________________ >>>> Pharo-project mailing list >>>> [hidden email] >>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >>> >>> >>> _______________________________________________ >>> Pharo-project mailing list >>> [hidden email] >>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> >> >> _______________________________________________ >> Pharo-project mailing list >> [hidden email] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Igor Stasenko
+1
On Jul 28, 2009, at 8:39 PM, Igor Stasenko wrote: > I think that all such kind of queries (like isXXXPlatform) should be > not included and not used in a well-designed system. > If you want some capability - then you should ask directly for it, > irrespectively on what platform you are currently running. > > As an example, see the FileDirectory>>slash > > It is very confusing for people to see isXXXPlatform in code, because > it tells almost nothing about what platform-specific feature you rely > on. > So, i'd prefer to see the code which asks some provider object about > support of given capability (it could be OSPlatform), > instead of placing isMacOS, isWindows , isUnix into code, which > causing a lot of frustration to people who would want to port your > code to other platforms, or simply check, if their platform provides > required feature(s). > > Don't forget, that each time someone sees isMacOs, or isWindows etc.. > he thinks: 'duh.. this thing wont work on my platform'. > Instead of thinking in a different way: 'duh.. this thing depends on > following OS feature, lets take a look if i can hack it to wire it up > with my OS' > > 2009/7/28 Mariano Martinez Peck <[hidden email]>: >> >> >> On Tue, Jul 28, 2009 at 4:38 PM, Miguel Cobá >> <[hidden email]> wrote: >>> >>> I think that it should be done at least in pharo core and more >>> importantly, >> >> Yes, I wanted to say to do it in Pharo core at least. Then, it's a >> task of >> each external package developer to change their code to use this >> methods. >> >>> >>> create a new page in the wiki with the programming recommended >>> tips/techniques >>> and there to include all the tips that appear on the list: >>> >>> - Use the OSPlatform isActivePlatform and children >>> - Not to use the Utilities deprecated classes >>> - The case against SmalltalkImage current that appear in a thread a >>> couple of days ago >>> - etc >>> >>> and featured in the pharo website to avoid introducing this bad >>> idioms >>> again >>> >>> Miguel Cobá >>> >>> 2009/7/28 Mariano Martinez Peck <[hidden email]>: >>>> >>>> >>>> On Tue, Jul 28, 2009 at 4:24 PM, Adrian Lienhard <[hidden email]> >>>> wrote: >>>>> >>>>> We have OSPlatform. For instance: >>>>> >>>>> MacOSXPlatform isActivePlatform >>>> >>>> Nice! I wasn't aware of them...so, what about changing >>>> >>>> SmalltalkImage current platformName = 'Mac OS' >>>> >>>> for >>>> >>>> MacOSXPlatform isActivePlatform >>>> >>>> In all places? Obviously, the same with the other platforms. >>>> >>>> Is there a reason I don't see? just time to do it ? >>>> >>>> thanks! >>>> >>>> Mariano >>>> >>>> >>>>> >>>>> HTH, >>>>> Adrian >>>>> >>>>> On Jul 28, 2009, at 18:55 , Mariano Martinez Peck wrote: >>>>> >>>>>> Ok, I write the changeset, but I don't like it hehehehe. >>>>>> >>>>>> What about puting isMacintosh, isUnix and isWindows in >>>>>> SmalltalkImage ? >>>>>> I think those methods are useful and perhaps many people in >>>>>> different >>>>>> packages are doing things like this: >>>>>> ^SmalltalkImage current platformName = 'Mac OS' >>>>>> >>>>>> This is not nice. Tomorrow we change the platformName and we >>>>>> have to >>>>>> modify >>>>>> a lot of code. >>>>>> >>>>>> For example, I searched the string "SmalltalkImage current >>>>>> platformName = >>>>>> 'Mac OS'" and it is in a lot of places. I think we should get >>>>>> rid of >>>>>> them. >>>>>> >>>>>> what do you think? >>>>>> >>>>>> best, >>>>>> >>>>>> Mariano >>>>>> >>>>>> >>>>>> >>>>>> On Tue, Jul 28, 2009 at 3:18 PM, Adrian Lienhard >>>>>> <[hidden email]> >>>>>> wrote: >>>>>> >>>>>>> Yes, if you tested it and think it is good, please change the >>>>>>> status >>>>>>> to verified. >>>>>>> >>>>>>> Cheers, >>>>>>> Adrian >>>>>>> >>>>>>> On Jul 28, 2009, at 17:12 , Miguel Cobá wrote: >>>>>>> >>>>>>>> should the ticket be marked as verified? >>>>>>>> >>>>>>>> >>>>>>>> On Tue, Jul 28, 2009 at 10:10 AM, Miguel >>>>>>>> Cobá<[hidden email]> >>>>>>>> wrote: >>>>>>>>> It works ok on my >>>>>>>>> >>>>>>>>> Debian Linux 5.0 (Lenny) i386. >>>>>>>>> Debian Linux 5.0 (Lenny) amd64. >>>>>>>>> >>>>>>>>> Miguel Cobá >>>>>>>>> >>>>>>>>> 2009/7/28 Mariano Martinez Peck <[hidden email]>: >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On Tue, Jul 28, 2009 at 11:58 AM, Adrian Lienhard >>>>>>>>>> <[hidden email]> wrote: >>>>>>>>>>> >>>>>>>>>>> On Jul 28, 2009, at 14:51 , Mariano Martinez Peck wrote: >>>>>>>>>>> >>>>>>>>>>>> On Tue, Jul 28, 2009 at 5:42 AM, Damien Cassou < >>>>>>> [hidden email] >>>>>>>>>>>>> wrote: >>>>>>>>>>>> >>>>>>>>>>>>> 2009/7/27 Mariano Martinez Peck <[hidden email]>: >>>>>>>>>>>>>> HostSystemMenusTest class>>expectedFailures >>>>>>>>>>>>>> >>>>>>>>>>>>>> SmalltalkImage current platformName = 'Mac OS' ifFalse:[ >>>>>>>>>>>>>> ^#(#testXXX #testYYY)]. >>>>>>>>>>>>>> ]. >>>>>>>>>>>>>> ^#() >>>>>>>>>>>>> >>>>>>>>>>>>> Expected failures are indications of bugs that are not yet >>>>>>>>>>>>> corrected. >>>>>>>>>>>>> Does not seem to apply here. >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> ahhh okok. So...shall we go for torsten solution ? >>>>>>>>>>> >>>>>>>>>>> Yes. >>>>>>>>>> >>>>>>>>>> http://code.google.com/p/pharo/issues/detail?id=996 >>>>>>>>>> >>>>>>>>>> I also attached a possible changeset. >>>>>>>>>> >>>>>>>>>> best, >>>>>>>>>> >>>>>>>>>> Mariano >>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> Adrian >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> -- >>>>>>>>>>>>> Damien Cassou >>>>>>>>>>>>> http://damiencassou.seasidehosting.st >>>>>>>>>>>>> >>>>>>>>>>>>> "Lambdas are relegated to relative obscurity until Java >>>>>>>>>>>>> makes >>>>>>>>>>>>> them >>>>>>>>>>>>> popular by not having them." James Iry >>>>>>>>>>>>> >>>>>>>>>>>>> _______________________________________________ >>>>>>>>>>>>> Pharo-project mailing list >>>>>>>>>>>>> [hidden email] >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >>>>>>>>>>>>> >>>>>>>>>>>> _______________________________________________ >>>>>>>>>>>> Pharo-project mailing list >>>>>>>>>>>> [hidden email] >>>>>>>>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/ >>>>>>>>>>>> pharo- >>>>>>>>>>>> project >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> _______________________________________________ >>>>>>>>>>> Pharo-project mailing list >>>>>>>>>>> [hidden email] >>>>>>>>>>> >>>>>>>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> _______________________________________________ >>>>>>>>>> Pharo-project mailing list >>>>>>>>>> [hidden email] >>>>>>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo- >>>>>>>>>> project >>>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Pharo-project mailing list >>>>>>>> [hidden email] >>>>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Pharo-project mailing list >>>>>>> [hidden email] >>>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >>>>>>> >>>>>> _______________________________________________ >>>>>> Pharo-project mailing list >>>>>> [hidden email] >>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >>>>> >>>>> >>>>> _______________________________________________ >>>>> Pharo-project mailing list >>>>> [hidden email] >>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo- >>>>> project >>>> >>>> >>>> _______________________________________________ >>>> Pharo-project mailing list >>>> [hidden email] >>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >>>> >>> >>> _______________________________________________ >>> Pharo-project mailing list >>> [hidden email] >>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> >> >> _______________________________________________ >> Pharo-project mailing list >> [hidden email] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> > > > > -- > Best regards, > Igor Stasenko AKA sig. > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Mariano Martinez Peck
2009/7/28 Mariano Martinez Peck <[hidden email]>:
> MacOSXPlatform isActivePlatform > > In all places? Obviously, the same with the other platforms. > > Is there a reason I don't see? I don't like this solution because it depends on the existence of the MacOSXPlatform class which is an implementation detail. -- Damien Cassou http://damiencassou.seasidehosting.st "Lambdas are relegated to relative obscurity until Java makes them popular by not having them." James Iry _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Igor Stasenko
On Tue, Jul 28, 2009 at 5:39 PM, Igor Stasenko <[hidden email]> wrote: I think that all such kind of queries (like isXXXPlatform) should be I am agree. I really believe in the phrase "tell don't ask". However, I have a couple of things to say: 1) It is not as easy as it seems. If you want to delegate to another object and be polymorphic regarding the platform you must reify a couple of classes (in your slash it is easy because you have the File hierarchy). I mean, you cannot put everything in the Platform class. And this must be done in every place. You must really understand that piece of code to change it. I can do this in my projects, but I don't know about to do it everywhere. 2) Let's go step by step. I would first remove all the "SmalltalkImage current platformName = 'Mac OS'" (and others platforms) from all places. Once we have this, we can see senders of isUnix for example, and try to see how to make this more OO instead of this if. (as you said).
_______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Damien Cassou
On Wed, Jul 29, 2009 at 5:11 AM, Damien Cassou <[hidden email]> wrote:
Why you say MacOSXPlatform is an implementation detail? Perhaps we can ask this messages to SmalltalkImage and then this delegates to the platform? However, I rather any of this solutions than having all the hardcoded string spear around in the image.
_______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
2009/7/29 Mariano Martinez Peck <[hidden email]>:
> On Wed, Jul 29, 2009 at 5:11 AM, Damien Cassou <[hidden email]> > wrote: >> >> 2009/7/28 Mariano Martinez Peck <[hidden email]>: >> > MacOSXPlatform isActivePlatform >> > >> > In all places? Obviously, the same with the other platforms. >> > >> > Is there a reason I don't see? >> >> I don't like this solution because it depends on the existence of the >> MacOSXPlatform class which is an implementation detail. > > Why you say MacOSXPlatform is an implementation detail? Perhaps we can ask > this messages to SmalltalkImage and then this delegates to the platform? Because this version forces the class MacOSXPlatform to exist in the image. It adds a strong dependency on the implementation of the Platform library (namely having classes for each kind of platform). -- Damien Cassou http://damiencassou.seasidehosting.st "Lambdas are relegated to relative obscurity until Java makes them popular by not having them." James Iry _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Mariano Martinez Peck
2009/7/29 Mariano Martinez Peck <[hidden email]>:
> > On Tue, Jul 28, 2009 at 5:39 PM, Igor Stasenko <[hidden email]> wrote: >> >> I think that all such kind of queries (like isXXXPlatform) should be >> not included and not used in a well-designed system. >> If you want some capability - then you should ask directly for it, >> irrespectively on what platform you are currently running. > > I am agree. I really believe in the phrase "tell don't ask". However, I have > a couple of things to say: > > 1) It is not as easy as it seems. If you want to delegate to another object > and be polymorphic regarding the platform you must reify a couple of classes > (in your slash it is easy because you have the File hierarchy). I mean, you > cannot put everything in the Platform class. And this must be done in every > place. You must really understand that piece of code to change it. I can do > this in my projects, but I don't know about to do it everywhere. The class OSPlatform is quite small. I would vote for: - implementing the following methods OSPlatform>>isMacOSX ^ false OSPlatform>>isWin32 ^ false OSPlatform>>isUnix ^ false and then MacOSXPlatform>>isMacOSX ^ true UnixPlatform>>isUnix ^ true Win32Platform>>isWin32 ^ true - when you want to test the platform, just do: OSPlatform current isMacOSX or OSPlatform current isWin32 What do you think? -- Damien Cassou http://damiencassou.seasidehosting.st "Lambdas are relegated to relative obscurity until Java makes them popular by not having them." James Iry _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
2009/7/29 Damien Cassou <[hidden email]>:
> 2009/7/29 Mariano Martinez Peck <[hidden email]>: >> >> On Tue, Jul 28, 2009 at 5:39 PM, Igor Stasenko <[hidden email]> wrote: >>> >>> I think that all such kind of queries (like isXXXPlatform) should be >>> not included and not used in a well-designed system. >>> If you want some capability - then you should ask directly for it, >>> irrespectively on what platform you are currently running. >> >> I am agree. I really believe in the phrase "tell don't ask". However, I have >> a couple of things to say: >> >> 1) It is not as easy as it seems. If you want to delegate to another object >> and be polymorphic regarding the platform you must reify a couple of classes >> (in your slash it is easy because you have the File hierarchy). I mean, you >> cannot put everything in the Platform class. And this must be done in every >> place. You must really understand that piece of code to change it. I can do >> this in my projects, but I don't know about to do it everywhere. > > The class OSPlatform is quite small. I would vote for: > > - implementing the following methods > > OSPlatform>>isMacOSX > ^ false > OSPlatform>>isWin32 > ^ false > OSPlatform>>isUnix > ^ false > > and then > > MacOSXPlatform>>isMacOSX > ^ true > UnixPlatform>>isUnix > ^ true > Win32Platform>>isWin32 > ^ true > > - when you want to test the platform, just do: > > OSPlatform current isMacOSX > > or > > OSPlatform current isWin32 > > What do you think? > How about shortcut methods then? OSPlatform class>>isMacOSX ^ self current isMacOSX etc... > -- > Damien Cassou > http://damiencassou.seasidehosting.st > > "Lambdas are relegated to relative obscurity until Java makes them > popular by not having them." James Iry > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > -- Best regards, Igor Stasenko AKA sig. _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
On Wed, Jul 29, 2009 at 4:02 PM, Igor Stasenko<[hidden email]> wrote:
> How about shortcut methods then? > > OSPlatform class>>isMacOSX > ^ self current isMacOSX Not sure it is that useful but I don't really care. -- Damien Cassou http://damiencassou.seasidehosting.st "Lambdas are relegated to relative obscurity until Java makes them popular by not having them." James Iry _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Damien Cassou
Am 29.07.2009 um 15:54 schrieb Damien Cassou: > 2009/7/29 Mariano Martinez Peck <[hidden email]>: >> >> On Tue, Jul 28, 2009 at 5:39 PM, Igor Stasenko <[hidden email]> >> wrote: >>> >>> I think that all such kind of queries (like isXXXPlatform) should be >>> not included and not used in a well-designed system. >>> If you want some capability - then you should ask directly for it, >>> irrespectively on what platform you are currently running. >> >> I am agree. I really believe in the phrase "tell don't ask". >> However, I have >> a couple of things to say: >> >> 1) It is not as easy as it seems. If you want to delegate to >> another object >> and be polymorphic regarding the platform you must reify a couple >> of classes >> (in your slash it is easy because you have the File hierarchy). I >> mean, you >> cannot put everything in the Platform class. And this must be done >> in every >> place. You must really understand that piece of code to change it. >> I can do >> this in my projects, but I don't know about to do it everywhere. > > The class OSPlatform is quite small. I would vote for: > > - implementing the following methods > > OSPlatform>>isMacOSX > ^ false > OSPlatform>>isWin32 > ^ false > OSPlatform>>isUnix > ^ false > > and then > > MacOSXPlatform>>isMacOSX > ^ true > UnixPlatform>>isUnix > ^ true > Win32Platform>>isWin32 > ^ true > > - when you want to test the platform, just do: > > OSPlatform current isMacOSX > > or > > OSPlatform current isWin32 > > What do you think? When I learned object orientation one of the first things I encountered was: "Procedural code makes decisions, object oriented code delegates." Or, sometimes simply: "Tell, don't ask!". For me this looks like asking... Regards Andreas _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
On Wed, Jul 29, 2009 at 5:20 PM, Andreas Wacknitz<[hidden email]> wrote:
> When I learned object orientation one of the first things I > encountered was: > "Procedural code makes decisions, object oriented code delegates." > Or, sometimes simply: "Tell, don't ask!". > For me this looks like asking... I agree but this would be a good start I think. -- Damien Cassou http://damiencassou.seasidehosting.st "Lambdas are relegated to relative obscurity until Java makes them popular by not having them." James Iry _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Am 29.07.2009 um 17:46 schrieb Damien Cassou: > On Wed, Jul 29, 2009 at 5:20 PM, Andreas Wacknitz<[hidden email]> > wrote: >> When I learned object orientation one of the first things I >> encountered was: >> "Procedural code makes decisions, object oriented code delegates." >> Or, sometimes simply: "Tell, don't ask!". >> For me this looks like asking... > > I agree but this would be a good start I think. A start in what direction? Is there a plan to change this later? And if so, when, who and how? Regards Andreas _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
On 29.07.2009, at 14:02, Andreas Wacknitz wrote: > > Am 29.07.2009 um 17:46 schrieb Damien Cassou: > >> On Wed, Jul 29, 2009 at 5:20 PM, Andreas Wacknitz<[hidden email]> >> wrote: >>> When I learned object orientation one of the first things I >>> encountered was: >>> "Procedural code makes decisions, object oriented code delegates." >>> Or, sometimes simply: "Tell, don't ask!". >>> For me this looks like asking... >> >> I agree but this would be a good start I think. > A start in what direction? Is there a plan to change this later? And > if so, when, who and how? > The old Squeak desease was that nothing ever was done, because at some point it was found that "we could do better". This resulted in *complete* paralysis. For Pharo, the idea is to do something if it´s better. Just imagine what you can do in 10 years if you do a lot of little things a little bit better. Instead of doing nothing and waiting for perfection. Marcus _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Igor Stasenko
2009/7/29 Igor Stasenko <[hidden email]>:
> 2009/7/29 Damien Cassou <[hidden email]>: >> 2009/7/29 Mariano Martinez Peck <[hidden email]>: >>> >>> On Tue, Jul 28, 2009 at 5:39 PM, Igor Stasenko <[hidden email]> wrote: >>>> >>>> I think that all such kind of queries (like isXXXPlatform) should be >>>> not included and not used in a well-designed system. >>>> If you want some capability - then you should ask directly for it, >>>> irrespectively on what platform you are currently running. >>> >>> I am agree. I really believe in the phrase "tell don't ask". However, I have >>> a couple of things to say: >>> >>> 1) It is not as easy as it seems. If you want to delegate to another object >>> and be polymorphic regarding the platform you must reify a couple of classes >>> (in your slash it is easy because you have the File hierarchy). I mean, you >>> cannot put everything in the Platform class. And this must be done in every >>> place. You must really understand that piece of code to change it. I can do >>> this in my projects, but I don't know about to do it everywhere. >> >> The class OSPlatform is quite small. I would vote for: >> >> - implementing the following methods >> >> OSPlatform>>isMacOSX >> ^ false >> OSPlatform>>isWin32 >> ^ false >> OSPlatform>>isUnix >> ^ false >> >> and then >> >> MacOSXPlatform>>isMacOSX >> ^ true >> UnixPlatform>>isUnix >> ^ true >> Win32Platform>>isWin32 >> ^ true >> >> - when you want to test the platform, just do: >> >> OSPlatform current isMacOSX >> >> or >> >> OSPlatform current isWin32 >> >> What do you think? >> > > How about shortcut methods then? > > OSPlatform class>>isMacOSX > ^ self current isMacOSX > > etc... > Or let it be a global? like Smalltalk, Processor, etc... Do we write SystemDictionary current? >> -- >> Damien Cassou >> http://damiencassou.seasidehosting.st >> >> "Lambdas are relegated to relative obscurity until Java makes them >> popular by not having them." James Iry >> >> _______________________________________________ >> Pharo-project mailing list >> [hidden email] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> > > > > -- > Best regards, > Igor Stasenko AKA sig. > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Free forum by Nabble | Edit this page |