sbohmann / mini

3 stars 0 forks source link

Special symbols and custom operators #31

Open sbohmann opened 4 years ago

sbohmann commented 4 years ago
self._call = fn[self]() { ... }
self._subscription = fn[self](x, y) { return ... }

self()
let n = self[3, 7]
sbohmann commented 4 years ago

The language may add special syntax for other '_' prefixed struct field names at any time.

sbohmann commented 4 years ago

_get_x and _set_x are likely next candidates for properties 🙂

sbohmann commented 4 years ago

Other / preexisting before special support uses of such names are always allowed. If e.g. a field named _call holds a boolean value instead of something callable (function, function pointer, or struct with callable _call field), an error will be thrown 🙂