I was trying to understand the following code:
def() ->commands
if(deferred_passive_abilities != [],
let [{ability: class passive_ability, creature: class creature}] items = [];
let found = false;
map(deferred_passive_abilities,
if(cmd = null, add(items, [value]), [cmd, set(found, true)])
where cmd = value.ability.static_effect(me, value.creature));
if(found,
set(deferred_passive_abilities, items);
evaluate_deferred_passive_abilities(),
set(deferred_passive_abilities, []))
)
Haskell appears to have both let
and where
, but I didn't learn much by a superficial reading of their haskell docs. They also have a let...in
, which I didn't understand but it would be good to know if FFL has that.
So, what is the significance of using let
versus where
? Was it necessary to use let
here? (Also, possibly another question: why does it need those semicolons?)