You raise an interesting philosophical question. See below.
On 05/08/2019 23:21, William Michels wrote:
mbook:~ homedir$ perl6 -e 'for lines ("a\nb\n") { .say }'
a
b
mbook:~ homedir$
Okay. How to express this in simple English?
'How to express in ... ' is about translation. Perl 6 is a
oin("\t") };
#example 11:
mbook:~ homedir$ perl6 -e 'for lines() { say .split(":")[0, 2, 1,
5].join("\t") };' six_fruits1.txt
apple carrot banana favabean
apricot cabbage basil fennel
acai celery beets figs
#example 12:
mbook:~ homedir$ perl6 -e 'for lines[
explicitly in perl6.
>
> mbook:~ homedir$ perl6 -e 'for "six_fruits1.txt".IO.lines
> {.split(/\:/)[0, 2, 1, 5].join("\t").say};'
> apple carrot banana favabean
> apricot cabbage basil fennel
> acai celery beets figs
>
Same as above. No () on lines
>
>
>
>
Also no need for all the brackets
.say for lines;
This is quite idiomatic Perl 6 and not golfing
On Mon, 29 Jul 2019, 07:13 Joseph Brenner, wrote:
> > Hmmm. I would expect that to be in the Perl 5 to Perl 6 Migration
> Guides, but I do not see it there.
>
> Exactly, I was just looking there,
Multi-dimensional_array#Perl_6
Seems to be different from the push() issue. --B.
On Sun, Apr 14, 2019 at 12:39 AM Richard Hainsworth
wrote:
A semicolon is the syntax used for multidimensional arrays.
See https://docs.perl6.org/language/subscripts#Multiple_dimensions
On 14/04/2019 15:07, William Michel
A semicolon is the syntax used for multidimensional arrays.
See https://docs.perl6.org/language/subscripts#Multiple_dimensions
On 14/04/2019 15:07, William Michels via perl6-users wrote:
Hello,
I've been working through Patrick Michaud's excellent videos from the
The Perl Conference 2016. At
The term "slurpy" did help a lot.
:-)
I am writing your explanation down for my records.
Well Golly!
$ p6 'sub printx(**@args){print(@args)}; printx("abc",1,"def\n");'
abc 1 def
$ p6 'sub printx(**@args){print @args, "\n"}; printx("abc",1,"def");'
abc 1 def
Question:
$ p6 'sub
A snippet:
my @a = 1..10;
put +@a.so; # output 1
put so(+@a); # output True
put (+@a).so; # output True
This caught me because I used +@s.so when I tried to do something like:
# in a class with 'has Bool $.pass;'
return unless ( $!pass = +@a.so );
# fails with a
Hi,
I am trying to use the CompUnit module. I thought I had it working, but
then found that units were not being replaced.
I reduced the code to:
use v6.c;
use nqp;
'cache'.IO.unlink if 'cache'.IO ~~ e;
my $precomp-store =
CompUnit::PrecompilationStore::File.new(prefix=>'cache'.IO);
my
Suppose I have a sub called C that runs different code depending
on the content of an argument.
There are two styles in Perl 6 to code this and my question is whether
one is more efficient (speed/memory) than the other.
In this example, one relies on multiple dispatch, while the other an
Hi,
I use Perl 6 all the time, wherever I can. But for some things I do, I
can't use Perl 6, for example Android apps, or embedded chip programming.
I have used a number of languages, starting with Fortran and assembler,
then Pascal, Snobol, C and recently Java and php.
Perl 6 can be used
Hi,
(I am cross-posting this to stackoverflow #perl6 as well)
I am trying to create a cache of POD6 by precompiling them using the
CompUnit set of classes.
I can create, store and retrieve pod as follows:
use v6.c;
use nqp;
my $precomp-store =
I'm trying to understand this. Would someone provide a bit more explanation?
On 25/10/2018 10:47, Brian Duggan wrote:
On Sunday, October 21, Richard Hainsworth wrote:
so .. either I use your suggestion of 'exit note $message' which I find
elegant, but so far difficult to test.
You could
It seems to me that a role would be a far better idea.
Further if the role could check an environment variable, eg.
%*ENV, then it could only stop the default Exception
handler providing backtrace when the environment is set.
May be compiler developers could consider making this part of the
And that is the way to test it.
but then I cant work out how to get the message. I've been looking at
Zoffix's Test::Output, but not
Incomplete sentence there. I guess it doesn't work for you? Tell
us how you tried to use it, what you were expecting, and what happened
This sounds great.
So I am writing a class verifies conditions, and dies when conditions
are not met.
How do I attach a default CATCH to all methods in the class.
Or do I need to define my own Exception.
On 04/09/18 04:48, Curt Tilmes wrote:
On Mon, Sep 3, 2018 at 4:28 PM Parrot Raiser
How does this answer the question about testing?
Ok so there is code, but where do I go to find what that code is? Where
in the Rakudo repo would I start looking, eg.?
On 21/10/18 16:23, Timo Paulssen wrote:
https://docs.perl6.org/language/variables#index-entry-%24%2AEXIT
this should help
I'm writing a module and want to exit without a backtrace if conditions
are not met.
So I can write:
exit note '$path directory does not exist' unless $path.IO ~~ :d;
Fine. But how do I test this? I thought dies-ok, but dies-ok wants an
exception.
test.t:
sub testnote {exit note 'this
,
Ahmad
On Thu, Oct 11, 2018 at 5:20 AM Richard Hainsworth
mailto:rnhainswo...@gmail.com>>
wrote:
I use atom to edit perl6 scripts because of the nice
perl6 syntax
highlighting. Also I came across Ato
In the type documentation for POD under Pod::Block it states:
"Class for a Pod block, and base class for most other Pod classes."
'most' means inter alia 'not all'. So this statement is saying that
there are *other* Pod classes which are not Pod::Block.
I have tried to find these other
ontext menu for the icon in the file manager. I don't run Gnome so
> don't know where they hide how you set it currently.
>
> On Thu, Oct 11, 2018 at 5:20 AM Richard Hainsworth
> wrote:
>
>> I use atom to edit perl6 scripts because of the nice perl6 syntax
>> highlight
I use atom to edit perl6 scripts because of the nice perl6 syntax
highlighting. Also I came across Atom from this group.
Although files with .p6 or .pm6 have a nice camilea icon associated with
them, ...
... if I give a p6 file an exec bit, the icon changes to something like
an onion.
I'm
I have just started a review of the documentation for perl6.
When I hit `https://docs.perl6.org/language.html` I get a list of
sections that is the same as the alphabetical list of pod files in
`github.com/perl6/doc/tree/master/doc/Language` without 00-POD6-CONTROL.
One of my biggest issues
writer a 'jerk' is wrong.
On 03/10/18 07:40, ToddAndMargo wrote:
On 9/30/18 9:11 PM, Richard Hainsworth wrote:
But I thought you just implied you wanted pro stuff, not beginner stuff.
I have no idea how you got that out of what I said. I want the
beginners stuff included with the pro stuff
Todd,
I've already added to this conversation given that your 'perl' box was
corrupted. But when I read this post last week, I felt it needed some
response.
You actually have touched on some deep issues. Please allow for some
humour below.
First off, courses, beginners books, and the
Todd,
Since your 'perl box' got corrupted, may be you missed Yary's message
(copied below). Yary shared a frank viewpoint that I entirely agree with.
Several people have said 'read a book'. Reading a book - even if it can
be hard sometimes - is a courteous thing to do in a community that has
Further to this question. Support staff at hosting company just informed
me that for the plan I have at present, the following limits are in place:
60 seconds CPU execution time per process
195MB of RAM per process
20 simultaneous processes
I'm not sure which of these is limiting the
csh => OS accepted
unlimit => OS accepted
unlimit -h => several messages about not releasing hard limits
make => same problem as before, failure to allocate during parse stage.
On 26/09/18 11:32, yary wrote:
c) Any other suggestions?
csh
unlimit
unlimit -h
make
-y
Hi,
I'm trying to install perl6 on a commercial server. The OS is Debian
Stretch. The hosting service does not allow root access, so everything
must be done with user permission. I do not have access to apt. Snap
package cannot be installed.
My intention is also to set up CRO and develop a
Have you looked at the documentation for nativecall? It has a tutorial
example on how to access a c function from a standard library.
I wrote that little bit. It should answer most of your questions.
Richard
On Sat, 15 Sep 2018, 04:52 ToddAndMargo, wrote:
> Hi Larry and Friends,
>
> Fedora 28
Here's my experience: when I'm learning a new language or software, eg.,
php or css or recently GRAV CMS, and I have a problem, my first action
is google: . I'm sure everyone does something like this.
Whenever I see a response that includes Stackoverflow, I look there
first because for over
Curt,
Thanks, your code really helped me. But some questions:
I've had trouble with CStruct types and "is rw", so I usually just
make those
"Pointer is rw" to get the pointer back, then use nativecast() to make it into
the CStruct type I want.
This is useful, and a comment in the
Todd,
I figured out some of NativeCall by working with the GTK subroutines.
Eventually, I had to write some programs in C to use GTK natively before
getting a good understanding about how GTK-Simple works.
In addition, I have not figured out how to access CStruct variables yet.
So my code
When panda was first introduced as the 'adopted' module or package
manager for rakudo, a file containing the meta information for all the
modules, located at "http://ecosystem-api.p6c.org/projects.json;, was
established.
At the time, the developers said that the meta information file was
When panda was first introduced as the first module or package manager,
a file containing the meta information for all the modules, located at
"http://ecosystem-api.p6c.org/projects.json; was established.
At the time, the developers said that the meta information file was
designed to be
The suggested solution to this thread seems odd to me. It confuses a
storage structure with information about the elements, and doesn't use
the power of perl6.
An associative array is useful because non-integer indexes are possible
and hashing makes storage efficient. This makes referencing
4) "interpolating" as it refers to Perl (not math, where you "guess"
what a value is based on values on both sides of you).
Replacing something inside a string with the string representation of
its value. This sense is also used in documentation for the shell,
where you can
Futher to Timo's explanation, below is a rewrite of your code to consider.
The documentation reference is
https://docs.perl6.org/language/classtut#Constructors
class Etran {
has $.dstamp is rw;
has $.folio is rw;
has $.ticker is rw;
has $.way; # only used at
Holiday || butterfly ?
Why not
holiday && butterfly
?
Perl6 fuses so many other things.
In any case, we would use the abbreviation D/E/F ...
Adding a name is just being whimsical. So lets be doubly whimsical.
It also seems to me that 'scalar' gives the wrong impression compared to
arrays. A scalar in a vector is a component of a vector.
I was thinking of "generic".
Hence "$variable" is a generic variable because it can hold any type of
content.
On Friday, June 09, 2017 02:10 PM, Gabor Szabo
Please do not weaken the link between REPL and perl6 !
The ability to test perl6 snippets very quickly is something I find very
useful. And to get this I type 'perl6'. Easy to remember.
(I have been following perl6 since the very beginning, and installed
'pug'. Since perl6 has been
cause some friction as to whose to include.
My intuition is that in a year or so, the Ecosystem will change and the
better module will replace others.
On Thursday, May 25, 2017 05:12 PM, Gabor Szabo wrote:
On Thu, May 25, 2017 at 11:59 AM, Richard Hainsworth
<rnhainswo...@gmail.com> wro
sed/useful passing modules of the previous
month.
Regards,
Richard aka finanalyst
On Thursday, May 25, 2017 04:41 PM, Steve Mynott wrote:
On 25 May 2017 at 08:00, Richard Hainsworth <rnhainswo...@gmail.com> wrote:
I have not seen a discussion on this Forum about removing Task::Star
The reference is indeed gone on the Rakudo site.
It seems that you removed the reference after I wrote my first post
(bear in mind I am in Hong Kong, so before most of the USA) because I
wrote when I discovered I was getting an error from zef.
In addition, I download the projects file quite
Ah !!!
I had read about lazy and eager, but not appreciated what effect it
might have.
So the answer for my Tarjan module, which assumes a static network, is
to replace '.sort' with '.eager' .
However, ... the point at which I was getting an error in the modules
was the following code
This is to ask advice on how to pin down what appears to be a subtle bug
in Rakudo so that I can file a bug report.
*Background*
I am updating the work I have down on ModuleCitation, which is not
efficient at present.
Since I am create a recursive index, that is modules which cite modules,
The Ecosystem (that is the modules.perl6.org web page) shows whether a
module is passing its tests.
The system takes the error passing information from the Travis system.
The Ecosystem documentation (on distributing a module) does not give any
template for Travis. It would be useful for
On 05/23/2017 10:31 PM, Richard Hainsworth wrote:
> The code below seems unnecessarily complex.
>
> How about:
>
> my @Data = q:to/SAMPLE/;
>
> Mission D',
> Sol Wheat,
> Ted Moon,
> ;
>
> SAMPLE
>
&g
The code below seems unnecessarily complex.
How about:
my @Data = q:to/SAMPLE/;
Mission D',
Sol Wheat,
Ted Moon,
;
SAMPLE
for @Data {
next unless m/ 'NAME' .*? '>' $=( .*? ) '<' /;
say $; # say implicitly stringifies $
}
On Wednesday, May 24, 2017 01:20 PM,
On Wednesday, May 24, 2017 12:46 PM, ToddAndMargo wrote:
On Tue, May 23, 2017 at 11:30 PM, ToddAndMargo
wrote:
Hi All,
I have a test code in progress and I haven't figured out
how to get 'next' to work the way I want.
next if $Line.contains( "TASK type" );
The issue is not poor quality software!
The problem is community management.
Panda was the standard way for installing Perl6 modules. It is embedded
in nearly all of the "travis.yml" modules in the Ecosystem.
I just fixed flaws in a module of mine, which began to *fail* the Travis
, March 29, 2017 12:05 PM, Brad Gilbert wrote:
Responses inline
On Tue, Mar 28, 2017 at 10:37 PM, Richard Hainsworth
<rnhainswo...@gmail.com> wrote:
I've seen a couple of references to modules that no longer work; it's
inevitable with a new language.
There is a balance between having r
I think the strict answer to 'Is it correct?' is 'No'.
The point being that 'my $x' gives $x type 'Any'.
But practically, having type Any allows for $x to be assigned any value,
be it Str, Int etc.
So 'practically' the answer to 'Is it correct?' is 'Yes'.
On Wednesday, March 22, 2017 02:07
Seems to me because the second '(' is not preceded by a space; it is '`('.
But if the second '(' was eg '` (', then the longest match would have
been picked and a ? would be necessary.
On Tuesday, March 14, 2017 11:21 AM, ToddAndMargo wrote:
On 03/13/2017 08:16 PM, ToddAndMargo wrote:
On
perl6 -c
Is your Perl (cap P) below correct?
On Sunday, January 15, 2017 02:42 PM, ToddAndMargo wrote:
Hi All,
Is there a Perl 6 equivalent of Perl 5's |
Perl -c
I want to check my program for errors without
actually running it.
Many thanks,
-T
What me forget my semicolons! Never
How about:
$perl6
> my $c = prompt("can I have some\n"); say "you told me: $c";
can I have some
indeed you are welcome
you told me: indeed you are welcome
>
explanation: perl6 runs REPL to try something out
prompt takes a string and prints it, waiting for a response, which it
returns.
say
I just tried re-installing GTK::Simple on Ubuntu 16.04 (not 14.04, but I
don't see why a less recent Ubuntu would make a difference).
$ panda --force install GTK::Simple
==> Fetching GTK::Simple
==> Building GTK::Simple
Found system gtk library.
==> Testing GTK::Simple
t/01-sanity.t .. ok
All
On Wednesday, May 18, 2016 11:40 PM, Brandon Allbery wrote:
On Wed, May 18, 2016 at 11:29 AM, Brandon Allbery > wrote:
On Wed, May 18, 2016 at 11:27 AM, mt1957 > wrote:
This has
Marcel and Moritz,
Thank you for the fast response.
I have been experimenting with the code you sent, but still do not
understand something. To illustrate, here is another snippet:
use v6;
my $r;
for 0..4 -> $s {
{
$r = 5 / (3 - $s);
say "At line $?LINE r is $r";
CATCH {
I want to capture a divide by 0 exception and replace the value with
another.
Here is the code I tried:
use v6;
my $d = 1;
my $e = 2;
my $f = 0;
#my $r;
my $r = 5;
CATCH {
# when X::AdHoc {
when Exception {
.Str.say;
# $r = 5;
.resume
} }
$r = try {
( $d + $e ) / $f;
};
I have a condition that uses warn
something like (its just an illustration)
sub abc {
...
if $iterations > 150 {
$iterations = 150;
warn 'excess recursion, clamping at 150';
}
In my test suite I tried
throws-like { abc('excess') }, Exception, 'got the exception', message
=>
Hi,
Trying to use an enum. Can't easily find out how to use them. Looked in
both design documents and in the language documents page.
I can't seem to get the examples in the design documents to work. So I
seem to be missing something.
I got the following to work, and I thought enum was
Dear All,
I'm working on a sort of citation index of Perl6 modules. One general
problem:
There are two modules in the ecosystem, viz. io-prompt and lolsql, that
do not have ether META.info or META6.json file.
This is probably because they are old modules and worked for a
predecessor to
What should be the perl6 idiom for handling debug code?
I am writing a program that will be run with large values and take some
time when it is clear that it is running correctly.
In order to ensure that the program is correct, I have added code to
generate and output intermediate results. I
I would like to set a series of magic numbers from the command line.
I have in a program
constant N-SCENARIOS = 10;
which works great. But I would like to set an option in the command
line, such as
perl6 program.p6 scenarios=15
and then within program have the option assigned to the
being designed, but failing to gain enough traction to
elicite a production or (fully implemented) compiler/interpreter. The
exercise itself is still extremely valuable and beneficial to all
involved.
Brett
On Wed, Nov 23, 2011 at 12:38:15AM +0400, Richard Hainsworth wrote:
Yet again this thread
On 02/13/2011 11:16 PM, Guy Hulbert wrote:
I am only interested in perl5, perl6 and C to start.
I havent got the C or java languages to work yet.
snip
but re-organize the documentation a bit as I'm more interested in the
framework than the specific results -- except for how perl6
Thanks for the encouragement.
On 02/13/2011 11:02 PM, Will Coleda wrote:
On Sun, Feb 13, 2011 at 12:27 PM, Richard Hainsworth
rich...@rusrating.ru wrote:
Before doing any more work on this benchmarking project, I was wondering if
any one else thinks the effort is worth it.
Assuming
On 02/14/11 16:47, Guy Hulbert wrote:
Some comments on what I plan to do after my 2 week hibernation.
On Sun, 2011-13-02 at 20:27 +0300, Richard Hainsworth wrote:
see http://shootout.alioth.debian.org/ for more info on the
algorithms.
There are many factors that can be considered when
I came across the idiom
print P4\n$w $h\n;
for my $y (0..$h-1) {
print pack 'B*', pack 'C*', map dot($_, $y), 0..$w-1;
}
in a perl5 program for outputting dots in a graphical format. dot()
produces a 0 or -1.
I found the 'pack' function in perl6, but it does not seem to work the same.
I am not too clear on how pack works in perl5.
Is there a work around in perl6 to achieve the same result, viz., not
using pack?
Richard
On 02/14/2011 02:41 AM, Carl Mäsak wrote:
Richard ():
I came across the idiom
print P4\n$w $h\n;
for my $y (0..$h-1) {
print pack 'B*', pack 'C*',
So I'd change that to after a production release of a Perl 6 compiler
Out of curiosity (because I think it will illuminate some of the difficulty
Rakudo devs have in declaring something to be a production release):
- What constitues a production release?
- What was the first
On 01/05/11 19:48, Daniel Carrera wrote:
On Wed, Jan 5, 2011 at 5:05 PM, Richard Hainsworthrich...@rusrating.ru wrote:
It is blindingly obvious that the majority of language users, ..., will only
start to use a language
when it is recommended by 'those in authority'...
I think the issue of
'serious project' ???
For some 'serious' people, Perl6 is a 'serious project'. Concepts of
'serious' differ amongst reasonable people. Not a problem if your
'serious' aint my 'serious'.
As an aside, it took 358 years to prove Fermat's Last Theorem. Wiles -
who proved it - shut himself away
Guy,
Your idea is actually exactly what I was suggesting when I said 'example
programs'.
I think there are/were perl6 versions for the shootout problems. I am
not sure what happened to them.
Getting benchmarking will be interesting.
Regards,
Richard
On 01/05/11 20:15, Guy Hulbert wrote:
On 01/01/11 03:41, Daniel Carrera wrote:
On Sat, Jan 1, 2011 at 1:26 AM, Chas. Owenschas.ow...@gmail.com wrote:
On Wed, Dec 29, 2010 at 21:39, Xue, Brianbrian@amd.com wrote:
I want to adding one more answer about what are people waiting for before they
start using Perl 6.
There hasn't
Gabor,
there is a big gap between 'i wrote snippets' to 'i wrote modules'. How
about 'i have written programs to solve real problems' ?
How about a question on involvement in the perl6 development process, so
as to see how many people are following the process passively, and how
many are
On 07/30/2010 01:27 PM, Steffen Schwigon wrote:
Richard Hainsworthrich...@rusrating.ru writes:
The number of modules available to proto has grown considerably.
I am not aware that there is a convenient way of obtaining a short
description about each module, other than just the name?
I was going to suggest this too after reading PM's post. I would suggest
that for whatever reason a list operator was used on a scalar, including
a hold over form another language (Ruby and perl5), a warning should be
issued. Most likely to be an error.
On 06/21/2010 11:05 PM, yary wrote:
Dear Xi,
It may be more useful to rewrite your code to take advantage of perl6.
Your revcom can be replaced with a single line using core perl6 functions.
I'll give an example that currently works on rakudo for a simple string,
but you can put it into the loop.
start example
my
-01-2010 17:03:14, Richard Hainsworth wrote:
Unless things have changed recently, it is possible to compile a
module to pir, and 'use' the module in the main program. Rakudo
correctly links in the code.
It was not possible to compile the main program to pir, which should
in any case be called
Gabor Szabo wrote:
You can download it from here:
http://perlide.org/download/binary/perl-5.10.1-xl-0.02.tar.gz
For me using Firefox/Ubuntu, I got an error, but
http://www.perlide.org/download/binary/perl-5.10.1-xl-0.02.tar.gz
worked fine.
Richard
Gabor,
Now it works.
Richard
Gabor Szabo wrote:
On Wed, Dec 9, 2009 at 2:18 PM, Richard Hainsworth rich...@rusrating.ru wrote:
Gabor,
Thanx this is a good step forward.
With simple files, no problem. I tried a larger file and got the following
in the terminal window:
./perl-5.10.1-xl
On Wed, Dec 9, 2009 at 5:50 PM, Richard Hainsworth
rich...@rusrating.ru wrote:
Removing line 261 fixed the problem.
How do I define where perl6 looks for modules?
If I have a module in the same directory as the script, invoking perl6 in
the directory works fine. But Padre assumes the home
Leon Timmermans wrote:
If you want to write a fast parser for XML, preventing backtracking is
going to be quite essential. I suspect the problem is your grammar,
not the grammar engine itself. You could post it to perl6-users and
ask for advice on it.
Leon
Below is the grammar.
I am only
Inspired by a line of code on irc by krunen++, I returned to the
scripting games problems (following PM's suggestion in a blog a while ago).
Perl6 rocks! 30 lines to solve the problem. The perl5 solution was a
neat 45 lines. The vbscript took 197 lines!
In lines of code perl6 is 50% better
Just wanted to say that this afternoon I used rakudo for a real world need.
It was only a simple script to extract data from a text file. But it
took all of 5 min from start to finish.
Could have done it in perl5, but it really was easier to do it in perl6.
As far as I am concerned, this
Carl Mäsak wrote:
Andy ():
map?
perl6 -e 'my $x = :a5; say $x.map( { .value / 10} ).fmt(%s)'
Yes, sure. That'll print a tenth of the value of $x. The '.fmt(%s)'
is a no-op in this case.
// Carl
Not entirely a no-op. Thus
$perl6
my $x=:a5; say $x.map({.value/10}).fmt(the value
Larry Wall wrote:
On Wed, Jan 14, 2009 at 09:55:38AM +0300, Richard Hainsworth wrote:
However, I came across one thing in solution #3 that I posted yesterday.
$pair.fmt(%s %s) is nice, but it doesnt allow for any action on either
value or key before printing (I wanted to print the value
S12 defines enums and rakudo impliments them, so
perl6
enum wkend Sat Sun; my $x = Sun; say $x
1
But suppose I want to get the face value of $x, viz., 'Sun'?
How do I get it?
say $x.key doesnt work.
could this code be written?
Hal Wigoda wrote:
the first line creates a hash,
the second line sorts the hash values into an array.
the third loops thru the array values printing one array member per line
On Jan 10, 2009, at 2:26 PM, Richard Hainsworth wrote:
Could someone help me understand what
Here's a solution to Scripting Games #2. Script and data file attached.
The algorithm closely follows the published solution by the perl expert. Here
is the model solution
use 5.010;
use strict;
use warnings;
use List::Util qw(sum);
my %score;
open(my $fh, , C:/Scripts/skaters.txt) or die;
Could someone help me understand what is going on in the following snippet?
my %players = {'william'=2, 'peter'=3,'john'=1,'mary'=5};
my @ranking = %players.sort: { .value };
for @ranking {.say};
I cut and pasted from Patrick's blog on sorting and played around to
get an array.
But ... I
wrong pod commands
s/=pod/=begin/
s/=cut/=end/
Richard Hainsworth wrote:
Here's a solution to the scripting competition test. Patrick suggested
publishing solutions somewhere, including this list.
#!/usr/local/bin/perl6
=pod
Patrick Michaud suggested
(http://use.perl.org/~pmichaud/journal
Here's a solution to the scripting competition test. Patrick suggested
publishing solutions somewhere, including this list.
#!/usr/local/bin/perl6
=pod
Patrick Michaud suggested
(http://use.perl.org/~pmichaud/journal/38134?from=rss) writing solutions to
scripting game definitions as a way of
Supposed I define
regex digit { [0..9] }
what is the negative?
By analogy, it should be !digit but I cant find this in the Synopses
(possibly missed the relevant section).
if /[0..9]/ then the negative is /![0..9]/
Also, suppose I want a 'when' clause to fire when the test is *not* met.
Suppose I want a 'when' clause to fire when the test is *not* met. What
syntax should be used?
So how would I do
my $x = 'abced';
given $x {
when ! /digit/ {say 'this does not contain a digit'} # this does
not work
}
Since the ~~ operator is implied in the when, how do we get an implied
I posted an email to per6-all asking about how one should go about
reporting bugs. That message has appeared on the list.
So again: how can bugs be reported?
There was a suggestion by PM for people to try out perl6 on some real
software, and the scripting completion tasks were suggested.
So
FYI
This discussion remains on-going. Some of the issues raised require
investigation to clarify, which takes time.
Richard
Gabor Szabo wrote:
Has anything happened in response to this discussion?
Gabor
In my $life, I raise money from sponsors.
It is not difficult to spend money, once you have it.
It is not difficult to raise money, once you know how to spend it wisely.
What's difficult is putting the two together.
Some donors know what to contribute to - they choose specific projects
and
101 - 200 of 212 matches
Mail list logo