[Pharo-dev] Phexample: API Change Proposal (was Phexample: Image Destroying Bug)

Stefan Marr smalltalk at stefan-marr.de
Tue Apr 22 11:08:55 EDT 2014

Hi Sean:

First of all, I enabled public write access on the repository.
While I am the admin on the project, I took it over from Niko and Adrian, and at this point, I would consider it ‘community maintained’.

The rest inline:

On 22 Apr 2014, at 16:40, Sean P. DeNigris <sean at clipperadams.com> wrote:

> - change matcher #= to #equal: e.g. "1 should = 1" would now be written "1
> should equal: 1"
> Motivation: the #= magic made it impossible to store matchers in
> dictionaries, and #hash was implemented to signal an error explaining as
> much. Unfortunately, #= and #hash are deeply ingrained Smalltalk concepts,
> and are assumed to work as expected. In Pharo 3.0, the debugger tried to put
> matchers in a dictionary, causing an infinite error loop whenever a matcher
> failed.

I personally don’t have a qualified opinion, in the sense that I do not actively use Phexample at the moment.
Still, I will state it anyway: I don’t like the change.

So, just for the sake of argument, are there other ways?
Are matchers reused, or are they one-shot things?
If the later is true, perhaps, we could maintain the ‘cuteness’ of #= by making the matchers a little more cooperative?
If they are one-shot objects, how about using their standard behavior only on the first access, and then switch their state so that #= and #hash respond normally?


Stefan Marr
INRIA Lille - Nord Europe

More information about the Pharo-dev mailing list