← Back to team overview

ooc-dev team mailing list archive

Re: New ORC draft - Properties

 

Hey!

That sounds like a sane default, but then this should definitely be
documented in the ORC, I think.

I can't see either why one would like a func@ for a cover on pointers or a
regular func for a cover of non-pointer types. Really, is there any?

Btw, thanks for the amazing works these last days, Fred.

--
Amos Wenger (nddrylliog)

On Mon, May 3, 2010 at 2:14 AM, Friedrich Weber <
fred.reichbier@xxxxxxxxxxxxxx> wrote:

> 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
>
> _______________________________________________
> Mailing list: https://launchpad.net/~ooc-dev
> Post to     : ooc-dev@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~ooc-dev
> More help   : https://help.launchpad.net/ListHelp
>

References