Ruby中then关键字有什么
ruby吧
全部回复
仅看楼主
level 11
Ruby中then关键字有什么用,感觉可有可无
2015年08月11日 02点08分 1
level 6
只是用来分隔而已,
如果if 分开在多行,就不需要。在同一行,则需要。应该也可以用分号。
2015年08月11日 04点08分 2
谢谢[哈哈]
2015年08月11日 09点08分
level 1
我都忘了还有这么个关键字。
2015年08月11日 10点08分 3
level 12
有空请读一下:
https://github.com/bbatsov/ruby-style-guide
搜寻一下有关 then 的字样,
会发现几乎不建议用到 then 。
大概只有在用 case 的时候要用到 then。
2015年08月11日 10点08分 4
1