I think it'd be better to have
with-foreign-object (var type &key (count 1)) &body body
or even
with-foreign-object (var type options) &body body
(where options are used as keyword arguments to foreign-alloc) or some such instead of
with-foreign-object (var type &optional (count 1)) &body body
given that we have
foreign-alloc type &key initial-element initial-contents (count 1)
Unless I'm thoroughly confused and with-foreign-object does not correspond to foreign-alloc (as with-open-file corresponds to open).
Andras
Andras Simon asimon@math.bme.hu writes:
with-foreign-object (var type options) &body body
(where options are used as keyword arguments to foreign-alloc) or some such instead of
You have a point there, with-foreign-object will be redesigned. :-)
I'm still thinking about playing with the idea of "foreign objects" that carry types, like Lispworks's pointers and CMUCL/SBCL's alien objects so this macro should change name.
with-dynamic-alloc? with-foreign-alloc? Hmm.. I like "with-dynamic-alloc" (IIRC, this name is probably similar to something Lispworks has, heh). Preferences/suggestions anyone?