Skip to content

Instantly share code, notes, and snippets.

@Birne94
Created May 26, 2015 16:14
Show Gist options
  • Save Birne94/06bb7dd3df2a6a44cc80 to your computer and use it in GitHub Desktop.
Save Birne94/06bb7dd3df2a6a44cc80 to your computer and use it in GitHub Desktop.
REPL Shortcut Injection
| exception |
[ #replay n:2 ]
on: MessageNotUnderstood
do: [:ex | exception := ex ].
message := (exception receiver asString) , ':', (exception message selector asString).
args := OrderedCollection new.
args add: #context.
args addAll: exception message arguments.
shortcuts := REPLShortcuts new.
shortcuts perform: message asSymbol withArguments: args asArray
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment