Similar to bug #11004, it would be great if we had some syntax to tolerate compile-time errors associated with $variable evaluation. This would allow us to get rid of several kernel version checks and check for $variable existence instead. We could then turn something like this (from syscall.poll): ==== %( kernel_vr > "2.6.15-1.1831" %? timeout = $timeout_msecs %: timeout = $timeout %) ==== into something like this: ==== timeout = @catch($timeout_msecs, $timeout) ==== Where the syntax is something like '@catch($expr, $backup-expr)'.
Further discussion seems to favor this syntax: @defined($expression) -- integer-valued, evaluated at translation time This requires const-propagated conditionals (if else AND ? :) as in println (@defined($foo) ? $foo : $bar) if (@defined($bar)) { println($bar) }
basic implementation complete, bug #11326 to handle an edge case