[Prev][Next][Index][Thread]

Re: Dylan & MOP



Bruce Hoult wrote:
>
> I kind of ignored the huge flood of messages a few days ago, so I may be
> confused about what you wanted to do...

Yeah, the flood was annoying. Particularly so to me since I don't
usually post much here, and the flood coincided with my unusually high
level of posting...

> I think I saw something about that you wanted to be able to write
> 'myRecord.salary' and have a "no applicable method" handler basically
> translate this into something like 'myRecord["salary"]'.

That's more or less how the Objective-C EOF implementation does it, but
I was pretty sure _that_ couldn't be done in Dylan, and that if it could
it would be a nasty and ill-fitting kludge.

> There is, of course, no way to do this in Dylan without having *SOME*
> generic function called "salary" already in the program.

Ah, well.

> My take on it is that if your program is so static that you are in a
> position to write 'myTable.salary' in the first place -- i.e. the name of
> the field is known to you when you write the code, not obtained from a
> data dictionary or something at runtime -- then you can equally afford to
> put some minimal declaration of the field in the program as well.  

That's more or less my conclusion. Although I would still rather have no
per-entity code just to provide accessors this, in Dylan, is not
compatible with other goals.

My message on Dylan & object/relational mapping goes over this, along
with the competing/incompatible goals I had, so I won't repeat that
here.



References: