Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^3: what would you like to see in perl5.12?

by Jenda (Abbot)
on Aug 20, 2007 at 12:36 UTC ( #633790=note: print w/ replies, xml ) Need Help??


in reply to Re^2: what would you like to see in perl5.12?
in thread what would you like to see in perl5.12?

Why would anyone want to repeat the failed experiment of prefix types?  sub foo( Str $ref->[]{}, Int @arr[], Str $fun(Int bogus, Real otherbogus)) anyone?


Comment on Re^3: what would you like to see in perl5.12?
Download Code
Re^4: what would you like to see in perl5.12?
by moritz (Cardinal) on Aug 20, 2007 at 12:43 UTC
    What makes you think that prefix types are a "failed experiment"?

    If you are talking about prototypes, that's hardly the same.

    Many staticly typed languages use it successfully, and if it stays optional I don't see a point against it.

    If you don't like the notation, you are of course free to omit the types - that's why I wrote optional static typing.

    BTW. I guess it would be Int @arr instead of Int @arr[].

    (Update: fixed thinko spotted by holli)

      Some programming languages use it with mixed success. With success for the simple cases of int and char variables, and utter failure for the more complex cases of (horrors) pointers to functions returning pointers or functions receiving pointers to functions. char *(*)foo(...)? Feeling well?

        But Perl, either in its 5 or 6 incarnation is not going to have pointers anyway. Also, in 6 the static type system is optional, and in 5, should it ever be brought to it, it would too.

        The fact that there is a bad example doesn't mean it can't be done right. Take a look at Eiffel for an example of simple, readable type declarations.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (12)
As of 2014-12-19 17:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (90 votes), past polls