[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
conditional expr operator in Octave?
From: |
Jaroslav Hajek |
Subject: |
conditional expr operator in Octave? |
Date: |
Wed, 29 Jul 2009 11:18:05 +0200 |
hi,
is anyone (beside me) interested in supporting the ternary conditional
operator (?:) from C/C++ in Octave?
Is there any principal obstacle I don't see?
Does anyone (JWE?) have a good idea what would need to be done in
lex.l to allow the syntax to be recognized?
Although there are workarounds, like
cond ? true_val : false_val --> {false_val, true_val}{1+logical(cond))
or just use temporary variable + an if block, it seems to me that the
?: operator would improve readability in a number of cases.
cheers
--
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz
- conditional expr operator in Octave?,
Jaroslav Hajek <=