Re: [Pharo-users] Generate equality

2018-02-09 Thread Denis Kudriashov
I will add it to Calypso. I use it often. 2018-02-08 17:23 GMT+03:00 Herbert Vojčík : > > Stephane Ducasse wrote: > >> http://smalltalkhub.com/#!/~CAR/ReusableBricks/packages/Equals >> > > Ah. It uses trait that does it dynamically. > > Good to know, usable for some more dynamic scenarios; but he

Re: [Pharo-users] Generate equality

2018-02-08 Thread Herbert Vojčík
Stephane Ducasse wrote: http://smalltalkhub.com/#!/~CAR/ReusableBricks/packages/Equals Ah. It uses trait that does it dynamically. Good to know, usable for some more dynamic scenarios; but here I wanted something more explicit a la existing "generate xxx", so I went for Alistair's suggestio

Re: [Pharo-users] Generate equality

2018-02-08 Thread Stephane Ducasse
http://smalltalkhub.com/#!/~CAR/ReusableBricks/packages/Equals On Thu, Feb 8, 2018 at 12:47 PM, Herbert Vojčík wrote: > > > Alistair Grant wrote: >> >> Hi Herby, >> >> On 8 February 2018 at 03:10, Herbert Vojčík wrote: >>> >>> Hi! >>> >>> Do you think it would be reasonable to have, a la "genera

Re: [Pharo-users] Generate equality

2018-02-08 Thread Herbert Vojčík
Alistair Grant wrote: Hi Herby, On 8 February 2018 at 03:10, Herbert Vojčík wrote: Hi! Do you think it would be reasonable to have, a la "generate accessors" / "generate initialize method", a "generate equality" thingie that would generate #= and #hash for the method, mechanically? Just cr

Re: [Pharo-users] Generate equality

2018-02-08 Thread Alistair Grant
Hi Herby, On 8 February 2018 at 03:10, Herbert Vojčík wrote: > Hi! > > Do you think it would be reasonable to have, a la "generate accessors" / > "generate initialize method", a "generate equality" thingie that would > generate #= and #hash for the method, mechanically? > > Just created a new "pi

Re: [Pharo-users] Generate equality

2018-02-08 Thread herby
On February 8, 2018 5:07:03 AM GMT+01:00, "Hernán Morales Durand" wrote: >Hi Herbert, > >How the "generate equality" behavior would be the default? >Mechanically = non-interactive? Like “generate accessors”. So interactively, on demand. Of course. I tried to draw that analogy on original post

Re: [Pharo-users] Generate equality

2018-02-08 Thread Stephane Ducasse
Guys you should really check what noury did :) On Thu, Feb 8, 2018 at 5:07 AM, Hernán Morales Durand wrote: > Hi Herbert, > > How the "generate equality" behavior would be the default? > Mechanically = non-interactive? > > Cheers, > > Hernán > > > 2018-02-07 13:10 GMT-03:00 Herbert Vojčík : >>

Re: [Pharo-users] Generate equality

2018-02-07 Thread Hernán Morales Durand
Hi Herbert, How the "generate equality" behavior would be the default? Mechanically = non-interactive? Cheers, Hernán 2018-02-07 13:10 GMT-03:00 Herbert Vojčík : > Hi! > > Do you think it would be reasonable to have, a la "generate accessors" / > "generate initialize method", a "generate equal

Re: [Pharo-users] Generate equality

2018-02-07 Thread Richard Sargent
On Wed, Feb 7, 2018 at 12:51 PM, Herbert Vojčík wrote: > > > Esteban A. Maringolo wrote: > >> I wouldn't start a flamewar on this, but being able to separate >> equality and identity is important. >> >> Otherwise we should have to remove #= or #== since of either is >> redundant. :) >> >> If you'

Re: [Pharo-users] Generate equality

2018-02-07 Thread Herbert Vojčík
Esteban A. Maringolo wrote: I wouldn't start a flamewar on this, but being able to separate equality and identity is important. Otherwise we should have to remove #= or #== since of either is redundant. :) If you're dealing with ORM having a good implementation of #= is important, since you m

Re: [Pharo-users] Generate equality

2018-02-07 Thread Esteban A. Maringolo
I wouldn't start a flamewar on this, but being able to separate equality and identity is important. Otherwise we should have to remove #= or #== since of either is redundant. :) If you're dealing with ORM having a good implementation of #= is important, since you might have several instances repr

Re: [Pharo-users] Generate equality

2018-02-07 Thread Norbert Hartl
I think that implementing = and hash is almost always wrong. So I guess the answer is no :) Norbert > Am 07.02.2018 um 17:10 schrieb Herbert Vojčík : > > Hi! > > Do you think it would be reasonable to have, a la "generate accessors" / > "generate initialize method", a "generate equality" thin

Re: [Pharo-users] Generate equality

2018-02-07 Thread Stephane Ducasse
Noury proposed a traits for that long time ago and it looked smart. I do not remember where. On Wed, Feb 7, 2018 at 5:10 PM, Herbert Vojčík wrote: > Hi! > > Do you think it would be reasonable to have, a la "generate accessors" / > "generate initialize method", a "generate equality" thingie that

Re: [Pharo-users] Generate equality

2018-02-07 Thread Herbert Vojčík
This does not look like the answer to my question. :-/ Ok, to rephrase: Would you find it useful to have "generate equality" which generates #= and #hash for a class? Herby P.S.: I know there is "generate accessors". I mentioned it as "a thing which is there, and from which one can get insp

Re: [Pharo-users] Generate equality

2018-02-07 Thread Peter Uhnák
> generate accessors there is option to generate accessors (right click on class)... but I find it rarely useful after initial setup (having accessors for all instance variables is rarely needed, and it is annoying to uncheck all the time). In the latter scenario I have a small hack (startup scri

[Pharo-users] Generate equality

2018-02-07 Thread Herbert Vojčík
Hi! Do you think it would be reasonable to have, a la "generate accessors" / "generate initialize method", a "generate equality" thingie that would generate #= and #hash for the method, mechanically? Just created a new "piece of data" class and felt like it would be helpful. Herby