Browse source

Changelog

Query
From:
To:
Branch:
Path:
Message:
BugID:
User: +
Format:
: 2 checkins (+1122/-366) by Per Hedbor <ph@opera.com> Lines added/removed recently

Tuesday 02 October 2012

2012-10-02 12:07:44 (1 decade ago) by Per Hedbor <ph@opera.com>

Added a two new operators: "?->" and "?:"

?-> can be used to index something that is either indexable or null.
?: is an alias for ||

Very useful for things like:

C c = a && a->b && a->b->c;

which can now be rewritten as

C c = a?->b?->c;

The code in language.yacc also supports ?. and ?[], but there are
syntax conflicts with ?: for those:

?. conflicts with expr?.Module:...
?[] conflicts wtih expr?[softcast]:...

?: was added mostly to be compatible with other 'modern' C-like
languages.

[permalink]

Bugs? Suggestions?