[mtasc] Nice to have: checking number of arguments
againstparameterlist
John Scott
John.W.Scott at rcn.com
Thu Sep 22 20:17:16 CEST 2005
----- Original Message -----
From: "Nicolas Cannasse" <ncannasse at motion-twin.com>
To: "MotionTwin ActionScript2 Compiler List" <mtasc at lists.motion-twin.com>
Sent: Thursday, September 22, 2005 3:05 AM
Subject: Re: [mtasc] Nice to have: checking number of arguments
againstparameterlist
> > Hello Nicholas and group,
> >
> > Here's something that would save me time, and I wonder if it would save
> > others time as well: a compiler option to tell me if I'm missing
arguments
> > to functions or if I'm supplying too many.
> >
> > I know it's legal and useful to have optional parameters, and to use the
> > arguments variable. But I also lose time when I refactor classes and
end
> up
> > with bad argument lists.
> >
> > Maybe an option could look like this:
> > -strictParams -allowVariable animals.Cat -allowVariable
> animals.Dog.setName
> > which means warn of non-matching argument lists for all functions except
> the
> > animals.Cat() constructor and the animals.Dog.setName() function.
>
> It's easy to implement, but it's not very easy to do correctly.
> One of the main reason is that a lot of MM API are designed to work with a
> variable number of parameters, so enabling it globaly might prevent you
from
> using some functionalities.
>
> Nicolas
>
Hmmm.... how about if it checked just user-defined functions, perhaps just
the functions inside packages specified by the MTASC -pack flag?
More information about the mtasc
mailing list