Created
July 30, 2023 05:10
-
-
Save FCO/274fcdce93b2c5f3c257f91e3dfafb0c to your computer and use it in GitHub Desktop.
EEL thinking
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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