[squeak-dev] The Inbox: Kernel-ct.1292.mcz

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Mon Jan 6 14:09:26 UTC 2020

Okay, so you would prefer a different naming?

On the other side, there are many prepositions that have different meanings in different selectors ...

For example, "in:" for Objects expects an evaluable. "in:" for Compilers expects either an environment or a context.

"on:" expects either an exception, or a model, or an event name, or a stream. :)

Personally, I don't really care - each selector in Squeak is only one Cmd + M or Cmd + ArrowRight away from revealing their argument's true names. Smalltalk's complexity is just greater than the complexity of any natural language :-)



Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel
Gesendet: Montag, 6. Januar 2020 10:42:56
An: John Pfersich via Squeak-dev
Betreff: Re: [squeak-dev] The Inbox: Kernel-ct.1292.mcz

Note Squeak's object events: #when:send:to:. There, "when" requires an event object as a look-up key in the event map. Usually a Symbol.


Am 03.01.2020 07:43:42 schrieb Jakob Reschke <forums.jakob at resfarm.de>:

Note that VA Smalltalk has a legacy approach to exceptions that precedes the ANSI standard. It uses #when:do: in place of #on:do:. (Nowadays it also supports #on:do: but not for old-style exceptions in applications.) Might not a blocker for the proposed nomenclature, but you should at least be aware of it.

<commits at source.squeak.org<mailto:commits at source.squeak.org>> schrieb am Fr., 3. Jan. 2020, 02:21:
A new version of Kernel was added to project The Inbox:

==================== Summary ====================

Name: Kernel-ct.1292
Author: ct
Time: 3 January 2020, 2:21:26.297116 am
UUID: 95936a10-85a4-734e-a10b-0f87290b70f9
Ancestors: Kernel-nice.1291

Proposal: Implement conditional exception handling on blocks. The nomenclature is inspired from usual practice in .NET languages.

For an impression of possible users, have a look at:

        self systemNavigation
                browseMessageList: ((self systemNavigation allCallsOn: #on:do: and: #pass) intersection: (#(ifTrue: ifFalse: ifTrue:ifFalse: ifFalse:ifTrue:) gather: [:sel | self systemNavigation allCallsOn: sel]))
                name: 'Potential users of #on:when:do:'

=============== Diff against Kernel-nice.1291 ===============

Item was added:
+ ----- Method: BlockClosure>>on:when:do: (in category 'exceptions') -----
+ on: exceptionOrExceptionSet when: aPredicate do: handlerAction
+       ^ self
+               on: exceptionOrExceptionSet
+               do: [:exception |
+                       (aPredicate value: exception)
+                               ifTrue: [handlerAction cull: exception]
+                               ifFalse: [exception pass]]!

Item was added:
+ ----- Method: BlockClosure>>on:when:ensure: (in category 'exceptions') -----
+ on: exceptionOrExceptionSet when: aPredicate ensure: aBlock
+       ^ self
+               on: exceptionOrExceptionSet
+               do: [:exception |
+                       (aPredicate value: exception)
+                               ifTrue: [aBlock value].
+                       exception pass]!

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

More information about the Squeak-dev mailing list