OEP

177

Title

Allow prefix operator calls

Summary

Allow operators to be called in their quoted form

Owner

Neil Brown <nccb2@kent.ac.uk>

Status

Proposed

Date-Proposed

2009-04-05

Keywords

operators

Currently, user-defined operators can be defined as:

COMPLEX FUNCTION "+"(COMPLEX a, COMPLEX b)
  ...
:

They are then called as:

COMPLEX a, b, c:
a := b + c

A possibility (although Adam is often pointing out that just because something fits, doesn't mean we should do it) is to allow the operators to be called in their original form, i.e. prefix:

COMPLEX a, b, c:
a := "+"(b, c)

I don't think that would be too ambiguous, as I don't think a string literal can have a type suffix (in the case of a unary operator). This doesn't have much benefit for now, but if higher-order functions were allowed, it could come in handy. Generally though, I don't like the quoted syntax for operators -- perhaps Haskell's bracketing notation would be nicer?

OEP/177 (last edited 2009-04-05 22:48:15 by nccb2)