in reply to Re^2: Mr. Ternary is greater than Mrs. If Else
in thread Mr. Ternary is greater than Mrs. If Else
literally, Mr. Ternary is more on simple symbols that gives you a more concentration on expressions and statements without being bothered with words like if, elsif, and else.
Indeed: if, else, elsif are flow control constructs. ?: is an operator. Now, it happens, thanks to short circuiting and the availability of constructs that take a block and execute it, that the latter can be used in a semantically equivalent manner to the former. Yet, as has been repeatedly explained to you in this thread, they serve different purposes: there are superimpositions and there may be some situation in which the choice is not obvious. But this is generally not the case.
i don't think so that other languages could make Mr. Ternary more functional (making Mr. Ternary hold multiple-statements) than Perl could do. what do you think?
I don't understand your question, but I'll make some guess and try to answer anyway: in some functional languages, the regular branching control structures behave much like (C and) Perl's ?: in that they return a value - exactly because they're functional. But seriously, your insisting on this issue makes me think that you're simply fond of the extreme conciseness you get out of it. OTOH several different monks already explained to you the reason why we generally do not strive for extreme conciseness: Perl has already a wrongly deserved bad name for being mostly line-noise, in some circles and speaking of other languages if I were to write programs that look like brainfuck I would... program in brainfuck! But then joy the world: Perl 6 will have a grammar modifiable at runtime, so you will be free to happily brainfuck it!
|
|---|