ix.util.match
Class SimpleMatcher
java.lang.Object
|
+--ix.util.match.SimpleMatcher
- public class SimpleMatcher
- extends java.lang.Object
A simple pattern-matcher.
Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
toString,
wait,
wait,
wait |
emptyEnv
private static final MatchEnv emptyEnv
- emptyEnv is used to return non-null without allocating an env.
REST
public static final Symbol REST
SimpleMatcher
public SimpleMatcher()
match
public static 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 MatchEnv match(java.lang.Object pat,
java.lang.Object dat,
MatchEnv env)
matchRest
private static final MatchEnv matchRest(java.lang.Object pat,
java.lang.Object dat,
MatchEnv env)
when
private static final MatchEnv when(boolean cond,
MatchEnv env)
success
private static final MatchEnv success(MatchEnv env)