At 11:51 PM 9/19/2001 -0400, Sterling Hughes wrote:
>On Wed, 19 Sep 2001, Dan Sugalski wrote:
>
> > At 05:39 PM 9/19/2001 -0700, Paul Prescod wrote:
> > >If one presumes that Parrot is going to be so much nicer than the
> > >current Perl internals that many more people will be interested in it,
> > >then maybe it makes sense to make names as readable as possible, even if
> > >they are not what Perl historically used.
> > >
> > >I propose, for example, "intval" for IV and "floatval" for NV.
> >
> > The only problem with those is they're so long, and I'm lazy. :)
> >
>     I get the fact that your joking, still... (to respond to the initial
>     message more likely ;)))
>
>     I'm for the idea of being quite explicit (but not overly explicit :), 
> otherwise when it comes to new people learning the source code, it makes 
> the bar considerably higher, and naturally all lazy programmers prefer 
> other people to do the work for them :)

Everyone else has gone rather wackily odd here, but I really do need to 
point out (not necessarily to you) that the IV/NV thing are types, not 
variable names, and there should be very few uses of them outside variable 
declarations.

>     For example, which of the following two might make sense to the "new" 
> programmer:
>
>     char *name = SvPV(p1);
>
>     or:
>
>     char *name = SV_STRVAL(p1);

They both suck. :)

It'll probably be more like:

    void *name = Get_String_Data(p1, PARROT_UNICODE, encoding);

And yes, the void * is deliberate (though subject to change) since I'm 
being generic--how do you know that you're getting back a series of bytes? 
encoding might have the UTF_32 constant in it.

For just fetching the abstract string structure it'd be more like:

   Parrot_string *name = Get_String(p1);

FWIW, anyone using char * in the Parrot source in areas that do not 
directly involve interface with the external world (system calls, other 
people's libraries) will find themselves on the other end of the Big Mallet 
of Programmer Chastisement. :-)

                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to