<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Oh, yeah, sorry, didn't mean to get so far OT<br><br>Sent from my iPhone</div><div><br>On Oct 27, 2016, at 05:20, Jay Abbott &lt;<a href="mailto:jay@abbott.me.uk">jay@abbott.me.uk</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr"><div>David,<br><br></div>You make some good points in favour of explicit support for user-defined ternary operators. You're right that it's a bit clunky without. Probably a discussion for another thread though, and additive so not for phase 1. But perhaps worth a proposal for phase 2?<br></div><br><div class="gmail_quote"><div dir="ltr">On Thu, 27 Oct 2016 at 09:23 David Sweeris &lt;<a href="mailto:davesweeris@mac.com">davesweeris@mac.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">On Oct 26, 2016, at 21:29, Jay Abbott &lt;<a href="mailto:jay@abbott.me.uk" class="gmail_msg" target="_blank">jay@abbott.me.uk</a>&gt; wrote:<br class="gmail_msg"><br class="gmail_msg"></div><blockquote type="cite" class="gmail_msg"><div class="gmail_msg"><div dir="ltr" class="gmail_msg"><div class="m_6260536766192108666markdown-here-wrapper gmail_msg"><p style="margin:0px 0px 1.2em!important" class="gmail_msg">David, you can use two binary operators (or overload the same one twice if you want) to create syntax that behaves like a ternary operator.</p></div></div>
</div></blockquote></div><div dir="auto" class="gmail_msg">Oh I know, it's just kinda clunky and inefficient sometimes, if you need to wrap a value in a struct or something simply to avoid ambiguity or enforce the correct syntax. It's not quite the same thing a ternary operator, but at one point I'd added `|` as both pre and postfix operators to allow code like "let y = |x|". The left `|` had to return a `_PartialAbsValueOp` and the right one had to take the same to invalidate the "let y = |x" or "let y = x|" syntax, one of which would've otherwise worked (depending on which op actually called "abs()").<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I should've been clearer that I was talking about support for "free form" operators in general, including ternary ops, so that we don't have to fake them by declaring some # of traditional pre/in/postfix operators which all then have to work together (possibly exclusively, depending on the desired syntax), and might have to pass wrapper types around solely to help explain your syntax to the compiler.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Thanks for pointing it out, though. That's an easy trick to forget about.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">- Dave Sweeris</div></div></blockquote></div>
</div></blockquote></body></html>