[pro] style question about types, coercion, expectations for function parameters
Matthew Mondor
mm_lists at pulsar-zone.net
Fri Jun 1 00:33:09 UTC 2012
On Thu, 31 May 2012 21:22:01 +0200
"Pascal J. Bourguignon" <pjb at informatimago.com> wrote:
> Yes, it's what's usually called a "designator", specifically, an email
> designator. CL itself defines and uses a few designator types (string
> designators, package designators, pathname designators, list
> designators, etc).
Designators are an interesting and useful concept indeed.
If creating new ones, some common sense might be required to decide how
to "resolve" to the final object, and this might need to be documented
as well.
For instance, I noticed that an implementation given a symbol as
function designator (i.e. 'foo vs #'foo) might use SYMBOL-FUNCTION at
run-time, while its optimizing compiler might generate a direct call to
the function for #'foo if it considers this safe in a whole-file
compile. In the latter case redefining dynamically FOO after loading
the module might still cause existing non-recompiled callers to call an
older version of the function #'foo, but correctly call the new
instance for 'foo, resolving the function object from the symbol at
run-time. Thus, the symbol function designator was not resolved at
compile-time.
The hyperspec seems unclear about if designators should always resolve
at run-time, though, and it may be tempting to resolve some at
compile-time... But it's clear that some shouldn't.
--
Matt
More information about the pro
mailing list