abstract class School::BasePattern

Overview

A pattern.

Prefer Pattern over BasePattern since classes derived from Pattern can be used with special patterns Any and None.

Direct Known Subclasses

Defined in:

school/rule/pattern.cr

Instance Method Summary

Instance Method Detail

abstract def match(bindings : Bindings, trace : TraceNode | Nil = nil, &block : Bindings -> Nil) : Nil #

Indicates whether or not any facts match the pattern.

Yields once for each match.


[View source]
def to_s(io : IO) #

Appends a short String representation of this object.


[View source]
abstract def vars : Enumerable(String) #

Returns the variables in the pattern.


[View source]