I think it'd be nice if I could use ? : operator in eScript, i think this operator will save a lot of lines of code and if/else lines.
It isnt hard write if/else lines, but when you do this everytime, you think that it could be good to have something to 'compress it'.
For who doesnt know ? : operator, i'll explain:
Code: Select all
return (1 == 2 ? "hi, 1 is equal to 2" : "no no no");
so something like this
Code: Select all
user := there is a user flag? 1: 0;
Code: Select all
if there is a user flag
user equal to 1
else
user equal to 0
endif
this feature is used in languages like C, C++, JavaScript, and others, and it comes from functional programming, if you have programmed in Scheme or Common Lisp you've seen something like (if (pred) (true action) (false action)) and, IMO, it's a lot practical, for me eScript could be 100% functional programming