[squeak-dev] The Inbox: Kernel-fbs.732.mcz

Eliot Miranda eliot.miranda at gmail.com
Mon Jan 28 23:58:17 UTC 2013


Hi Frank,

    IMO the exception is overkill.  The context can be found from the
sender of the signalling context for error.  Once the context is found its
selector and arguments are available.  Even if you keep the exception you
shouldn't need to load it with all that state (ugly as hell).  It can all
be discovered by introspection in the debugger.  And a better place for the
introspection would be something like ContextPart>invocationMessage that
would answer a MessageSend for a context.  Note that createMethod is driven
by a Message.

2¢

On Sun, Jan 27, 2013 at 3:23 AM, <commits at source.squeak.org> wrote:

> Frank Shearar uploaded a new version of Kernel to project The Inbox:
> http://source.squeak.org/inbox/Kernel-fbs.732.mcz
>
> ==================== Summary ====================
>
> Name: Kernel-fbs.732
> Author: fbs
> Time: 27 January 2013, 11:23:27.822 am
> UUID: b9ad1255-fa5b-4480-ae3f-923fd0969ca8
> Ancestors: Kernel-nice.731
>
> #subclassResponsibility in-Debugger method creation #1 of 4: Raise a
> SubclassResponsibility when something sends #subclassResponsibility,
> recording the offending class, the selector, and the arguments to the
> selector. (The Debugger uses this information.)
>
> =============== Diff against Kernel-nice.731 ===============
>
> Item was changed:
>   ----- Method: Object>>subclassResponsibility (in category 'error
> handling') -----
>   subclassResponsibility
>         "This message sets up a framework for the behavior of the class'
> subclasses.
>         Announce that the subclass should have implemented this message."
> +       | exception args senderCtxt |
> +       "We must assign to a local variable so that the Debugger can
> access the exception through thisParticularContext tempAt: 1. This also
> means that the exception local must be the first local declared."
> +       senderCtxt := thisContext sender.
> +        "Copy the temps out of senderCtxt"
> +       args := OrderedCollection new.
> +       1 to: senderCtxt selector numArgs do:
> +               [:idx | args addLast: (senderCtxt tempAt: idx)].
> +       exception := SubclassResponsibilityError
> +               class: self class
> +               selector: senderCtxt selector
> +               arguments: args.
> +       exception signal.!
> -
> -       self error: 'My subclass should have overridden ', thisContext
> sender selector printString!
>
>
>


-- 
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20130128/d8539686/attachment.htm


More information about the Squeak-dev mailing list