guile-devel
[Top][All Lists]
Advanced

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

Warning for arity mismatches


From: Ludovic Courtès
Subject: Warning for arity mismatches
Date: Sat, 07 Nov 2009 19:38:01 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Hello!

There’s a new warning available, ‘-Warity-mismatch’, which warns about
wrong arguments counts, etc.  It currently lacks support for keyword
arguments, which is why it’s not ready yet to compile Guile itself (it
produces erroneous warnings for procedures with keyword arguments.)

I think some of these warnings should really be errors, when there’s
undoubtedly a wrong number of arguments, as in:

  (let ((f (lambda (x) x)))
    (f 1 2 3))

What do you think?

Actually, the tree-il->glil pass surely does a significant part of what
‘arity-mismatch-analysis’ does, and I wonder whether/how this could be
factorized.  For example, tree-il->glil must already diagnose the
problem in the example above.  Andy?

Thanks,
Ludo’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]