This is the mail archive of the guile@sources.redhat.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Unifying properties


Marius Vollmer writes:

   So, we should probably design some helper functions for doing the job
   of properties, but in a more modern way.  What about:

     Function: make-object-property

       Return a new `procedure with setter' P that can be used to attach
       a property to objects.  When calling P as

	   (set! (P obj) val)

       where `obj' is any kind of object, it attaches `val' to `obj' in
       such a way that it can be retrieved by calling P as

	   (P obj)

I think this is a great idea, because

- it places property "names" under the same module- or namespace-based
  control as all other names in Guile

- it even allows attaching properties to immediate values like
  integers (which I presume is currently impossible - correct me if
  I'm wrong).

Does make-object-property need to take argument(s) indicating the
desired equality level, or does it assume always eq? ?

Regards,

	Neil

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]