Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does find-by-example work in the Pharo Finder?

One of the things I was most impressed with when digging into Pharo was that the Finder could do find-by-example. I'd previously only seen this in languages like Haskell, where it's possible to know for certain that a function has no side effects. How does Pharo manage to implement this in a way that is safe, performant, and side-effect free?

like image 755
Avdi Avatar asked May 11 '15 20:05

Avdi


1 Answers

Magic :)

Actually... although I've been dreaming about creating the list from the tests automatically, the reality is that we manually maintain a list of safe messages (obviously error-prone; I seriously doubt it's 100% accurate). See MethodFinder>>#initialize.

So a trick, but not exactly magic ;)

like image 86
Sean DeNigris Avatar answered Nov 15 '22 15:11

Sean DeNigris