ix.util.match
Class SimpleMatcher
java.lang.Object
|
+--ix.util.match.SimpleMatcher
- public final class SimpleMatcher
- extends java.lang.Object
A simple pattern-matcher.
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
emptyEnv
public static final MatchEnv emptyEnv
- emptyEnv is used to return non-null without allocating an env.
REST
public static final Symbol REST
SimpleMatcher
public SimpleMatcher()
mustMatch
public static final MatchEnv mustMatch(java.lang.Object pat,
java.lang.Object dat)
mustMatch
public static final MatchEnv mustMatch(java.lang.Object pat,
java.lang.Object dat,
MatchEnv env)
match
public static final MatchEnv match(java.lang.Object pat,
java.lang.Object dat)
- Match tries to match a pattern against an object.
Only the pattern can contain variables. If a variable appears
more than once in a pattern, there's no attempt to check that it
matches the same thing each time.
For now, numbers are compared as objects, not by comparing
their numeric values.
- Returns:
- a MatchEnv or null.
- See Also:
MatchEnv
,
ItemVar
match
public static final MatchEnv match(java.lang.Object pat,
java.lang.Object dat,
MatchEnv env)