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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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}

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

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

-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

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

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

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

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

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 =>

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

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

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

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

Re: Why can't I "write"?

2017-09-28 Thread ToddAndMargo
On 09/23/2017 12:35 PM, Brandon Allbery wrote: On Sat, Sep 23, 2017 at 3:31 PM, Brandon Allbery > wrote: On Sat, Sep 23, 2017 at 2:09 AM, ToddAndMargo > wrote:       method

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(

Re: chown?

2017-09-28 Thread Brandon Allbery
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

chown?

2017-09-28 Thread ToddAndMargo
Hi List, 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.) -T

[perl #130425] [PARSER] foo C.new: method form call tries to call `foo` routine if newline is present after ":"

2017-09-28 Thread Brian S. Julin via RT
On Wed, 28 Dec 2016 08:30:34 -0800, c...@zoffix.com wrote: > $ ./perl6 -e $'class C { method foo { say 10 } }; foo C.new:\n' > ===SORRY!=== Error while compiling -e > Undeclared routine: > foo used at line 1 > > $ ./perl6 -v > This is Rakudo version 2016.12-122-gd35efb6 built on MoarVM

[perl #132154] slurp is mangling newlines, it should not (slurp ‘foo’)

2017-09-28 Thread Aleks-Daniel Jakimenko-Aleksejev via RT
I'm shocked to see \r\n→\n translation being defended without any reasoning. Why are we doing it at all? “\r\n => \n transformation is done consistently” consistently what? And why? Even .IO.lines splitting on \r\n is wrong because it cuts \r that may be part of the data (which is fine in the

Re: [perl #132179] Don't put Mexico and Texas in opposition in Perl 6 jargon

2017-09-28 Thread Joachim Durchholz
Am 28.09.2017 um 15:44 schrieb brian d foy (via RT): And, that's not bake any other geopolitical oppositions into the language either. The Texas metaphor was a joke about that an American stereotype and you shouldn't go further with it. Given that even good-natured humor occasionally gets

Re: [perl #132179] Don't put Mexico and Texas in opposition in Perl 6 jargon

2017-09-28 Thread Joachim Durchholz via RT
Am 28.09.2017 um 15:44 schrieb brian d foy (via RT): > And, that's not bake any other geopolitical oppositions into the > language either. The Texas metaphor was a joke about that an American > stereotype and you shouldn't go further with it. Given that even good-natured humor occasionally gets

Re: [perl #132148] [RFC] native 'str' type unspecced, undocumented, and ill-defined

2017-09-28 Thread Brandon Allbery via RT
Possibly the right thing here is for perl 6 to reserve the name for implementations, and otherwise leave it unspecced. -- brandon s allbery kf8nh sine nomine associates allber...@gmail.com ballb...@sinenomine.net unix, openafs,

Re: [perl #132148] [RFC] native 'str' type unspecced, undocumented, and ill-defined

2017-09-28 Thread Brandon Allbery
Possibly the right thing here is for perl 6 to reserve the name for implementations, and otherwise leave it unspecced. -- brandon s allbery kf8nh sine nomine associates allber...@gmail.com ballb...@sinenomine.net unix, openafs,

[perl #132179] Don't put Mexico and Texas in opposition in Perl 6 jargon

2017-09-28 Thread Zoffix Znet via RT
On Thu, 28 Sep 2017 06:44:12 -0700, comdog wrote: > And, that's not bake any other geopolitical oppositions into the > language either. The Texas metaphor was a joke about that an American > stereotype and you shouldn't go further with it. > > https://rt.perl.org/Public/Bug/Display.html?id=132176

[perl #132179] Don't put Mexico and Texas in opposition in Perl 6 jargon

2017-09-28 Thread Zoffix Znet via RT
On Thu, 28 Sep 2017 06:44:12 -0700, comdog wrote: > And, that's not bake any other geopolitical oppositions into the > language either. The Texas metaphor was a joke about that an American > stereotype and you shouldn't go further with it. > > https://rt.perl.org/Public/Bug/Display.html?id=132176

[perl #132176] [RFC] Aliasing of Unicode ops to Texas Versions

2017-09-28 Thread Zoffix Znet via RT
s:g/Mexico/Fancy Unicode/; per RT#132179: https://rt.perl.org/Ticket/Display.html?id=132179#ticket-history

[perl #132176] [RFC] Aliasing of Unicode ops to Texas Versions

2017-09-28 Thread Zoffix Znet via RT
s:g/Mexico/Fancy Unicode/; per RT#132179: https://rt.perl.org/Ticket/Display.html?id=132179#ticket-history

Re: [perl #132170] fork + react + IO::Socket::Async issue

2017-09-28 Thread Parrot Raiser
Would it be fair to describe that as "rendering unto the system software that which belongs to the system, and unto the user that which properly belongs to the application"? (Which, in my opinion, is a principle neglected far too often by programmers who've been taught to write OSs, but have to

Re: [perl #132170] fork + react + IO::Socket::Async issue

2017-09-28 Thread Parrot Raiser via RT
Would it be fair to describe that as "rendering unto the system software that which belongs to the system, and unto the user that which properly belongs to the application"? (Which, in my opinion, is a principle neglected far too often by programmers who've been taught to write OSs, but have to

[perl #132179] Don't put Mexico and Texas in opposition in Perl 6 jargon

2017-09-28 Thread brian d foy
# New Ticket Created by "brian d foy" # Please include the string: [perl #132179] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=132179 > And, that's not bake any other geopolitical oppositions into the language either. The

[perl #132170] fork + react + IO::Socket::Async issue

2017-09-28 Thread Brian Duggan via RT
That makes sense. Thanks for the thorough explanation. Brian

[perl #132148] [RFC] native 'str' type unspecced, undocumented, and ill-defined

2017-09-28 Thread jn...@jnthn.net via RT
On Fri, 22 Sep 2017 16:40:35 -0700, b...@abrij.org wrote: > > We've had a native 'str' type for a while, and still have one even > though NativeCall decided to go with Str and 'is encoded'. > It's not native in the sense of same sense that NativeCall uses the word. > Currently it seems to just

[perl #132148] [RFC] native 'str' type unspecced, undocumented, and ill-defined

2017-09-28 Thread jn...@jnthn.net via RT
On Fri, 22 Sep 2017 16:40:35 -0700, b...@abrij.org wrote: > > We've had a native 'str' type for a while, and still have one even > though NativeCall decided to go with Str and 'is encoded'. > It's not native in the sense of same sense that NativeCall uses the word. > Currently it seems to just

[perl #132170] fork + react + IO::Socket::Async issue

2017-09-28 Thread jn...@jnthn.net via RT
On Tue, 26 Sep 2017 12:33:21 -0700, bdug...@matatu.org wrote: > When I export a function that does a fork() and then > a react + whenever + IO::Socket::Async.listen in the > child process, the process only seems to be listening > on the socket the second time I run the code, i.e. only > after

[perl #132170] fork + react + IO::Socket::Async issue

2017-09-28 Thread jn...@jnthn.net via RT
On Tue, 26 Sep 2017 12:33:21 -0700, bdug...@matatu.org wrote: > When I export a function that does a fork() and then > a react + whenever + IO::Socket::Async.listen in the > child process, the process only seems to be listening > on the socket the second time I run the code, i.e. only > after

[perl #132176] [RFC] Aliasing of Mexico ops to Texas Versions

2017-09-28 Thread via RT
# New Ticket Created by Zoffix Znet # Please include the string: [perl #132176] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=132176 > During a recent update[^1] the static optimizer was taught to convert the Mexico ≥, ≤,