Re: [PW-dev] parameter names (dash, underscore, none)
Status: Alpha
Brought to you by:
spadkins
|
From: James G S. <JG...@TA...> - 2001-06-19 16:30:03
|
Stephen Adkins <ste...@of...> wrote:
>However, this presents a stylistic dilemma with parameter names.
>If I use "border-style", the syntax would be
>
>$last_name = $wc->widget(
> -border-style => "solid",
>)->html();
>
>However, this fails because "-border-style" cannot be a bareword.
>I have so far opted to changed dashes in attribute names to underscores.
>This is the first option.
>
>Alternatively, the second option is to remove the dash like so.
>
>$last_name = $wc->widget(
> -borderstyle => "solid",
>)->html();
>
>Alternatively, the third (and least attractive option to me) is to
>require the programmer to quote the named parameter like so.
>
>$last_name = $wc->widget(
> "-border-style" => "solid",
>)->html();
>
>I have chosen option #1.
>How do you all feel?
It would be nice to make the translation easy on the code which means choosing
a substitute character... Perhaps a period `.' ?
$last_name = $wc -> widget(
-border.style => "solid",
) -> html();
--
James Smith <JG...@TA...>, 979-862-3725
Texas A&M CIS Operating Systems Group, Unix
|