Maybe it was Dave Long that pointed out that lerp is a generalization of the conditional ternary operator. When the condition is 0, it returns the from-point, and when it's 1, it returns the to-point, but if you generalize it to the whole real number line, you lose nothing semantically except for short-circuiting. Lerp is a pretty common <i>function</i> in graphics—the simplest way to understand Bézier splines is as recursive lerping—but for whatever reason it generally isn't written as an infix operator, which seems to be what Hillel is looking for here.<p>I think that Hillel's criterion that the ternary operator "can't be decomposed into two sequential binary operators" is too demanding. He says, "<i>bool ? x</i> makes no sense on its own, nor does <i>x : y</i>". Well, that's just because C's grammar is written such that they won't parse. If you extend the grammar to permit them, it's not very hard to extend the semantics as well. For example, you could permit every expression to either succeed, yielding a value, or fail, yielding no value; languages that work in something like this way include regular expressions, META-II, Icon, Unicon, and Prolog, though each of them deviates from it in detail. Then, to get the C/JS semantics, <i>bool ? x</i> succeeds with the value of <i>x</i> if <i>bool</i> is true, or fails if <i>bool</i> is false, and <i>x : y</i> succeeds with the value of <i>x</i> if <i>x</i> succeeds, but if <i>x</i> fails, does <i>y</i>.<p>You could model the exception mechanism in languages with exceptions as failing to return a value, in which case <i>x : y</i> ends up being a general-purpose exception-handling mechanism, so you can say something like <i>total[k] = (total[k] : 0) + 1</i> to increment a possibly-nonexistent hash key. Mark Lentczner's language Wheat has an operator like this, spelled <i>!!</i>, which I stole for my own language Bicicleta.<p>(That's assuming you parse <i>bool ? x : y</i> as <i>(bool ? x) : y</i>. You can also invent semantics that give you the right behavior with the parsing <i>bool ? (x : y)</i> but the ones that occur to me seem less appealing.)<p>Similarly for Elixir's stepped range 1..10//2. Hillel says, "This isn't decomposable into two binary ops because you can't assign the range to a value and then step the value later." Well, maybe not (I don't know Elixir), but it seems clear enough what <i>r//2</i> should do if <i>r</i> is the name of a range value: it should produce a new range stepping either by 2 or by twice the previous step.<p>C++ does something like this for Hillel's (or munificent's) example of <i>a[b] = c</i>: the expression <i>a[b]</i> evaluates to a reference, which in rvalue context decays to an ordinary value, but which can indeed be assigned to a variable. Unfortunately, C++'s reference semantics are somewhat weak, with the consequence that actually overriding <i>operator[]</i> in C++ to return a reference is pretty bug-prone, because you can autovivify things you didn't want to autovivify.<p>By Hillel's apparent syntactic and decomposability criteria, I think every single two-argument method in Smalltalk is a "ternary operator". <i>1 to: anInt do: [ :i | r := ( r * self ) ]</i>, for example, or <i>arr at: i put: v</i>. As he sort of points out, Objective-C inherited this from its Smalltalk roots, but he sort of throws up his hands at it.