in reply to Re: SOP6W
in thread SOP6W
Since Perl6 will treat any code as "old code" unless it starts with one of the new keywords...That's not quite right. Perl 6 will treat code as Perl 5 code if (and only if) the first executable line in the program is a package statement.
And, yes, we're going to need some way to distinguish Perl 6 code from Perl 5 code. Because there are a few simple cases that mean completely different things in Perl 5 and Perl 6. For example:
print $hash{bang};
In Perl 5 that means: print the value of the entry of %hash whose key is "bang".
In Perl 6 that means: print the value of the entry of the hash referred to by $hash whose key is "bang".
How could we distinguish Perl 5 and Perl 6 code? I'd suggest we add a <code6> flag and have the monastery render code marked as Perl 6 in a different font. For example, the submission:
We're going to need some way to distinguish: <code> print $hash{bang}; # entry 'bang' of hash %hash </code> from: <code6> print $hash{bang}; # entry 'bang' of hash %{$hash} </code6>might be rendered:
We're going to need some way to distinguish:print $hash{bang}; # entry 'bang' of hash %hashfrom:print $hash{bang}; # entry 'bang' of hash %{$hash}
Note: I've used a red-shift/blue-shift visual pun here, but in reality we'd need to use distinct font faces -- perhaps serif for Perl 5 and sans-serif for Perl 6 -- so as not to disadvantage those with impaired colour vision.
Using a separate mark-up tag would also support those monks who (through necessity or by choice) use a non-visual browser.
|
---|
Replies are listed 'Best First'. | |
---|---|
(Re:)+ SOP6W
by rir (Vicar) on Apr 27, 2003 at 04:29 UTC | |
by TheDamian (Vicar) on Apr 27, 2003 at 21:36 UTC | |
by rir (Vicar) on Apr 28, 2003 at 02:08 UTC | |
Re: Re: Re: SOP6W
by The Mad Hatter (Priest) on Apr 25, 2003 at 22:29 UTC | |
by TheDamian (Vicar) on Apr 25, 2003 at 23:54 UTC | |
by runrig (Abbot) on Apr 25, 2003 at 23:31 UTC | |
Re: Re: Re: SOP6W
by diotalevi (Canon) on Apr 28, 2003 at 02:20 UTC | |
by TheDamian (Vicar) on Apr 28, 2003 at 03:59 UTC |