# Verbing Properties

Jefferson M. Dubrule (Jefferson.M.Dubrule@dartmouth.edu)
Sun, 31 Mar 1996 11:27:36 PST

- Messages sorted by:[ date ][ thread ][ subject ][ author ]

    --- Adrian Irving-Beer wrote:
    >>*  Programmers get DIRECT control over who and what accesses their
    properties,
    >>   as such, it would not be hard to implement a $lock_utils-like system for
    >>   access priviledges.
    >
    >Ummm, make a verb that returns the value of the prop (which is !r) and
    >check there.

    This means there is a standard for 'wrapper' verbs.  Remember, programmers
    don't
    HAVE to use these wrappers, they are simply there if needed.
    #1._set_* and #1._get_* will simulate the behaviour of the current core.

    >>*  Properties need not return static values.  For
    >>   example #0.time  could return time()
    >
    >Why?  $time can just as easily be $time() and do the same thing.  And
    >there's time() :P

    This was merely an example, more useful things like, say, .title, which
    eliminates the need for the .name/:title() kludge, or a .description prop
    that includes .

    >>*  Property access could be logged.
    >
    >Again, using the verb-that-returns idea.
    >Just create some sort of :show_prop that shows it if the person has access.

    This basically does that, but from the programmer's point of view, it has the
    convenience of using "foo.bar = baz;" instead of foo:reset_bar(baz).  Also,
    under this system, LambdaCore could run with only the addition of the #1
    verbs.

    >>   *  'foo.bar' is replaced by 'foo:_get_bar()'
    >>   *  'foo.bar = quack' is replaced by 'foo:_set_bar(quack)'
    >>   *  property_info(foo, "bar") is replaced by
    >>      foo:_getinfo_bar() (returns {OWNER, PERMS})
    >>   *  set_property_info(foo, "bar", {OWNER, PERMS}) is replaced by
    >>      foo:_setinfo_bar({OWNER, PERMS}).
    >
    >Why not just call these themselves?

    So that LambdaCore will work.

    >This may seem like a nasty response - but I'm just not sure exactly why
    >you have to do this.  If you want verbs, use verbs.  If you want props,
    >use props.  If you want multiple inheritance props that only the
    >owner/co-owner(s) can see, make them !r with :show whatever verbs pointing
    >to them, which check for permissions (and possibly log).

    This basically does this while remaining Lambda-compatible.

    >Although I see there would be some use to this, I really think that a
    >system with programmers (and wizzen!) who understand the system and can
    >program using the right verbs etc is better then taking out the entire
    >property system.

    I'm not taking it out, it remains to hold data.  Just the access system
    has changed.

    >I'm pretty sure it would
    >be a BIG job to use verbs that tell you the props.

    Not at all, just a server hack and a few verbs on #1, and voila.

    -manta