anura

keyword - FFL: Where vs. Let

徘徊边缘 提交于 2020-01-15 06:37:10
问题 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

Understanding the evaluation and execution order with semicolon syntax

感情迁移 提交于 2019-12-23 06:28:45
问题 I already learned a little bit about FFL semicolons from my previous question. However, it is still not clear what order of evaluation or execution they enforce. So here is a more concrete example: [ expr_a, expr_b ; expr_c, expr_d ; expr_e, expr_f ] What should be the order of execution for the above code? In my head, it should be: evaluate a & b execute a, execute b evaluate c & d execute c, execute d evaluate e & f execute e, execute f Now let's imagine that expr_b = add(test_list, ['b saw