From: Douglas K. <do...@go...> - 2014-03-16 18:35:11
|
COMPILE-FILE on the following example correctly signals a style-warning about a call to the structure constructor but only because of the gratuitous/silly (in this case) 'incf' of unused variable X. Absent that - and/or anything else that would foil the fopcompiler - such that the form becomes fopcompilable, no warning is emitted about the incorrect call. Which of the following seems the least slippery slope to go down to fix this? 1. Concoct some arguments acceptable to 'valid-fun-use' (i.e. synthesize a COMBINATION and LVARS of type *universal-type*) so that the fopcompiler can call valid-fun-use. This seems hard to get right because *compiler-error-context* would be lying, etc, etc. 2. Factor out the argument count checks into a separate function that can do something reasonable for the fopcompiler, and 2a. have the fopcompiler signal the warning 2a. have fopcompilable-p return nil so that it is forced to go through the proper mechanism (defstruct (foo (:constructor make-foo (slot))) slot) (defvar *foo*) (let ((x 0)) (incf x) (setq *foo* (make-foo))) |