Re: Hash and subs question

2017-09-28 Thread ToddAndMargo

On 09/28/2017 08:56 PM, Brandon Allbery wrote:
On Thu, Sep 28, 2017 at 11:52 PM, ToddAndMargo > wrote:


I see that SayHash(%H) will take any hash I send it.

Is there a way to make the compiler pissed if a sub does not see
the specific keys int he hash it wants?  Or do I need to use loop
with ":exists" and test each key?


You should be able to use a destructuring signature 
(https://docs.perl6.org/type/Signature#index-entry-destructuring_arguments_%28Signature%29)


Hi Brandon,

on this:

sub all-dimensions(% (:length(:$x), :width(:$y), :depth(:$z))) {
$x andthen $y andthen $z andthen True
}

it turn my hash into single variables.  Is there a way to
test if the right keys are present and keep my hash afterwards?

-T


Re: -f ???

2017-09-28 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 1:09 AM, ToddAndMargo  wrote:

> Figured it out.  The chat line told me that there is an error in the
> docs.  The proper way was "e" not "f"
>

This is not the same thing. .e will return True if it exists but is a
directory, for example. I mentioned this in my first response.
In fact, the different behavior seems inconsistent and might be a bug.

-- 
brandon s allbery kf8nh   sine nomine associates
allber...@gmail.com  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net


Re: Hash and subs question

2017-09-28 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 12:05 AM, ToddAndMargo 
wrote:

> sub all-dimensions(% (:length(:$x), :width(:$y), :depth(:$z))) {
> $x andthen $y andthen $z andthen True
> }
>
> it turn my hash into single variables.  Is there a way to
> test if the right keys are present and keep my hash afterwards?
>

That's just one example. I would expect something like this to work:

sub foo(%bar (:length($)!, :width($)!)) {

which gives you the named one (instead of using the anonymous hash to
suppress it) and should test for requred keys while discarding their
(separated) values. Or you can use named variables instead f the $
placeholders if you actually want them.

Note, I am not sure what actually happens with the :$x etc. in the
original; it might be necessary to destructure those as ($ => $) or
something.

-- 
brandon s allbery kf8nh   sine nomine associates
allber...@gmail.com  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net


Re: -f ???

2017-09-28 Thread Norman Gaywood
On 29 September 2017 at 15:10, Brandon Allbery  wrote:

>
> (And, Norman? It produces a Failure, not a hard exception. You can
> introspect Failures to keep them from getting thrown.)
>

 Yep, that's what I thought I'd said :-) Obviously not clearly.

Another way of looking at it:

$ perl6 -e 'my $f = "eraseme.txt".IO.f;say $f.WHAT'
(Failure)

and you can coerce that to a bool without throwing as other examples in the
thread have shown.

perl6 -e 'my $f = "eraseme.txt".IO.f; say $f.WHAT; say ?$f'
(Failure)
False

Or plain old verbose:

if "eraseme.txt".IO.f {
say "exists";
} else {
say "does not exist";
}

It seems to me it only looks buggy when you are trying to do one liners and
you don't naturally get a boolean context.

-- 
Norman Gaywood, Computer Systems Officer
School of Science and Technology
University of New England
Armidale NSW 2351, Australia

ngayw...@une.edu.au  http://turing.une.edu.au/~ngaywood
Phone: +61 (0)2 6773 2412  Mobile: +61 (0)4 7862 0062

Please avoid sending me Word or Power Point attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html


how do I assign an array to a hash key

2017-09-28 Thread ToddAndMargo

Hi All,

I am creating a hash.  One of the keys I want to point to an array,
not a string.

I have created a test:

$ perl6 -e 'my %x = [aaa => "x", b=>@["y","q","r"], c=>"z"]; say %x; for 
@(%x) {say $_};'

{aaa => x, b => [y q r], c => z}
y
q
r

This seems too easy.  I have to have done something wrong.
What did I miss?

-T


Re: how do I assign an array to a hash key

2017-09-28 Thread ToddAndMargo

On 09/28/2017 09:47 PM, Brandon Allbery wrote:
On Fri, Sep 29, 2017 at 12:44 AM, ToddAndMargo > wrote:


I will probably use the @ for a while until I get use to
it for readability.


I think that's actually disrecommended, because it looks too much like 
Perl 5's refs but isn't, so it can bite you unexpectedly if you treat it 
like one.


okay, but I don't know how to di it in Perl 5, so ...

P6's sub declarations are so much better than P5's it take
my breath away.


Re: -f ???

2017-09-28 Thread ToddAndMargo

On 09/28/2017 10:12 PM, Brandon Allbery wrote:
On Fri, Sep 29, 2017 at 1:09 AM, ToddAndMargo > wrote:


Figured it out.  The chat line told me that there is an error in the
docs.  The proper way was "e" not "f"


This is not the same thing. .e will return True if it exists but is a 
directory, for example. I mentioned this in my first response.

In fact, the different behavior seems inconsistent and might be a bug.


Yup.  That is what the docs say.  It is a mistake.

In my example, eraseme.txt is a file.  There is no directory
of that name anywhere on my computer.  Spell it right
and you get a True back.  Misspell it and you get a False back.


Re: -f ???

2017-09-28 Thread ToddAndMargo

On 09/28/2017 10:31 PM, ToddAndMargo wrote:

On 09/28/2017 10:19 PM, ToddAndMargo wrote:

On 09/28/2017 10:12 PM, Brandon Allbery wrote:
On Fri, Sep 29, 2017 at 1:09 AM, ToddAndMargo > wrote:


    Figured it out.  The chat line told me that there is an error in the
    docs.  The proper way was "e" not "f"


This is not the same thing. .e will return True if it exists but is a 
directory, for example. I mentioned this in my first response.

In fact, the different behavior seems inconsistent and might be a bug.


Yup.  That is what the docs say.  It is a mistake.

In my example, eraseme.txt is a file.  There is no directory
of that name anywhere on my computer.  Spell it right
and you get a True back.  Misspell it and you get a False back.


And e give me True back for directories too.  h.

$ perl6 -e 'my $x="p6-OS-Clipboard".IO.e;say $x'
True

$ perl6 -e 'my $x="p6-OS-Clipboard".IO.f.Bool;say $x'
False

$ perl6 -e 'my $x="eraseme.txt".IO.f.Bool;say $x'
True


The chat line is discussing this as a bug


--
~~
Computers are like air conditioners.
They malfunction when you open windows
~~


Re: -f ???

2017-09-28 Thread ToddAndMargo

On 09/28/2017 09:53 PM, ToddAndMargo wrote:

On 09/28/2017 09:45 PM, Brandon Allbery wrote:
On Fri, Sep 29, 2017 at 12:41 AM, ToddAndMargo > wrote:


    Does perl 6 have an equivalent to bash's "-f" to
    see if a file exists?  Or is that a system call?


IO::Path's .f method. (Or .e to not require it to be a file, etc. as 
usual.)


     pyanfar Z$ 6 '".profile".IO.f.say'
     True


Hi Brandon,

How do I get this to give me a "False" instead of crashing
and wagging the finger at me?

$ perl6 -e 'say "eraseme.txt".IO.f;'
True

$ perl6 -e 'say "erasxeme.txt".IO.f;'
Failed to find '/home/linuxutil/erasxeme.txt' while trying to do '.f'
   in block  at -e line 1

Many thanks,
-T



method f

Defined as:

method f(--> Bool:D)

Returns True if the invocant is a path that exists and is
a file. The method will fail with X::IO::DoesNotExist if
the path points to a non-existent filesystem entity.

maybe it is suppose to crash?





--
~~
Computers are like air conditioners.
They malfunction when you open windows
~~


Re: -f ???

2017-09-28 Thread ToddAndMargo

On 09/28/2017 09:45 PM, Brandon Allbery wrote:
On Fri, Sep 29, 2017 at 12:41 AM, ToddAndMargo > wrote:


Does perl 6 have an equivalent to bash's "-f" to
see if a file exists?  Or is that a system call?


IO::Path's .f method. (Or .e to not require it to be a file, etc. as usual.)

     pyanfar Z$ 6 '".profile".IO.f.say'
     True


Hi Brandon,

How do I get this to give me a "False" instead of crashing
and wagging the finger at me?

$ perl6 -e 'say "eraseme.txt".IO.f;'
True

$ perl6 -e 'say "erasxeme.txt".IO.f;'
Failed to find '/home/linuxutil/erasxeme.txt' while trying to do '.f'
  in block  at -e line 1

Many thanks,
-T


Re: how do I assign an array to a hash key

2017-09-28 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 12:44 AM, ToddAndMargo 
wrote:

> I will probably use the @ for a while until I get use to
> it for readability.
>

I think that's actually disrecommended, because it looks too much like Perl
5's refs but isn't, so it can bite you unexpectedly if you treat it like
one.

-- 
brandon s allbery kf8nh   sine nomine associates
allber...@gmail.com  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net


Re: -f ???

2017-09-28 Thread ToddAndMargo

On 09/28/2017 10:19 PM, ToddAndMargo wrote:

On 09/28/2017 10:12 PM, Brandon Allbery wrote:
On Fri, Sep 29, 2017 at 1:09 AM, ToddAndMargo > wrote:


    Figured it out.  The chat line told me that there is an error in the
    docs.  The proper way was "e" not "f"


This is not the same thing. .e will return True if it exists but is a 
directory, for example. I mentioned this in my first response.

In fact, the different behavior seems inconsistent and might be a bug.


Yup.  That is what the docs say.  It is a mistake.

In my example, eraseme.txt is a file.  There is no directory
of that name anywhere on my computer.  Spell it right
and you get a True back.  Misspell it and you get a False back.


And e give me True back for directories too.  h.

$ perl6 -e 'my $x="p6-OS-Clipboard".IO.e;say $x'
True

$ perl6 -e 'my $x="p6-OS-Clipboard".IO.f.Bool;say $x'
False

$ perl6 -e 'my $x="eraseme.txt".IO.f.Bool;say $x'
True


--
~~
Computers are like air conditioners.
They malfunction when you open windows
~~


Re: how do I assign an array to a hash key

2017-09-28 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 12:32 AM, ToddAndMargo 
wrote:

> $ perl6 -e 'my %x = [aaa => "x", b=>@["y","q","r"], c=>"z"]; say %x; for
> @(%x) {say $_};'
> {aaa => x, b => [y q r], c => z}
> y
> q
> r
>
> This seems too easy.  I have to have done something wrong.
> What did I miss?
>

Only that it's even easier than you think: the @ was unnecessary when
building it. Perl 6 handles this kind of thing much better than Perl 5. And
there are other ways to spell the destructuring as well.

pyanfar Z$ 6 'my %x = [aaa => "x", b=>["y","q","r"], c=>"z"]; say %x;
for %x[*] {say $_};'
{aaa => x, b => [y q r], c => z}
y
q
r


-- 
brandon s allbery kf8nh   sine nomine associates
allber...@gmail.com  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net


Re: Hash and subs question

2017-09-28 Thread ToddAndMargo

On 09/28/2017 09:11 PM, Brandon Allbery wrote:
On Fri, Sep 29, 2017 at 12:05 AM, ToddAndMargo > wrote:


sub all-dimensions(% (:length(:$x), :width(:$y), :depth(:$z))) {
     $x andthen $y andthen $z andthen True
}

it turn my hash into single variables.  Is there a way to
test if the right keys are present and keep my hash afterwards?


That's just one example. I would expect something like this to work:

     sub foo(%bar (:length($)!, :width($)!)) {

which gives you the named one (instead of using the anonymous hash to 
suppress it) and should test for requred keys while discarding their 
(separated) values. Or you can use named variables instead f the $ 
placeholders if you actually want them.


Note, I am not sure what actually happens with the :$x etc. in the 
original; it might be necessary to destructure those as ($ => $) or 
something.


Thank you . I will put in my docs as a "maybe".

:-)


Re: -f ???

2017-09-28 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 1:06 AM, Brandon Allbery 
wrote:

> On Fri, Sep 29, 2017 at 12:59 AM, ToddAndMargo 
> wrote:
>
>> On 09/28/2017 09:53 PM, ToddAndMargo wrote:
>>
>>> On 09/28/2017 09:45 PM, Brandon Allbery wrote:
>>>
 IO::Path's .f method. (Or .e to not require it to be a file, etc. as
 usual.)

  pyanfar Z$ 6 '".profile".IO.f.say'
  True

>>>
>>> How do I get this to give me a "False" instead of crashing
>>> and wagging the finger at me?
>>>
>>> $ perl6 -e 'say "eraseme.txt".IO.f;'
>>> True
>>>
>>> $ perl6 -e 'say "erasxeme.txt".IO.f;'
>>> Failed to find '/home/linuxutil/erasxeme.txt' while trying to do '.f'
>>>in block  at -e line 1
>>>
>>
>> method f
>>
>> Defined as:
>>
>> method f(--> Bool:D)
>>
>> Returns True if the invocant is a path that exists and is
>> a file. The method will fail with X::IO::DoesNotExist if
>> the path points to a non-existent filesystem entity.
>>
>> maybe it is suppose to crash?
>
>
> This sounds broken, actually; I understand that a Failure treated as a
> Bool prevented it from throwing, so it should have simply returned False.
>
> Checking it for .defined *does* prevent throwing. Still seems like a bug.
>

Apparently not a bug, just unfortunate. You have to explicitly coerce it to
Bool to keep it from throwing.

pyanfar Z$ 6 '".profileX".IO.f.Bool.say'
False

(And, Norman? It produces a Failure, not a hard exception. You can
introspect Failures to keep them from getting thrown.)

-- 
brandon s allbery kf8nh   sine nomine associates
allber...@gmail.com  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net


Re: -f ???

2017-09-28 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 12:59 AM, ToddAndMargo 
wrote:

> On 09/28/2017 09:53 PM, ToddAndMargo wrote:
>
>> On 09/28/2017 09:45 PM, Brandon Allbery wrote:
>>
>>> IO::Path's .f method. (Or .e to not require it to be a file, etc. as
>>> usual.)
>>>
>>>  pyanfar Z$ 6 '".profile".IO.f.say'
>>>  True
>>>
>>
>> How do I get this to give me a "False" instead of crashing
>> and wagging the finger at me?
>>
>> $ perl6 -e 'say "eraseme.txt".IO.f;'
>> True
>>
>> $ perl6 -e 'say "erasxeme.txt".IO.f;'
>> Failed to find '/home/linuxutil/erasxeme.txt' while trying to do '.f'
>>in block  at -e line 1
>>
>
> method f
>
> Defined as:
>
> method f(--> Bool:D)
>
> Returns True if the invocant is a path that exists and is
> a file. The method will fail with X::IO::DoesNotExist if
> the path points to a non-existent filesystem entity.
>
> maybe it is suppose to crash?


This sounds broken, actually; I understand that a Failure treated as a Bool
prevented it from throwing, so it should have simply returned False.

Checking it for .defined *does* prevent throwing. Still seems like a bug.

-- 
brandon s allbery kf8nh   sine nomine associates
allber...@gmail.com  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net


Re: -f ???

2017-09-28 Thread Norman Gaywood
I was just reading about this!

On 29 September 2017 at 14:53, ToddAndMargo  wrote:

>
> $ perl6 -e 'say "erasxeme.txt".IO.f;'
> Failed to find '/home/linuxutil/erasxeme.txt' while trying to do '.f'
>   in block  at -e line 1
>

When you do:

 "erasxeme.txt".IO.f

It will fail (before the .f even) on the .IO call because "erasxeme.txt"
does not exist. perl6 will then throw an exception when you try to use the
value of that failed call.

So, you need to not "use" the value of the failed .IO call:

if not $f.IO.f { say "$f not found" }

-- 
Norman Gaywood, Computer Systems Officer
School of Science and Technology
University of New England
Armidale NSW 2351, Australia

ngayw...@une.edu.au  http://turing.une.edu.au/~ngaywood
Phone: +61 (0)2 6773 2412  Mobile: +61 (0)4 7862 0062

Please avoid sending me Word or Power Point attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html


Re: -f ???

2017-09-28 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 1:10 AM, Brandon Allbery 
wrote:

> Apparently not a bug, just unfortunate. You have to explicitly coerce it
> to Bool to keep it from throwing.
>
> pyanfar Z$ 6 '".profileX".IO.f.Bool.say'
> False
>

This can also be done with 'so' or prefix '?'.

pyanfar Z$ 6 'say ?".profileX".IO.f'
False

-- 
brandon s allbery kf8nh   sine nomine associates
allber...@gmail.com  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net


-f ???

2017-09-28 Thread ToddAndMargo

Hi All,

Does perl 6 have an equivalent to bash's "-f" to
see if a file exists?  Or is that a system call?

Many thanks,
-T


Re: how do I assign an array to a hash key

2017-09-28 Thread ToddAndMargo

On 09/28/2017 09:32 PM, ToddAndMargo wrote:

Hi All,

I am creating a hash.  One of the keys I want to point to an array,
not a string.

I have created a test:

$ perl6 -e 'my %x = [aaa => "x", b=>@["y","q","r"], c=>"z"]; say %x; for 
@(%x) {say $_};'

{aaa => x, b => [y q r], c => z}
y
q
r

This seems too easy.  I have to have done something wrong.
What did I miss?

-T



Way to easy.

$ perl6 -e 'my %x = [aaa => "x", b=>@["y","q","r"], c=>"z"]; push 
@(%x), ""; say %x; for @(%x) {say $_};'

{aaa => x, b => [y q r ], c => z}
y
q
r



I am very suspicious.


--
~~
Computers are like air conditioners.
They malfunction when you open windows
~~


Re: -f ???

2017-09-28 Thread Brandon Allbery
On Fri, Sep 29, 2017 at 12:41 AM, ToddAndMargo 
wrote:

> Does perl 6 have an equivalent to bash's "-f" to
> see if a file exists?  Or is that a system call?
>

IO::Path's .f method. (Or .e to not require it to be a file, etc. as usual.)

pyanfar Z$ 6 '".profile".IO.f.say'
True

-- 
brandon s allbery kf8nh   sine nomine associates
allber...@gmail.com  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net


Re: how do I assign an array to a hash key

2017-09-28 Thread ToddAndMargo

On 09/28/2017 09:43 PM, Brandon Allbery wrote:
On Fri, Sep 29, 2017 at 12:32 AM, ToddAndMargo > wrote:


$ perl6 -e 'my %x = [aaa => "x", b=>@["y","q","r"], c=>"z"]; say %x;
for @(%x) {say $_};'
{aaa => x, b => [y q r], c => z}
y
q
r

This seems too easy.  I have to have done something wrong.
What did I miss?


Only that it's even easier than you think: the @ was unnecessary when 
building it. Perl 6 handles this kind of thing much better than Perl 5. 
And there are other ways to spell the destructuring as well.


     pyanfar Z$ 6 'my %x = [aaa => "x", b=>["y","q","r"], c=>"z"]; say 
%x; for %x[*] {say $_};'

     {aaa => x, b => [y q r], c => z}
     y
     q
     r


Thank you!


I will probably use the @ for a while until I get use to
it for readability.


Re: chown?

2017-09-28 Thread Brandon Allbery
On Thu, Sep 28, 2017 at 11:15 PM, ToddAndMargo 
wrote:

> I wonder why they did not "banish" (sound so harsh) chmod?
>

Basic file permissions are actually relatively similar. Windows (and OS X!
see chmod(1)) integrate ACL support, but there's still a reasonably common
core that doesn't run into key differences. ACL support is what goes into
the ecosystem, as a result.

-- 
brandon s allbery kf8nh   sine nomine associates
allber...@gmail.com  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net


Hash and subs question

2017-09-28 Thread ToddAndMargo

Hi All,

Looking at this test I threw together;

$ perl6 -e 'sub SayHash(%H) {say %H}; my %x = [aaa => "x", b=>"y", 
c=>"z"];SayHash(%x);'


{aaa => x, b => y, c => z}

I see that SayHash(%H) will take any hash I send it.

Is there a way to make the compiler pissed if a sub does not see
the specific keys int he hash it wants?  Or do I need to use loop
with ":exists" and test each key?

Many thanks,
-T


Re: Hash and subs question

2017-09-28 Thread Brandon Allbery
On Thu, Sep 28, 2017 at 11:52 PM, ToddAndMargo 
wrote:

> I see that SayHash(%H) will take any hash I send it.
>
> Is there a way to make the compiler pissed if a sub does not see
> the specific keys int he hash it wants?  Or do I need to use loop
> with ":exists" and test each key?
>

You should be able to use a destructuring signature (
https://docs.perl6.org/type/Signature#index-entry-destructuring_arguments_%28Signature%29
)

-- 
brandon s allbery kf8nh   sine nomine associates
allber...@gmail.com  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net


Need MIME syntax help

2017-09-28 Thread ToddAndMargo

Hi All,

This piece of code works:


 my $email = Email::MIME.create(
  header-str => [from => $from,
 to => @to,
 subject => $Subject ],
  parts => [
 Email::MIME.create(
header => [ content-transfer-encoding => "quoted-printable" ],
attributes => [ content-type => "text/plain", charset => 
"utf8" ],

body-str => $Text ),

 Email::MIME.create(
header => [ "Content-Transfer-Encoding" => "base64" ],
# attributes => [ content-type => "image/x-portable-greymap",
attributes => [ content-type => "application/zip; 
name=$FileName",

disposition => "attachment" ],
   body => $image )
   ]);



Problem.  If there is no attachment, I want to skip the


   Email::MIME.create(
header => [ "Content-Transfer-Encoding" => "base64" ],
# attributes => [ content-type => "image/x-portable-greymap",
attributes => [ content-type => "application/zip; 
name=$FileName",

disposition => "attachment" ],
   body => $image )
   ]);


So I want to put the above into a test.

Question: How do I assign something additional to "$email"
AFTER I has called "my $email = Email::MIME.create"?


Many thanks,
-T


Re: Hash and subs question

2017-09-28 Thread ToddAndMargo

On 09/28/2017 08:56 PM, Brandon Allbery wrote:
On Thu, Sep 28, 2017 at 11:52 PM, ToddAndMargo > wrote:


I see that SayHash(%H) will take any hash I send it.

Is there a way to make the compiler pissed if a sub does not see
the specific keys int he hash it wants?  Or do I need to use loop
with ":exists" and test each key?


You should be able to use a destructuring signature 
(https://docs.perl6.org/type/Signature#index-entry-destructuring_arguments_%28Signature%29)


A thing of beauty!  Thank you!


Re: Why can't I "write"?

2017-09-28 Thread ToddAndMargo

On 09/23/2017 12:05 AM, Brent Laabs wrote:
OK, a method is something you call on an object, using a the dot 
operator.  A subroutine is an independent object installed into your 
current lexical scope.


If write was a sub, it would work exactly as you described:
    48:   my $Handle = open( $DateFile, :rw )
    53:   write( $Handle, $OldDateTime );
And if you wanted to, you could even refer to it by name...
   my $func = 
   $func( $Handle, $DateThing );

But it's not a sub, so it needs to be invoked on the object:
    53:   $Handle.write($OldDateTime );
- or -
    67:   $Handle.write: $DateTime;


Hi Brent,

Now I am confused.

I thought that when you wrote
$x.AA.BB.CC

What you were doing was passing the result of AA($x)
to BB and its result to CC

Sort of like
CC( BB( AA ($x) ) )

Only a heck of a lot easier to read,

Now I am not so sure.

When you say
   $Handle.write( $OldDateTime );

"write" is an object" not a sub.  By chance does this
apply to both objects AND subs?

And does
$Handle.write: $DateTime;

also apply to subs?

-T


Re: chown?

2017-09-28 Thread ToddAndMargo

On 09/28/2017 08:08 PM, Brandon Allbery wrote:
On Thu, Sep 28, 2017 at 11:03 PM, ToddAndMargo > wrote:


https://docs.perl6.org/language/5to6-perlfunc#chown


say we ain't got a "chown" sub.

Will this be coming to a theater neat us in the future?
(I will use a system call till then.)


It's another of those things where a proper Windows solution is not 
really compatible with the POSIX-flavored one (perl 5 provides a 
POSIXish hack and forces you to module space for a proper one on 
Windows), so Perl 6 has banished it to the ecosystem.


Of course, it'd be nice if we *had* such ecosystem, but that is no 
excuse to force a POSIX flavor on the core.


Makes sense.  Thank you!

I wonder why they did not "banish" (sound so harsh) chmod?

I will use a system call.