develooper Front page | perl.perl6.language | Postings from May 2001

Re: what I meant about hungarian notation

Thread Previous | Thread Next
From:
Eric Roode
Date:
May 9, 2001 07:09
Subject:
Re: what I meant about hungarian notation
Message ID:
200105091409.KAA23994@verne.myxa.com
[on David Nicol's thought that maybe references should be treated
differently than other scalar data]
>
>But $, @, and % indicate data organization, not type...
>

Perhaps it's a mistake that Perl treats numbers and strings the
same. Perhaps "$" should be broken out into two prefixes: S for
strings, and | for numbers. Use $ when it's unknown what type
a variable will hold, or for a variable that can hold either type.

    Sfoo = 'a string';
    |bar = 'a number';
    $baz = Sfoo || |bar;

And references are right out.


;-)
 ----------------------------------------------------------------------
 Eric J. Roode                                            eric@myxa.com
 Senior Software Engineer, Myxa Corporation


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About