Skip to content

Instantly share code, notes, and snippets.

@Geal
Created February 2, 2011 10:31
Show Gist options
  • Save Geal/807518 to your computer and use it in GitHub Desktop.
Save Geal/807518 to your computer and use it in GitHub Desktop.
Displays only the body of a method (without prototype and comments)
| scriptMethod sourceString sourceStringWithBracketsStripped |
scriptMethod := CLASS_HERE compiledMethodAt: #METHOD_HERE.
sourceString := scriptMethod methodNode body asString.
sourceStringWithBracketsStripped := sourceString copyFrom: 3 to: sourceString size - 2.
sourceStringWithBracketsStripped.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment