News for hackers. Stuff that matters.
Re:The Idea of Lisp by adwn on Friday December 16, 2016 @09:14AM (#13193316)
In Rust, if-else is an expression, and there's no separate ternary operator.
Re:The Idea of Lisp by agentgt on Friday December 16, 2016 @09:18AM (#13193348)
Yep I know. Rust although syntactically looks like an Algol [1] like language it actually barely is one :) . It is more akin to a ML language [2].

[1]: https://en.wikipedia.org/wiki/Generational_list_of_programmi...

[2]: https://en.wikipedia.org/wiki/Generational_list_of_programmi...

Re:The Idea of Lisp by clarkd99 on Friday December 16, 2016 @10:37AM (#13193943)
My current project is over 90,000 lines of C and I have programmed in C since the 1970's (as well as many other languages). I have never used a ternary operator and I think it reads quite poorly. I just use a few lines of easily read code instead. I also never use a do/while construction with the condition at the bottom of the loop. When I need such a construct I just put in an "if" and "break" where ever needed instead. I don't think C should be dissed because of a few unneeded and probably unused features. In C, you can put more than 1 statement on a line if they are separated by a ';' but I have never done that in hundred's of thousands of lines of C code.
Re:The Idea of Lisp by flogic on Friday December 16, 2016 @12:41PM (#13195072)
I don't program in C but I use the ternary operator quite regularly. It's quite handy when you're populating large data structures. For limited use in that case I don't find the readability that diminished maybe even enhanced.