From: James L. <ja...@mi...> - 2001-12-20 08:28:05
|
Mattia, > > Yes, I think a Perl-implemented GenericValidator can just take the > > address of the variable to/from which to deposit/get data, and can > > handle it appropriately internally by checking the reference type. > the trouble is that in perl you can only have scalar references, > so you need a flag to tell the class you want a number/string/bool > transferred Good point. I think I'll use the 'flag' approach. This has approach has been used elsewhere (in Win32::API, I think), so I'll try to be consistent with other modules. =20 > > > 2 - there is no NumericValidator ( or whatever you want ... > the one I wrote in C++ a year ago could: > * check that the number is aproper integer number > ( if you passed a int/long pointer ) > * check that the number is a proper float number > ( if you passed a float/double pointer ) > * optionally check that the number is in some > range Sounds reasonable for a first cut. James |