← Back to team overview

ooc-dev team mailing list archive

Re: New ORC draft - Properties

 

Hi there,

I'm currently trying to give static properties some more love, they're
still a bit hacky :-)

I also just made a change on cover properties:
http://github.com/nddrylliog/rock/commit/580c5e5c1dce78fd838c34e6a0179ed134c8f9a1

Before this change, all getters and setters of properties on covers were
realized as func@, i.e. `this` was passed by reference (so a pointer to
the value was passed instead of the value itself). This makes sense for
covers from primitive types and structs: With call-by-value, `this`
would get copied on each getter or setter call, so getter and setter
calls would have no effect on the actual value.

However, with covers from pointer types, this isn't really needed and
doesn't conform to the normal API scheme (having a pointer to an opaque
struct as `this` pointer, passing this pointer to all "methods" as first
argument (also to property getters/setters)) So with the above commit, I
made property getters/setters of covers from pointer types use `func`
instead of `func@`. This makes more sense.

Still I'm not sure if this should really be done implicitly. I can't
think of any situations where you'd need `func` getters/setters for
non-pointer values and not many situations where you'd need `func@`
getters/setters for pointer values, but there are crazy ideas out there
for sure. ;-)

So, do you people think this choice should be done explicitly via a
`set@/get@` or similar syntax? Please tell me everything!

Good night,

Friedrich



Follow ups

References