Re: [Pharo-users] difference between double dispatch and the method explains here

2019-04-09 Thread Richard O'Keefe
On this laptop I have - Squeak - Pharo - GNU Smalltalk - VisualAge Smalltalk - VisualWorks Smalltalk - Smalltalk/X plus some oddballs like susie, amber, and CSOM. On another laptop I have - Strongtalk - Dolphin And of course I have my own 'astc' Smalltalk-via-C compiler. I have to say that

Re: [Pharo-users] difference between double dispatch and the method explains here

2019-04-08 Thread Roelof Wobben
Thanks, for the discusson and lessons. I will think about it and also think if smalltalk is for me. I did the pharo Mooc and still have a lot of problems making the smalltalk way click in my head so I can solve little problems like this.

Re: [Pharo-users] difference between double dispatch and the method explains here

2019-04-08 Thread Richard O'Keefe
You are expected to use my code fragments for *ideas*, not to incorporate them *literally* in your code. As I explained, *without seeing the specification*, I have no way to tell whether the specification uses a left-handed or right-handed coordinate system. For what it's worth, here's a

Re: [Pharo-users] difference between double dispatch and the method explains here

2019-04-08 Thread Roelof Wobben
yes,  this is a real  tests from the pharo track on exercism.io I understand what you mean but maybe I overthinking things. But if we have a robot facing north and the robot turns to the left  , im my oponion it faces now to the east. like

Re: [Pharo-users] difference between double dispatch and the method explains here

2019-04-08 Thread Richard O'Keefe
The basic issue here is abstraction. An instance of "Robot" in your program is not a physical object. How could it possibly point North, South, or Nor-nor-west? It cannot. Its location and direction are abstract values *metaphorically* related to real world notions like position vectors and

Re: [Pharo-users] difference between double dispatch and the method explains here

2019-04-08 Thread Roelof Wobben
Richard thanks. One thing I do not see direct. you said : A direction could be represented by a pair of integers dx, dy such that |dx|+|dy| = 1.  It could also be represented by a Point with

Re: [Pharo-users] difference between double dispatch and the method explains here

2019-04-08 Thread Roelof Wobben
Op 8-4-2019 om 10:57 schreef Richard O'Keefe: One thing I have often seen and lamented is students writing excessively complicated code with way too many classes.  There is a huge difference between

Re: [Pharo-users] difference between double dispatch and the method explains here

2019-04-08 Thread Richard O'Keefe
One thing I have often seen and lamented is students writing excessively complicated code with way too many classes. There is a huge difference between "A Robot knows its position and direction." and "A Robot has-a Position and has-a Direction." The first is the important one. The second is

Re: [Pharo-users] difference between double dispatch and the method explains here

2019-04-07 Thread Roelof Wobben
I can try to explain what I trying to solve. I have a Robot which can turn left,  turn right or moveForward. now I have a string like 'LAR' that means the robot needs to turn left (l) , move forward one place (A) and turn left.

Re: [Pharo-users] difference between double dispatch and the method explains here

2019-04-07 Thread Richard O'Keefe
It would really REALLY **REALLY** help if we knew what the heck you were trying to do. There is an excellent chance that it is MUCH simpler than you think. If you cannot show us the Smalltalk version of the problem, can you show us the version for some other language? On Sun, 7 Apr 2019 at

Re: [Pharo-users] difference between double dispatch and the method explains here

2019-04-07 Thread Roelof Wobben
Op 6-4-2019 om 15:15 schreef K K Subbu: On 06/04/19 4:49 PM, Roelof Wobben wrote: Hello, I just learned double dispatch. And now for the Robot challenge of exercism Tim has pointed me to this article(https://blog.metaobject.com/2019/04/accessors-have-message-obsession.html) but I fail to

Re: [Pharo-users] difference between double dispatch and the method explains here

2019-04-06 Thread Roelof Wobben
oke, so I need a single Object here that contains this in a initialize function : north = Direction( 0, -1) east = Direction( 1, 0) south = Direction( 0, 1) west = Direction(-1, 0) oke, then time to figure out how to change my functions because

Re: [Pharo-users] difference between double dispatch and the method explains here

2019-04-06 Thread K K Subbu
On 06/04/19 4:49 PM, Roelof Wobben wrote: Hello, I just learned double dispatch. And now for the Robot challenge of exercism Tim has pointed me to this article(https://blog.metaobject.com/2019/04/accessors-have-message-obsession.html) but I fail to see how the move method looks like in that