Phexample: API Change Proposal

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Phexample: API Change Proposal

Sean P. DeNigris
Administrator
I brought this up on Pharo Dev (http://forum.world.st/Phexample-API-Change-Proposal-was-Phexample-Image-Destroying-Bug-td4755787.html#a4756229) and wanted to re-post here before committing my fix, since I assume that Squeak and Pharo make up the Phexample user base...

MAJOR API CHANGE:
- change matcher #= to #equal: e.g. "1 should = 1" would now be written "1 should equal: 1"
- update all code to use new API

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.

Let me know if you have any suggestions/objections/whatever.

Sean
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Phexample: API Change Proposal

Frank Shearar-3
On 19 May 2014 19:53, Sean P. DeNigris <[hidden email]> wrote:

> I brought this up on Pharo Dev
> (http://forum.world.st/Phexample-API-Change-Proposal-was-Phexample-Image-Destroying-Bug-td4755787.html#a4756229)
> and wanted to re-post here before committing my fix, since I assume that
> Squeak and Pharo make up the Phexample user base...
>
> MAJOR API CHANGE:
> - change matcher #= to #equal: e.g. "1 should = 1" would now be written "1
> should equal: 1"
> - update all code to use new API
>
> 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.
>
> Let me know if you have any suggestions/objections/whatever.

Thanks for the notification, Sean. The change looks good!

frank

Reply | Threaded
Open this post in threaded view
|

Re: Phexample: API Change Proposal

Sean P. DeNigris
Administrator
Frank Shearar-3 wrote
The change looks good!
I bumped the version from 1.2 -> 2.0 per semantic versioning (non-backward-compatible bumps major)
Cheers,
Sean