Skip to content

Instantly share code, notes, and snippets.

@lexdene
Created June 28, 2013 07:52
Show Gist options
  • Select an option

  • Save lexdene/5883165 to your computer and use it in GitHub Desktop.

Select an option

Save lexdene/5883165 to your computer and use it in GitHub Desktop.
吐槽一下coffee的语法
# coffee可以这样写
foo() if 0 == a
# 也可以这样写
if 0 == a then foo() else bar()
# 但是不能可以这样写,编译出来根本不是我想要的效果
foo() if 0 == a else bar()
# 也不能这样写,会报语法错误
b = 1 if 0 == a else 2
# 我只能这样写
b = (if 0 == a then 1 else 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment