Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

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

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


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

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?


Comment on Re^5: what would you like to see in perl5.12?
Download Code
Re^6: what would you like to see in perl5.12?
by blazar (Canon) on Aug 20, 2007 at 20:06 UTC

    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.

        Yeah, it doesn't have pointers, it has references. Is the difference between the two relevant? I think not!

        In this context, it is. Because nobody is proposing to (to paraphrase your previous example) have function signatures for e.g. references of references of arrays of Int. That model just doesn't fit in Perl because you don't use references for the same purposes that you do in C. FWIW they will even be more transparent in Perl 6.

        sub neuter (Dog $bobby is rw) { ... }
Re^6: what would you like to see in perl5.12?
by moritz (Cardinal) on Aug 20, 2007 at 20:34 UTC
    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.

        In Perl 6 you can put the type either before or after, taking end-weight into account. So
        my Int @array;
        is equivalent to
        my @array of Int;
        which in turn is really short for
        my @array is Array of Int;
        so it's easy to see how you can end up with cool things like
        my @array of Hash of Tree of Int;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2014-10-02 00:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (41 votes), past polls