← Back to team overview

ooc-dev team mailing list archive

Re: New ORC draft - Properties


Hi all,

looks good to me, too, thanks for this!

Some things:

> name: String {
>     set
>     get
> }
> // The above example is exactly equivalent to this:
> name: String

IMHO the variable might be equivalent on the ooc level, but not on the C
level: The property would create a setter and a getter method, which
would create ..._setName and ..._getName functions on the C level. This
means: These two examples generate different C APIs.

Also, I just want to note that this getter / setter syntax does not
conform to our original `name: Type` or `name: func ...` syntax - we're
missing the colon. But I see no better solution, since we couldn't use
empty getters / setters with the colon syntax. So, +1 for keeping your
suggested syntax :)

I think allowing multiple values for setters is an interesting idea, but
I'm not sure if we should do this. `1, 2` is not an expression in
"normal" ooc, making it an expression that is only used in the context
of properties would lead to confusion IMHO.

What Do You Think? ;)

Follow ups