3 ms·
>Matz's regret for `do ... while` Huh? Do you mean http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/6745 http://blade.nagaokaut.ac.jp/cgi-bin/scat.r
by cremno 12y ago
>Matz's regret for `do ... while`
Huh? Do you mean http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/6745 http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/...? It's still there: http://crystal-lang.org/docs/syntax_and_semantics/while.html http://crystal-lang.org/docs/syntax_and_semantics/while.html
Edit: Ah, the behavior of the while modifier is different in Crystal.
- vortico 12y agoI was referring to the veil of deprecation over `do end while` by Matz's comment that you've linked, but as long as Crystal endorses it, is it fine with me.
- asterite 12y agoWe actually started by copying ruby's syntax and semantic, including the `do end while`. But a long time ago we started to diverge from it. We are also not sure about this "feature" and we still have time to remove it from the language :-) . It's true that a simple `while ... break if ... end` is enough. Edit: I also misunderstood the comment. In Crystal `exp while cond` and `begin exp end while cond` are the same.