LoginSignup
0
0

More than 5 years have passed since last update.

Ceylon三項演算子が無い?

Posted at

CeylonではC言語系のプログラム言語のほとんどで採用されている
三項演算子の下記の書き方が出来ません。


    value condition = true;

    value result = condition ? "True" : "False"; // コンパイルエラー

代わりにthen-elseで書くことが出来ます。


    value condition = true;

    value result = condition then "True" else "False" ;

うーん。
微妙にイマイチな。。。

まあ、三項演算子を使うこと事態が賛否あるので
どうなんでしょうね。

変数宣言のときに比較して代入の必要があればいいのかな?
うーん。

って感じでした。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0