clj_emitter_pattern
Utility functions for processing patterns in the Clojerl emitter.
The code in this modules that does the actual work was copied from
the v3_core
module in the Erlang/OTP compiler
application.
Given a list of patterns, it generates the guards that apply to all of them when considered together and it also transforms the patterns.
The exported functions present an API to facilitate the usage fromclj_emitter
.
Summary
Functions
- fold_guards(Guards)
-
fold_guards(Guard, PatternGuards)
Combines
Guard
with a list ofPatternGuards
using the booleanand
operator. - patterns(Patterns)
- patterns(Patterns, KnownVars)
Functions
fold_guards(Guards)
-spec fold_guards([cerl:cerl()]) -> cerl:cerl().
fold_guards(Guard, PatternGuards)
-spec fold_guards(cerl:cerl(), [cerl:cerl()]) -> cerl:cerl().
Combines Guard
with a list of PatternGuards
using the
boolean and
operator.