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

Suggestion - rlet with clear



I wanted to throw out a suggestion for an optional argument to
the rlet macro which first clears any structures it allocates
with NewPtr (and before it makes any assignments to the fields).
I have several cases where I have to manually clear the fields.
I would try using the ccl::%clear-pointer or ccl::%clear-block but
there are two problems:

1) They are undocumented
2) I then have to add a statemtent to assign each field and lose the
   convenience of the rlet macro.

An example might be:

(rlet ((p :ParamBlockRec :clear t
          :ioNamePtr volName
          :ioVRefNum vRefNum))
  (#_SomeHFSCall pb)
  (pref pb :ParamBlockRec.ioResult))

            Jeffrey


======================================
Jeffrey Kane, MD
Kane Biomedical Systems
Boston, MA

Internet    jbk@world.std.com
Compuserve  74206,640
AppleLink   D0738

[Don't take life too seriously... it's not like anyone gets out of it alive.]