operator names change in 0.2

51 views
Skip to first unread message

Stepan Koltsov

unread,
Aug 8, 2012, 7:41:07 AM8/8/12
to clay-l...@googlegroups.com
Hi, all.

Since 0.1 operator names changed in Clay: "+=" is now "+:" and "&" is "@". This is a bit unusual for people who came from C/C++ world. What is the motivation behind these changes?

--
Stepan Koltsov

Joe Groff

unread,
Aug 8, 2012, 10:33:23 AM8/8/12
to clay-l...@googlegroups.com
0.2 added Haskell-style user-defined operators, and `&` and `=` are
now available as operator characters. The motivation of renaming the
update and address syntax, which are primitive syntax, was to free up
those characters unambiguously. `@` is used as the address operator in
Pascal so fits somewhat with postfix `^` for dereference. `op:` isn't
great but seemed like the least bad option at the time.

-Joe

Stepan Koltsov

unread,
Aug 8, 2012, 11:16:10 AM8/8/12
to clay-l...@googlegroups.com


I see, += can be overloaded:

```
(+=)(a, b) { a +: b; }
```

Shouldn't be this and similar functions added to standard library?

--
Stepan Koltsov

Joe Groff

unread,
Aug 8, 2012, 5:31:20 PM8/8/12
to clay-l...@googlegroups.com
I don't see a need for both syntaxes. That would just be misleading.

-Joe
Reply all
Reply to author
Forward
0 new messages