On Tue, 1 Aug 2000, Tony Payne wrote:
>
> > Isn't this almost a case for revamping the prototyping system? You can
> > define your API in terms the current perl variables (nothing in the above
> > suggests that integers versus floats is the main problem) and have a
> > prototype system that actually allows you to specify that "argument 3
> > should be an array with 5 entries", "argument 2 must be a hash reference"
> > (allowing you to pass in a scalar containing a hash ref as well as a
> > hash). Would that cover what you want?
>
> It would be a start. It certainly would address my example, especially if
> you could specify that the 5th argument be a referenced blessed into the
> Foo::Bar class. However, if you're going to go that far, you might as well
> allow for real typed vars.
>
If by "typing" we actually mean adding the ability to check that arguments
are the correct object type (ie the correct isa relationship) then I would
be all for it. I do spend quite a lot of time adding argument checking to
my classes (I've got a 25000 line extensible data reduction pipeline
written in perl and I try to make sure that arguments are sane) and do
occasionally pine for a better prototype system [unfortunately I don't
have time today to write an RFC on the issue :-( ].
I'm pretty sure that I don't want to have to start worrying about
distinctions between integers, floats and doubles though. Scalars, hashes
arrays and blessed objects provide more than enough breadth for me.
--
Tim Jenness
JCMT software engineer/Support scientist
http://www.jach.hawaii.edu/~timj