Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

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

by moritz (Cardinal)
on Aug 20, 2007 at 12:43 UTC ( #633791=note: print w/ replies, xml ) Need Help??

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

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)

Comment on Re^4: what would you like to see in perl5.12?
Select or Download Code
Replies are listed 'Best First'.
Re^5: what would you like to see in perl5.12?
by Jenda (Abbot) on Aug 20, 2007 at 14:39 UTC

    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?

      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.
        file_status (filedesc: INTEGER): INTEGER is ...
        ... looks to me like the types are written after the typed variables/parameters. Hence ... looks like it's not using prefix types. All I'm trying to say is that we should look at C and NOT repeat it's seemingly bright ideat to put the type before the variable ending up putting the type information all around the variable.

      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.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2015-11-25 04:33 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (670 votes), past polls