[closer-devel] New warning "No generic function F present when encountering macroexpansion of defmethod."

Pascal Costanza pc at p-cos.net
Wed Nov 4 11:40:43 UTC 2009


On 4 Nov 2009, at 11:33, Leslie P. Polzer wrote:

> This newly introduced warning seems to be emitted every time
> when there's a defmethod that is not preceded by a defgeneric.
>
> But this is perfectly valid code and c2mop must[1] assume
> that the implicit gf is of class standard-generic-function
> without emitting a warning (which causes ASDF to stop everytime
> it is encountered).
>
> How about a compiler note instead?

Is there a portable way to emit compiler notes? I don't immediately  
find anything in the HyperSpec.

Another option is to emit the warning only when some global flag  
(*warn-on-defmethod-without-defgeneric*, or so) is true. Would that be  
acceptable? It should then be fine to use nil as the default.

The warning is important, IMHO, when you define your own generic  
function metaclasses...


Pascal

>
>  Leslie
>
>
> [1] http://www.lispworks.com/documentation/HyperSpec/Body/m_defmet.htm
>
> "If (fboundp function-name) is nil, a generic function is created
> with default values for the argument precedence order (each argument
> is more specific than the arguments to its right in the argument
> list), for the generic function class (the class standard-generic- 
> function),
> for the method class (the class standard-method), and for the method
> combination type (the standard method combination type)."
>
> -- 
> http://www.linkedin.com/in/polzer
>
>
> _______________________________________________
> closer-devel mailing list
> closer-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/closer-devel

-- 
Pascal Costanza, mailto:pc at p-cos.net, http://p-cos.net
Vrije Universiteit Brussel
Software Languages Lab
Pleinlaan 2, B-1050 Brussel, Belgium










More information about the closer-devel mailing list