Created
April 19, 2014 18:48
-
-
Save apmckinlay/11093691 to your computer and use it in GitHub Desktop.
first approach
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
type CharMatch interface { | |
Match(c rune) bool | |
} | |
type is_cm struct { | |
c rune | |
} | |
func (cm is_cm) Match(c rune) bool { | |
return c == cm.c | |
} | |
func Is(c rune) CharMatch { | |
return is_cm{c} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment