[Openmcl-devel] pref with vriable field name

Taoufik Dachraoui taoufik at mazeboard.com
Sun Jan 24 12:17:59 PST 2010


Hi,

I could not find a way to write the following:

(defmacro f (ptr struct field val)
   `(setf (pref ,ptr ,type.,field) ,val))

> (f ptr :<XC>olor pixel 0)
> (f ptr :<XC>olor flag 0)
....

Normally the accessor of pref is a concatenation of the structure
type and field names separated by a dot.

In my case, for a given structure type (eg. <XC>olor) I would like
to set a given field of <XC>olor to a given value (the field name is
not hardcoded).

Thank you for your help

Kind regards
Taoufik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20100124/a754b250/attachment.htm>


More information about the Openmcl-devel mailing list