On Fri, 2005-04-15 at 18:04 +0200, Juerd wrote:
> Aaron Sherman skribis 2005-04-15 11:45 (-0400):
> > What I'd really like to say is:
> >     throwawaytmpvar $sql = q{...};
> >     throwawaytmpvar $sql = q{...};
> 
> I like the idea and propose "a", aliased "an" for this.

Too short. Having such a short identifier does two things:

      * Robs that identifier from any future possible use
      * Creates incentive to use this over "my"

You want there to be a general tendency to use "my" first. If I were to
choose a word, it would be "temp" (which I think already exists, though
I forget what it does vs "my"), or "let" (to correspond with its use in
rules).

> > It should probably be illegal to:
> >     throwawaytmpvar $sql = q{...};
> >     my $sql = q{...}; # Error: temporary became normal lexical
> > or for that matter even give it a new type:
> >     throwawaytmpvar int $i = 0;
> >     throwawaytmpvar str $i = "oops"; # Error: redefinition of type
> 
> Giving it a new type should be valid. That is, I think the variable is
> more useful if the old one is thrown away and a new one is created. This
> can perhaps be optimized by re-using the same thing if it has no
> external references anymore.

The reason I didn't want a new type to be valid was as an extra
precaution against problematic boilerplating. It's a minor thing, and
probably not that big a deal.


Reply via email to