Hi,
I tried zip under pugs.
my @odd = (1, 3, 5, 7);
my @even = (2, 4, 6, 8);
my @bothA = zip @odd, @even;
print @bothA;
This code prints 12345678 as expected.
After parenthesis were used to group zip arguments, results changes
to 13572468. Is it right?
--
__
Is it possible to avoid significance of whitespaces?
I think, such an aspect of Perl 6 would be awful.
IB> Whitespace is significant:
IB> say zip(@odd, @even);
IB> say zip (@odd, @even);
--
___
Andrew, [EMAIL PROTEC
TTS> BTW, you didn't mean originally:
TTS>say zip (@odd), (@even); # prints 13572468 or 12345678?
That is exactly like with similar printing result of sub() call:
print sqrt (16), 5; # shout print 45.
--
___
Андр
LP> my $x = (1,2,3,4,5);
LP> Looks like an error more than anything else.
'Perl 6 and Parrot Essentials' think different ;-)
--
___
Andrew, [EMAIL PROTECTED]
___
> say $pair[0]; # a?
It looks like $pair is an arrayref while 'say ref $pair' tells 'Pair'.
And may I ask a relating question:
my $pair = ('name' => 'age');
say $pair{'name'}; # prints 'age'
say $pair['name']; # why prints 'name'? <== question
say $pair['age']; # prints 'name'
--
> Parrot 0.2.3 "Serenity" Released!
Possibly I'm growling again but I cannot run any Perl 6 programme with
new Parrots.
One-liner test.p6 containing 'print "perl 6";' is compiled to test.imc and
cause an error:
C:\parrot-0.2.3\languages\perl6>perl perl6 test.p6
error:imcc:syntax error, unexpect
Russian that were written on
real Perl 6 of that day, compiled into Parrot bytecode (.pbc) and run
on Apache under Parrot virtual machine. I cannot do the same with
today's instrumentary (or maybe I do not know how to?).
Th
say $value
}
debug 'me'
# perl 5
sub debug
{
print shift
}
debug 'me'
And finally, Perl is not an Assembler with one only instrucion per
line.
--
Andrew Shitov
__
[EMAIL PROTECTED] | http://www.shitov.ru
> JavaScript allows to omit semicolumn.
Sorry, s/lumn/lon/.
By the way, Perl also ignors semicolumn :-)
--
Andrew Shitov
__
[EMAIL PROTECTED] | http://www.shitov.ru
g ';' is not as simple as
<"\n" always means ";\n">. In mentioned JavaScript language one can
do this:
var
x
=
123
alert
(
x
)
and that will work!
";\n" can almost always be converted into "\n" but not vice versa.
--
Andrew Shitov
__
Moscow.pm also reminds that today (22 Apr) is the birthday of Lenin :-)
> March 2010 development release of Rakudo Perl #28 "Moscow".
--
Andrew Shitov
__
a...@shitov.ru | http://shitov.ru
Is it possible to get environment variables from perl6 programme? It
failes when I try to use perl5 hash %ENV. Thanks.
I tried this one-line programme for example:
my %e = %ENV;
and got this (parrot-0.0.13/perl are built under mandrake linux):
Global '_HV_ENV' not found
Error: '/parrot-0.0.13/parrot -r env.imc ' failed with exit code 1
Stopped at /parrot-0.0.13/languages/perl6/perl6 line 339
main::mydie(256,'/p
I think I have somesing missed: is it possible to open (that is read and
write) files in perl6 programmes? Those programmes that can be run under
current parrot release.
Thanks.
AT> oh my.. it seems to me, that Perl6 starts new age of ASCII-graphics. (not
AT> ASCII, really.. maybe Uni-graphics?)..
I hardly think Perl 6 should avoid any characters other than ASCII.
For example we have at least three Russian encodings and it is
acceptable only because we have no choice: we
DW> my $text is TextFile("/tmp/bar");
DW> $text = "hello"; # writes, truncates
DW> $text ~= ", world\n"; # appends
DW> $text.print "again\n"; # for old-times sake
Anyhow we still need $text.flush() or $text.close() methods.
--
_
16 matches
Mail list logo