Rethink Operators - make them more flexible with ability to define all properties of operators

88 views
Skip to first unread message

Suminda Dharmasena

unread,
May 10, 2016, 11:48:29 PM5/10/16
to dotty-internals
Hello,

Wondering if you can re think operators within Dotty where developer has finer control over all properties of an operator. I.e., can specify:
  • Symbol 
    • tertiary and higher arity the placement of operator symbols and operands
  • Position of the operator
    • prefix, 
    • infix or 
    • postfix
  • Associativity
  • Precedence
  • etc.
Perhaps you can borrow from Swift (https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/AdvancedOperators.html#//apple_ref/doc/uid/TP40014097-CH27-ID46) Only thing that swift does not define is how symbols interact with the arity beyond tertiary.

S

Andre van Delft

unread,
May 11, 2016, 8:06:17 AM5/11/16
to dotty-internals
I second this question.

Outside Scala there exist families of operators that may have any aritiy, while not being associative.
E.g. SubScript has a composition operator & for expressing parallel merge:

 break & x  & y   would be an empty process
[break & x] & y   would be equivalent to process y


Op woensdag 11 mei 2016 05:48:29 UTC+2 schreef Suminda Dharmasena:
Reply all
Reply to author
Forward
0 new messages