Created
May 25, 2010 10:10
-
-
Save timfel/412975 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(Object allMethodsInCategory: 'testing') | |
select: [:m | | |
(m asString beginsWith: 'is') and: | |
[(m asString endsWith: ':') not]] | |
thenDo: [:each | | |
Object compile: (each asString | |
copyReplaceAll: 'is' with: 'if'), ': aBlock | |
^ self ', each asString, ' ifTrue: aBlock'. | |
Object organization | |
classify: each | |
under: 'conditional-blocks']. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment