Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: RFC - Parameter Objects

by chromatic (Archbishop)
on May 14, 2003 at 18:29 UTC ( [id://258194]=note: print w/replies, xml ) Need Help??


in reply to RFC - Parameter Objects

Interesting. I've often thought that one failing of type checking parameter lists is that they can only tell you if a parameter fits in a type hierarchy somehow, not if the value of the parameter is actually valid.

Replies are listed 'Best First'.
Re: Re: RFC - Parameter Objects
by Ovid (Cardinal) on May 14, 2003 at 18:42 UTC

    I actually got that idea from my CSV Database Validation program. For that, you can specify a regular expression as a "data type" for a database field. In thinking about this more, I realized that by arbitrarily passing in subroutines to validation routines, rather than try to hard-code methods that cover every possible case, I can let the programmer specify those in advance via sub references. It seems like a much more powerful system, the code is shorter, and you only build what you need.

    I do agree with you about the failings of parameter lists. Design by Contract seems to be one attempt to get around this weakness.

    Cheers,
    Ovid

    New address of my CGI Course.
    Silence is Evil (feel free to copy and distribute widely - note copyright text)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://258194]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-06-14 11:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.