Skip to content

Instantly share code, notes, and snippets.

@apmckinlay
Created April 19, 2014 18:48
Show Gist options
  • Save apmckinlay/11093691 to your computer and use it in GitHub Desktop.
Save apmckinlay/11093691 to your computer and use it in GitHub Desktop.
first approach
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