raku
Is it a design flaw that Perl subs aren't lexically scoped?
{ sub a { print 1; } } a; A bug,is it? a should not be available from outside. Does it work in Perl 6*? * Sorry I don\'t have installed 开发者_如何学编程it yet.Are you asking why the sub is visib[详细]
2023-04-07 12:35 分类:问答Perl6 operator question
I was looking at the silly/cute/brilliant \"sleep sort\" that seems to have originated over at 4chan. To sort an array of ints, the idea is roughly[详细]
2023-03-14 14:59 分类:问答for with multiple arrays
In Scheme you can iterate over multiple lists in with for-each: > (for-each (lambda (a b) (display (+ a b)) (newline)) \'(10 20 30) \'(1 2 3))[详细]
2023-03-12 01:19 分类:问答Is there an equivalent of Bottle or Sinatra for Perl6 or Perl5? [closed]
Closed. This question is seeking recommendations fo开发者_StackOverflowr books, tools, software libraries, and more. It does not meet Stack Overflow guidelines guidelines. It is not currently acceptin[详细]
2023-03-07 16:32 分类:问答Can only 'perl6' parse Perl 6?
There\'s that (relatively) well known Perl axiom, \"Only perl can parse Perl.\" I\'m wondering, will that remain true for Perl 6?[详细]
2023-03-03 04:55 分类:问答perl6/rakudo: Problem with writing on the loop-variable
#!perl6 use v6; my $longest = 3; my @list = <a b c d e f>; for @list -> $element is rw { $element = sprintf \"%*.*s\", $longest, $longest, $element;[详细]
2023-02-12 09:33 分类:问答perl6/rakudo: How can I change the data-type of a variable?
#!perl6 use v6; my $m = 70; my $n = 30; ( $m div $n ).say; The first examples works, but the second doesn\'t. I suppose it\'s because in the second example the variable-values are strings. If my g[详细]
2023-02-12 05:25 分类:问答perl6/rakudo: How could I disable autoflush?
I tried this, but it didn\'t开发者_Go百科 work: $*OUT.autoflush( 0 ); $*OUT.autoflush = False should disable it, and it runs without error, but it seems that parrot\'s IO still flushes automatically.[详细]
2023-02-12 00:06 分类:问答How to get the Terminalsize with perl6/rakudo?
Is there for perl6 already something to get the Terminalsize? ( for example like the 开发者_JAVA百科perl5 \"Term::ReadKey::GetTerminalSize\" );I\'m not aware of a direct method, but parsing qx/resize[详细]
2023-02-11 07:44 分类:问答perl6/rakudo: dereferencing-question
#!perl6 use v6; my $list = \'a\' .. \'f\'; sub my_function( $list ) { for ^$list.elems -> $e { $li开发者_如何学Gost[$e].say;[详细]
2023-02-10 22:00 分类:问答