[squeak-dev] Invariants give guidance here (was Re: A question about #beginsWith: and #endsWith:)

David T. Lewis lewis at mail.msen.com
Fri Apr 22 18:46:57 UTC 2022


On Fri, Apr 22, 2022 at 09:40:15AM +0200, Tony Garnock-Jones wrote:
> On 4/22/22 03:57, David T. Lewis wrote:
> >I don't think it is a bug. I can't think of a case where it makes
> >sense to say that a string of characters "begins with" or "ends with"
> >a string that contains nothing.
> 
> I think we (well, certainly *I*) want invariants like the following to hold:
> 
>     for all X, Y, Z,
>       `Z = (X, Y)` implies `(Z beginsWith: X) = true`.
> 
> Without `(X beginsWith: '') = true`, they don't. I think that's a bug.
> 
> (It's a classic (even classical) one, too. This kind of problem arose 
> with Aristotle's syllogistics and didn't really get properly fixed until 
> Frege straightened it all out in the 19th century (!). Aristotle has, 
> contra modern logic, universally-quantified statements false where the 
> relevant universe is empty; this causes all sorts of havoc, forcing 
> nasty exceptions everywhere. Anyone interested in going down this 
> rabbithole will likely find [1] diverting!)
> 
> Tony
> 
> [1] https://plato.stanford.edu/entries/generalized-quantifiers/
>

This is what I love about Squeak, I'm always learning something :-)

In any case, if Richard O'Keefe, Tony Garnock-Jones, and Aristotle
all agree that it's a bug, then I guess it's a bug. We should write
some tests and fix it.

Dave
 


More information about the Squeak-dev mailing list