Re: PROTOPROPOSAL FOR NEW BACKSLASH was Re: implied pascal-like "with" or "express"

[email protected] (Markus Peter)
Newsgroups perl.perl6.language.objects
Message-ID <978908.3175908009@[192.168.1.6]>
--On 18.08.2000 14:36 Uhr -0700 David L. Nicol wrote:
> How about backslash, after the type-qualifier?
>
> use %record{
>
>         $\interest_earned += $\balance * $\rate_daily;
> };

I don't really like having backslashes in front of ordinary characters 
anywhere except when I mean them :-) (\n, \t etc.)

In most cases where you'd want a with-type construct you know exactly which 
keys there'll be, so maybe simply adding the keys as lexical variables to 
the block would work:

my $interest_earned=0;

use %record {
   $interest_earned+=$balance*$rate_daily;
};

Yes, this _might_ interfere with already existing variables but I so far 
did not encounter lots of cases where I'd want to use a with block with 
hashes where I'm not sure which keys it might contain...

(sorry if this was brought up already - I'm new to the lists and tried 
scanning perl-language but gave up after some time... )

-- 
Markus Peter - SPiN GmbH
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.