Hi All,
Do we have anything like
http://perldoc.perl.org/File/Copy.html
under another name?
Nothing showed up in
https://modules.perl6.org/#q=file%3A%3A
Many thanks,
-T
--
Yesterday it worked.
Today it is not working.
Windows is like that.
Thank you for the report. However, there's no bug here and I'm going to reject
this ticket.
> Another option is to make it return 5 (kinda DWIM)
No, it's not another option because that doesn't make any sense mathematically.
The math operations lcm[^1] and gcd[^2] ops perform apply to integer
Thank you all for the wonderful training and feedback!
On 03/21/2017 11:25 AM, Brandon Allbery wrote:
people comparing perl 5 speed to perl 6 should take note: perl 5 used to
be slow too
If you wanted "speed", code in C or assembly. I am after
rapid development. Perl 6 is perfect.
--
~~
Computers are like
On 03/21/2017 04:50 AM, Elizabeth Mattijsen wrote:
$PathAndName.IO.open(:w).close unless $PathAndName.IO.f;
Hi Liz,
Now that is elegant! Thank you!
-T
--
~~
Computers are like air conditioners.
They malfunction when you open windows
On 03/21/2017 08:10 AM, Parrot Raiser wrote:
"Premature optimisation is the root of many evils", or words to that
effect. (I forget who said it, but I think it was someone credible.)
Write your code as clearly and simply as you can, then see if it
performs adequately under load. If it does,
On 03/21/2017 05:05 AM, Timo Paulssen wrote:
Shifting from the front will just move the "beginning" pointer one slot
forwards, and popping will decrease the "element count" number.
I'm not sure if splice with an empty "insertion" list that happens to be
at the end will also just reduce the
On Tue, Mar 21, 2017 at 02:46:43PM -0400, Brandon Allbery wrote:
> On Tue, Mar 21, 2017 at 2:37 PM, Patrick R. Michaud
> wrote:
> > > On Tue, Mar 21, 2017 at 7:38 AM, ToddAndMargo
> > wrote:
> > > > $Name.IO.f or $Name.IO.open(:w).close;
> > >
> > >
On Tue, Mar 21, 2017 at 2:37 PM, Patrick R. Michaud
wrote:
> On Tue, Mar 21, 2017 at 02:25:02PM -0400, Brandon Allbery wrote:
> > On Tue, Mar 21, 2017 at 7:38 AM, ToddAndMargo
> wrote:
> > > $Name.IO.f or $Name.IO.open(:w).close;
> >
> > fwiw I
On Tue, Mar 21, 2017 at 7:28 PM, Brandon Allbery
wrote:
> On Tue, Mar 21, 2017 at 7:50 AM, Elizabeth Mattijsen
> wrote:
>
>> $PathAndName.IO.open(:w).close unless $PathAndName.IO.f;
>
>
> This has a readability issue, though: you've buried the lede.
On Tue, Mar 21, 2017 at 5:52 AM, ToddAndMargo wrote:
> Sound backwards to me. What am I missing?
Conditionals in all language have a semantic gap issue. Test conditions are
often the reverse of what makes for good code --- which is why you find
inverted conditionals in
On Tue, Mar 21, 2017 at 02:25:02PM -0400, Brandon Allbery wrote:
> On Tue, Mar 21, 2017 at 7:38 AM, ToddAndMargo wrote:
> > $Name.IO.f or $Name.IO.open(:w).close;
>
> fwiw I consider this a perl3_to_5-ism; it's an optimization, and a fairly
> poor one for readability and
On Tue, Mar 21, 2017 at 7:50 AM, Elizabeth Mattijsen wrote:
> $PathAndName.IO.open(:w).close unless $PathAndName.IO.f;
This has a readability issue, though: you've buried the lede. The condition
should be up front where it stands out, not hidden at the back. The wide
usage
On Tue, Mar 21, 2017 at 7:38 AM, ToddAndMargo wrote:
> $Name.IO.f or $Name.IO.open(:w).close;
fwiw I consider this a perl3_to_5-ism; it's an optimization, and a fairly
poor one for readability and maintainability, but one that used to be
fairly important (people
"Premature optimisation is the root of many evils", or words to that
effect. (I forget who said it, but I think it was someone credible.)
Write your code as clearly and simply as you can, then see if it
performs adequately under load. If it does, you're finished.
If it doesn't, instrument and
On Tue, 21 Mar 2017 12:50:18 +0100, Elizabeth Mattijsen
wrote:
> > On 21 Mar 2017, at 12:38, ToddAndMargo wrote:
> > This is just one of those chatter posts.
> >
> > To me, the holy grail of coding is maintainability,
> > which is why I code in Top Down.
Shifting from the front will just move the "beginning" pointer one slot
forwards, and popping will decrease the "element count" number.
I'm not sure if splice with an empty "insertion" list that happens to be
at the end will also just reduce the number of elements or if it does a
bit of
> On 21 Mar 2017, at 12:38, ToddAndMargo wrote:
> This is just one of those chatter posts.
>
> To me, the holy grail of coding is maintainability,
> which is why I code in Top Down.
>
> Code like below get my goat because I have to look
> at it several times before I
On 03/21/2017 04:27 AM, Philip Hazelden wrote:
$PathAndName.IO.f or $PathAndName.IO.open(:w).close;
Note, the following sequence is possible:
1. .IO.f returns false
2. Someone creates the file and writes some data to it
3. .IO.open truncates the file
Thus, this has a chance of editing the
Hi All,
This is just one of those chatter posts.
To me, the holy grail of coding is maintainability,
which is why I code in Top Down.
Code like below get my goat because I have to look
at it several times before I realize what is going on
$Name.IO.f or $Name.IO.open(:w).close;
Basically the
> $PathAndName.IO.f or $PathAndName.IO.open(:w).close;
Note, the following sequence is possible:
1. .IO.f returns false
2. Someone creates the file and writes some data to it
3. .IO.open truncates the file
Thus, this has a chance of editing the file.
I suggest instead (untested):
On 03/21/2017 04:02 AM, Simon Proctor wrote:
It's a logical test but I'd probably use || instead.
Thank you!
It's a logical test but I'd probably use || instead.
See : https://docs.perl6.org/language/traps#Loose_boolean_operators
On Tue, 21 Mar 2017 at 10:56 ToddAndMargo wrote:
> On 03/21/2017 03:07 AM, Brent Laabs wrote:
> > $PathAndName.IO.f or
On 03/21/2017 03:07 AM, Brent Laabs wrote:
$PathAndName.IO.f or $PathAndName.IO.open(:w).close;
Is that a coding "or" or an English "or"?
--
~~
Computers are like air conditioners.
They malfunction when you open windows
On 03/21/2017 03:50 AM, Simon Proctor wrote:
.e checks a path exists.
.f checks it exists AND is a file.
.d checks it exists AND is a directory.
(Perl 5 was the -e, -f and -d tests)
Beautiful explanation! Thank you!
Perl 5 has the (about) same test as bash and I write
a lot in that too. (I
.e checks a path exists.
.f checks it exists AND is a file.
.d checks it exists AND is a directory.
(Perl 5 was the -e, -f and -d tests)
On Tue, 21 Mar 2017 at 10:19 ToddAndMargo wrote:
> On 03/21/2017 03:07 AM, Brent Laabs wrote:
> > You can create a file by opening a
On 03/21/2017 03:07 AM, Brent Laabs wrote:
You can create a file by opening a filehandle for writing.
$PathAndName.IO.f or $PathAndName.IO.open(:w).close;
What does the .f do?
--
~~
Computers are like air conditioners.
They malfunction when you open
On Tue, Mar 21, 2017 at 3:01 AM, ToddAndMargo > wrote:
Hi All,
How to I do this bash code in Perl 6?
if [ ! -f "$PathAndName" ]; then touch "$PathAndName" fi
I am not finding the directions on how to create a "new"
file
You can create a file by opening a filehandle for writing.
$PathAndName.IO.f or $PathAndName.IO.open(:w).close;
On Tue, Mar 21, 2017 at 3:01 AM, ToddAndMargo wrote:
> Hi All,
>
> How to I do this bash code in Perl 6?
>
> if [ ! -f "$PathAndName" ]; then touch
On Tue, 21 Mar 2017 at 09:53 ToddAndMargo > wrote:
https://docs.perl6.org/language/io.html
From the above manual, the example to check if a file exists:
if "nonexistent_file".IO.e {
say "file exists";
}
else {
Hi All,
How to I do this bash code in Perl 6?
if [ ! -f "$PathAndName" ]; then touch "$PathAndName" fi
I am not finding the directions on how to create a "new"
file at a specific location.
Many thanks,
-T
--
~~
Computers are like air conditioners.
They
On 03/21/2017 02:14 AM, Elizabeth Mattijsen wrote:
On 21 Mar 2017, at 10:00, ToddAndMargo wrote:
on this command:
perl6 -e 'my @foo = ; @foo.splice(0,3); say @foo;'
Are you actually moving one set up data into another set's
element/slot/index, or are you just
Just because the file is called "nonexistent_file" doesn't mean is doesn't
exist.
It's a poorly written example really.
if "possibly_existing_file".IO.e {
say "file exists";
}
else {
say "file doesn't exist";
}
Is more intuitive I would say.
On Tue, 21 Mar 2017 at 09:53 ToddAndMargo
https://docs.perl6.org/language/io.html
From the above manual, the example to check if a file exists:
if "nonexistent_file".IO.e {
say "file exists";
}
else {
say "file doesn't exist";
}
Sound backwards to me. What am I missing?
Many thanks,
-T
--
~
I
> On 21 Mar 2017, at 10:00, ToddAndMargo wrote:
> on this command:
>
> perl6 -e 'my @foo = ; @foo.splice(0,3); say @foo;'
>
> Are you actually moving one set up data into another set's
> element/slot/index, or are you just rearranging the pointers
> to each element?
How
Dear Developers,
on this command:
perl6 -e 'my @foo = ; @foo.splice(0,3); say @foo;'
Are you actually moving one set up data into another set's
element/slot/index, or are you just rearranging the pointers
to each element?
Many thanks,
-T
--
~~~
Having been erased,
On 03/20/2017 11:18 PM, Norman Gaywood wrote:
On 21 March 2017 at 15:39, ToddAndMargo > wrote:
from the beginning of an array?
untested but same as perl5:
splice @list, 0, $N;
https://docs.perl6.org/routine/splice
On 20. mars 2017 15:54, Patrick R. Michaud wrote:
On Mon, Mar 20, 2017 at 02:36:49PM +0100, Francesco Rivetti wrote:
On 18. mars 2017 11:54, Elizabeth Mattijsen wrote:
if (my $x = frobnicate(42)) {
say $x
}
[...]
if frobnicate(42) -> $x {
say $x
}
which is way more elegant. Should
On 21 March 2017 at 15:39, ToddAndMargo wrote:
> from the beginning of an array?
>
untested but same as perl5:
splice @list, 0, $N;
https://docs.perl6.org/routine/splice
> I know about shift, but that is one at a time. I suppose I
> could do a loo[, but it would be
39 matches
Mail list logo