[Openmcl-devel] slet/rlet with C functions?
pbpublist at comcast.net
Fri Aug 18 21:48:19 EDT 2006
> A call like (#_CGRectIntegral r2 r) has already been transformed (no
> later than read-time) so that the structure-return syntax has been
> replaced with the structure-pointer-as-first-argument and that
> argument's been made explicit. The expansion of the form returned by
> the reader macro is:
> (EXTERNAL-CALL "_CGRectIntegral" :ADDRESS R2 :<CGR>ECT R :VOID)
> and there isn't much information there that SLET could use to
> that the :ADDRESS R2 was introduced to to hide the structure return.
> If the introduction of that first argument was more explicit - maybe
> something like
> (EXTERNAL-CALL "_CGRectIntegral" (:ADDRESS-FOR-STRUCTURE-
> RETURN :<CGR>ECT) R2 :<CGR>ECT R :VOID)
> it'd be easier for SLET to see that a structure-return was
> involved. (The (:ADDRESS-FOR-STRUCTURE-RETURN :<CGR>ect) would
> presumably get macroexpanded
> down to something simpler if this wasn't inside an SLET.)
> Unless that sort of annotation happened, I'm not sure that SLET could
> reasonably recognize/provide sugar for structure-returning ff-calls.
Would an alternative be to provide an alternate call path (i.e.
rather than using the reader macro) using a function/macro like
(EXTERNAL-FUNCTION-CALL "CGRectIntegral" R)? Other than the
additional effort to produce, do you see any problems with the idea?
More information about the Openmcl-devel