Skip to content

Instantly share code, notes, and snippets.

@FCO
Created July 30, 2023 05:10
Show Gist options
  • Select an option

  • Save FCO/274fcdce93b2c5f3c257f91e3dfafb0c to your computer and use it in GitHub Desktop.

Select an option

Save FCO/274fcdce93b2c5f3c257f91e3dfafb0c to your computer and use it in GitHub Desktop.
EEL thinking
enum Area <kanto johto hoenn sinnoh unova kalos alola>;
event Hot {
has Str $.type where * eq "temperature";
has Area $.area;
has Int $.value where * > 40;
}
event Dry {
has Str $.type where * eq "humidity";
has Area $.area;
has UInt $.value where * < 20;
}
event FireRisk {
method EMIT($/) {
type => "fire-risk",
area => $<temp><area>,
temperature => $<temp><value>,
humidity => $<hum><value>,
}
pattern TOP {
[ <temp=Hot> & <hum=Dry> ] 5min
{ $<temp><area> == $<hum><area> }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment