ternary in postlude?

拈花ヽ惹草 提交于 2019-12-24 10:35:31

问题


Can I do ternary in the postlude(s) the same way that I do them int he prelude? In other words have it fire off different calls depending on the say something was evaluated in the prelude?


回答1:


Yes. You can include a guard condition on a postlude expression. This works for both explicit event raising and persistant variable modification. The expression following if can be any valid expression, including functions.

Example:

fired {
  raise explicit event "foo" if cheese == 5;
}


来源:https://stackoverflow.com/questions/5887748/ternary-in-postlude

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!