[squeak-dev] The Inbox: System-dtl.1209.mcz

Vanessa Freudenberg vanessa at codefrau.net
Tue Jan 5 19:51:46 UTC 2021

On Tue, Jan 5, 2021 at 9:24 AM David T. Lewis <lewis at mail.msen.com> wrote:

> On Tue, Jan 05, 2021 at 01:17:50PM +0100, Marcel Taeumel wrote:
> > Hi Dave.
> >
> > >??Provide vmParameterAt:default: to handle primitive failure on reading
> VM parameters.
> >
> > Hmm... #vmParameterAt:ifAbsent: would be "more idiomatic"?
> >
> I was not sure about this either. It tried "ifAbsent" and "onError"
> but ifAbsent sounded too much like collection behavior, and onError
> just looked strange. In the end I decided that what we are really
> trying to do is supply a default in the case of a VM that does not know
> about a VM parameter, so that's how I ended up with vmParameterAt:default:
> Dave

I had the same reaction though, especially since you allow passing a block
which is evaluated only if the primitive fails.

Maybe thinking of it as being equivalent to

   Smalltalk getVMParameters at: index ifAbsent: [...]

would make the "... ifAbsent:" more palatable?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210105/e54bc8bd/attachment-0001.html>

More information about the Squeak-dev mailing list