Re: a necessary no-op

2018-10-29 Thread Brandon Allbery
What jumps out to me is the difference between a normal method and a metamethod; the latter might not do sufficient validation, so you're catching the exception from trying to invoke .gist. And that just happens to do the right thing in your case; if you're getting a VMNull from an

Re: Exception Handling, DivideByZero

2018-10-29 Thread Brandon Allbery
Two issues: (1) all standard exceptions are in or under the X:: namespace. (2) .WHAT doesn't show names with their namespaces, whereas .^name does. pyanfar Z$ 6 'my $r = 4/0; say $r; CATCH {default {say .^name}}' X::Numeric::DivideByZero On Mon, Oct 29, 2018 at 1:04 PM Joseph Brenner wrote:

Re: what type $in,$out and $err is

2018-10-28 Thread Brandon Allbery
It takes Any — and quite a few more things than are currently documented, like IIRC filenames, and looks at the actual type passed to decide what to do with it. On Sun, Oct 28, 2018 at 3:31 PM Xiao Yafeng wrote: > I'm curious about what type of $in is on Proc class. As described in > perl6doc:

Re: Appropriate last words

2018-10-25 Thread Brandon Allbery
andle, not just for the IO::Handle in $*OUT. You may need "but" for that? On Thu, Oct 25, 2018 at 9:34 PM Brian Duggan wrote: > On Thursday, October 25, Brandon Allbery wrote: > > You can't actually wrap print that way, can you? Or rather, if that works > > it wou

Re: Appropriate last words

2018-10-25 Thread Brandon Allbery
You can't actually wrap print that way, can you? Or rather, if that works it wouldn't be specific to $*ERR. On Thu, Oct 25, 2018 at 6:16 PM Brian Duggan wrote: > On Thursday, October 25, Richard Hainsworth wrote: > > >: -> $status { $exit-args = $status; fail } > > > > Is the call to 'fail'

Re: I need unprintable regex help

2018-10-20 Thread Brandon Allbery
The escape sequence \x allows you to embed characters by their code. "\x0D\x0A" is the same as the variable. I'm not sure what you thought I was showing you on IRC last night, since I pointed this out multiple times. On Sat, Oct 20, 2018 at 3:43 AM ToddAndMargo via perl6-users <

Re: augment again

2018-10-18 Thread Brandon Allbery
pyanfar Z$ 6 'use MONKEY-TYPING; augment class Any {method hic { say "hoc" }}; my @a = ; @a.hic' No such method 'hic' for invocant of type 'Array'. Did you mean 'hic'? in block at -e line 1 zsh: exit 1 pyanfar Z$ 6 'use MONKEY-TYPING; augment class Any {method hic { say "hoc" }};

Re: Malformed UTF-8 ???

2018-10-15 Thread Brandon Allbery
Isn't the point that it's $ReturnStr that's throwing the immutable error, not $RunString? That's what I see in the thread history. On Mon, Oct 15, 2018 at 9:40 PM Curt Tilmes wrote: > > > On Mon, Oct 15, 2018 at 9:34 PM ToddAndMargo via perl6-users < > perl6-us...@perl.org> wrote: > >> On

Re: need --> help

2018-10-12 Thread Brandon Allbery
Actually, I was trying to think too much like tuples earlier… would a subsignature work here? …Turns out no. Seems unfortunate. pyanfar Z$ perl6 derp.p6 ===SORRY!=== Error while compiling /home/allbery/derp.p6 Unable to parse expression in typename; couldn't find final ')' (corresponding starter

Re: need --> help

2018-10-12 Thread Brandon Allbery
Precedence. `--> (Str, Int)` might work better; right now it can't tell if you meant that, or intended the usual meaning for a comma which would separate parameters. On Fri, Oct 12, 2018 at 3:32 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > Hi All, > > Why does this work > >

Re: Atom file icons of executables

2018-10-11 Thread Brandon Allbery
esktop manager of > one OS. > > On Fri, 12 Oct 2018, 02:10 Brandon Allbery, wrote: > >> This will be part of the desktop manager (probably Gnome), not Atom. >> Check the context menu for the icon in the file manager. I don't run Gnome >> so don't know where they hide how you

Re: Atom file icons of executables

2018-10-11 Thread Brandon Allbery
This will be part of the desktop manager (probably Gnome), not Atom. Check the context 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

Re: Strange output on 'say Foo::Bar::<>;'

2018-10-11 Thread Brandon Allbery
More to the point of this, currently there is no way to reconstruct the definition of a block, so you get its signature and an inline comment in place of the body. There is an easier way to see the same behavior: ::Bar::zape This is getting the block/sub as a value instead of invoking it.

Re: slurp so many?

2018-10-07 Thread Brandon Allbery
Use the read method instead. I did say in my previous message that .read is for bytes, .readchars is for graphemes (UTF8 characters plus any modifiers). On Sun, Oct 7, 2018 at 11:03 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > On 10/7/18 7:58 PM, ToddAndMargo via perl6-users

Re: slurp so many?

2018-10-07 Thread Brandon Allbery
The whole point of slurp is (possibly lazily in the future) reading everything. If you want to read by bytes, it's the read method; by lines, it's get; for extended characters / graphemes, it's readchars. They all have rather different intents. On Sun, Oct 7, 2018 at 7:42 PM ToddAndMargo via

Re: What is the syntax of a reference pointer in p6?

2018-10-07 Thread Brandon Allbery
He was thinking "don't make perl 5 as incompatible with perl 4". Pass-by-reference objects make for a major change to the language's behavior; it and its consequences are a large part of why perl 6 is incompatible with perl 5. On Sun, Oct 7, 2018 at 4:29 AM ToddAndMargo via perl6-users <

Re: flatten?

2018-10-05 Thread Brandon Allbery
ri, Oct 5, 2018 at 11:27 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > On 10/5/18 6:28 PM, Brandon Allbery wrote: > > You can't with that, because < ... > acts like single quotes; '@x' there > > is a string literal, not the list @x. If you use <&l

Re: flatten?

2018-10-05 Thread Brandon Allbery
rg> wrote: > On 10/5/18 6:09 PM, Brandon Allbery wrote: > > That's where the | comes in. If you say > > > > my @b = (1, |@a, 2); > > > > then you get (1, 'a', 'b', 'c', 2) like in Perl 5. But you can specify > > what gets flattened, so you can choose to

Re: flatten?

2018-10-05 Thread Brandon Allbery
my first > >> attempt. > >> > >> Hi Ralph, > >> > >> Thank you! I am going to have to save it for later and read it > >> over REAL SLOW! > >> > >> :-) > >> > >> -T > > On 10/5/18 5:50 P

Re: flatten?

2018-10-05 Thread Brandon Allbery
You know how in perl 5, if you do: my @a = qw(a b c); my @b = (1, @a, 2); @b will be (1, 'a', 'b', 'c', 2)? That's flattening. $b[1] will be 'a'. Perl 5 doesn't really understand nested data structures, so you have to simulate them with refs. If you use [@a] instead, $b[1] will contain an

Re: routine declaration line question

2018-10-05 Thread Brandon Allbery
erwise. (Multiparameter typeclasses have a bigger problem, return type polymorphism being only one of several ways to expose it.) On Fri, Oct 5, 2018 at 2:03 PM Trey Harris wrote: > > > On Fri, Oct 5, 2018 at 1:13 PM Brandon Allbery > wrote: > >> My problem with it bein

Re: routine declaration line question

2018-10-05 Thread Brandon Allbery
; : El jue., 4 oct. 2018 21:21, Brandon Allbery > escribió: > : > : > I don't think we've reached the point of such conventions yet. And > there's > : > some history here, in --> not having done anything in the early days > except > : > possibly slow things dow

Re: routine declaration line question

2018-10-04 Thread Brandon Allbery
I figure they'll evolve with wider use, but we certainly aren't there yet. On the other hand, discussions like this will help shape that evolution. On Thu, Oct 4, 2018 at 3:35 PM JJ Merelo wrote: > > > El jue., 4 oct. 2018 21:21, Brandon Allbery > escribió: > >> I don'

Re: routine declaration line question

2018-10-04 Thread Brandon Allbery
alling off the end" or using `return` as > a control-flow jump. > On Thu, Oct 4, 2018 at 15:04 Brandon Allbery wrote: > >> Arguably it should be --> Any, since Mu vs. Any has meaning with respect >> to Junctions. But in this case it's just not stating a redundancy. &g

Re: bitwise or?

2018-10-04 Thread Brandon Allbery
It's fine syntactically, but I think has no effect because it'd be '$v = $v' after the '+|='. Conceivably some future version of rakudo could warn about it having no effect. On Thu, Oct 4, 2018 at 3:09 PM ToddAndMargo wrote: > On 10/4/18 12:06 PM, ToddAndMargo wrote: > > On 10/4/18 12:00 PM, JJ

Re: routine declaration line question

2018-10-04 Thread Brandon Allbery
PM Trey Harris wrote: > Ah (replying to both Brandon and JJ since their replies crossed): > > So `--> Mu` is not a sufficient and/or correct return constraint for > things like AT-POS because why, then? > On Thu, Oct 4, 2018 at 14:56 Brandon Allbery wrote: > >> I think

Re: bitwise or?

2018-10-04 Thread Brandon Allbery
You're not doing anything with '$v +| 0b0001'. Were you looking for something like '+|='? (Which I think should work.) On Thu, Oct 4, 2018 at 2:58 PM ToddAndMargo wrote: > Hi All, > > I am trying to come up with something like += > > $ p6 'my $v = 32; $v += 2; say $v;' > 34 > >

Re: routine declaration line question

2018-10-04 Thread Brandon Allbery
I think they meant more like my AT-POS example: the point is the return value, but you can't say ahead of time what type it will have. On Thu, Oct 4, 2018 at 2:48 PM Trey Harris wrote: > > > On Thu, Oct 4, 2018 at 02:13 JJ Merelo wrote: > >> >> >> El jue., 4 oct. 2018 a las 3:36, Trey Harris

Re: routine declaration line question

2018-10-04 Thread Brandon Allbery
Consider a function which returns the element at a given position in a list: method AT-POS(\position) The only thing you can say about the result type is that it's whatever the type of the element at that position is. So it doesn't bother specifying a type at all, because the prototype can't

Re: routine declaration line question

2018-10-03 Thread Brandon Allbery
Perl 6 routines always return *something*; if you don't return anything explicitly, it will return the result of the last statement/expression, or Mu as a last resort. (Mu is the "least defined value" in Perl 6. Any is somewhat more common, but is slightly more defined since it can participate in

Re: No. It is lucid! Re: Could this be any more obscure?

2018-10-01 Thread Brandon Allbery
That just sounds like the backing store got restored from backup, losing anything added after the backup was taken. Which is not the best way to do things (incrementals are nice), but if things had gone wrong enough might have been the best they could do. On Mon, Oct 1, 2018 at 7:13 PM

Re: A problem with native CArrays

2018-09-30 Thread Brandon Allbery
Might be because there's a prefix form of + with a wider type? "Every DWIM has a WAT" On Sun, Sep 30, 2018 at 9:55 AM Fernando Santagata < nando.santag...@gmail.com> wrote: > What I was pointing out is that the '*' operator outputs an error, and I > was expecting that, while the '+' doesn't. >

Re: Could this be any more obscure?

2018-09-28 Thread Brandon Allbery
I'm not sure it's any better than my attempt; it has that "people's eyes will glaze over" feel to it. On Fri, Sep 28, 2018 at 9:50 PM Mark Devine wrote: > Kudos to the Benevolent Dictator! > > I'll have to loop over this a few times, but it's a blast... > > Mark > > -Original Message- >

Re: Could this be any more obscure?

2018-09-28 Thread Brandon Allbery
, 2018 at 6:46 PM ToddAndMargo wrote: > On 9/28/18 10:37 AM, Brandon Allbery wrote: > > We're going to have a problem if "infinity" is not allowed in the > > presence of some programmers. "All values" can mean too many things in > > too many situations. And I d

Re: Could this be any more obscure?

2018-09-28 Thread Brandon Allbery
We're going to have a problem if "infinity" is not allowed in the presence of some programmers. "All values" can mean too many things in too many situations. And I don't think using * works here, quite, precisely because it can mean too many things. On Fri, Sep 28, 2018 at 1:32 PM ToddAndMargo

Re: [perl #133541] Grammer bug vs

2018-09-27 Thread Brandon Allbery
"_" is not an alphabetic character. It's allowed in "alnum" because that is by intent what is \w in other regex implementations, which includes "_". On Thu, Sep 27, 2018 at 10:47 PM Vijayvithal wrote: > # New Ticket Created by Vijayvithal > # Please include the string: [perl #133541] > # in

Re: [perl #133541] Grammer bug vs

2018-09-27 Thread Brandon Allbery via RT
"_" is not an alphabetic character. It's allowed in "alnum" because that is by intent what is \w in other regex implementations, which includes "_". On Thu, Sep 27, 2018 at 10:47 PM Vijayvithal wrote: > # New Ticket Created by Vijayvithal > # Please include the string: [perl #133541] > # in

Re: Could this be any more obscure?

2018-09-26 Thread Brandon Allbery
I often feel like perlmonks is about 80% of what's wrong with perl 5 these days. On Wed, Sep 26, 2018 at 10:27 PM ToddAndMargo wrote: > On 9/26/18 6:36 PM, The Sidhekin wrote: > > On Thu, Sep 27, 2018 at 3:14 AM Peter Scott > > wrote: > > > > On 9/26/2018 3:21 PM,

Re: Could this be any more obscure?

2018-09-26 Thread Brandon Allbery
with respect to perl 6 doing the same kind of thing. On Wed, Sep 26, 2018 at 10:25 PM ToddAndMargo wrote: > On 9/26/18 7:17 PM, Brandon Allbery wrote: > > No, perldoc only "tells you everything" if you already know perl 5. You > > do, so you don't see this.

Re: Could this be any more obscure?

2018-09-26 Thread Brandon Allbery
No, perldoc only "tells you everything" if you already know perl 5. You do, so you don't see this. On Wed, Sep 26, 2018 at 10:15 PM ToddAndMargo wrote: > On 9/26/18 7:08 PM, Brandon Allbery wrote: > > English is not a programming language, so it will not help you with >

Re: Could this be any more obscure?

2018-09-26 Thread Brandon Allbery
() produces. words() doesn't need to know that, it just gives you a list. Positional describes the "indexable" attribute of a list. (If you look up List in the type documentation, you will see other roles like Iterable that lists know about.) On Wed, Sep 26, 2018 at 10:11 PM Brandon Allb

Re: Could this be any more obscure?

2018-09-26 Thread Brandon Allbery
That's not helping. What didn't you understand? Are you still expecting that it is words() that must know all the details of what a list is, because a list can't know what itself is? On Wed, Sep 26, 2018 at 10:09 PM ToddAndMargo wrote: > On 9/26/18 7:04 PM, Brandon Allbery wrote: > > I

Re: Could this be any more obscure?

2018-09-26 Thread Brandon Allbery
On Wed, Sep 26, 2018 at 10:04 PM ToddAndMargo wrote: > I presume you have P5's perldocs installed. Pick > out any functions (perldoc -f name) and take > a look at how extraordinarily simple their explanations > are to understand. You almost never have to ask for help. > From my two postings

Re: Could this be any more obscure?

2018-09-26 Thread Brandon Allbery
It doesn't. It just improves error messages. words() produces a list-like thing; that's what really matters, because list-like things do the Positional role. Declaring it up front lets Perl 6 give you an error message early if you use the result in the wrong way or if the actual implementation of

Re: Could this be any more obscure?

2018-09-26 Thread Brandon Allbery
Additionally: Perl 5 docs don't run into this because perl 5 has only 3 types: scalar, list, hash. Perl 6 has lots of types, each of which has its own behavior. We use roles to package up common behaviors. Positional is the role for "can be indexed" / "understands []". Don't just assume you know

Re: Could this be any more obscure?

2018-09-26 Thread Brandon Allbery
On Wed, Sep 26, 2018 at 9:03 PM ToddAndMargo wrote: > Where in > multi method words(Str:D $input: $limit = Inf --> Positional) > does it state that "words" will do that? Not all methods will. > So it need to be stated when they will.\ > In the part that says "Positional". You have already

Re: Could this be any more obscure?

2018-09-26 Thread Brandon Allbery
On Wed, Sep 26, 2018 at 8:49 PM ToddAndMargo wrote: > > $ p6 '"a b c d e".words[ 2, 4 ].say;' > (c e) > > or > > $ p6 '"a b c d e".words()[ 2, 4 ].say;' > (c e) > > I am selecting the 2nd and 4th word starting from zero. Inside > the brackets I am asking it to select th e 2nd and 4th words for

Re: Could this be any more obscure?

2018-09-26 Thread Brandon Allbery
for which it exists. On Wed, Sep 26, 2018 at 6:22 PM ToddAndMargo wrote: > On 9/26/18 3:12 PM, Brandon Allbery wrote: > > I told you that. Others told you that. You ignored it and asked the same > > question again, because what we said that exlains what words() is doing >

Re: Could this be any more obscure?

2018-09-26 Thread Brandon Allbery
it's not then you broke it". On Wed, Sep 26, 2018 at 6:09 PM ToddAndMargo wrote: > On 9/26/18 2:45 PM, Brandon Allbery wrote: > > And I'm trying to figure out how to explain $limit since the one > > everyone else has used apparently means nothing whatsoever. Unless > >

Re: words[] question

2018-09-26 Thread Brandon Allbery
you. Or does every documentation page have to incorporate the whole Perl 6 documentation? ("You might decide to pass this a Str, so I guess I have to explain in detail what a Str is now just in case"?) On Wed, Sep 26, 2018 at 6:05 PM ToddAndMargo wrote: > On 9/26/18 2:40 PM, Brandon

Re: Could this be any more obscure?

2018-09-26 Thread Brandon Allbery
What do you believe your $selection should mean? And I'm trying to figure out how to explain $limit since the one everyone else has used apparently means nothing whatsoever. Unless you've just been ignoring those as irrelevant, because it's not whatever you mean by "$selection" that nobody else

Re: words[] question

2018-09-26 Thread Brandon Allbery
You're still assuming they're the "same thing"in some sense. The type of the () postfix operator says it applies to a function or method (more specifically, to something that supports the Callable role), thus to "words" itself. The type of the [] postfix operator says it applies to something that

Re: Could this be any more obscure?

2018-09-26 Thread Brandon Allbery
ddAndMargo wrote: > >> On Wed, Sep 26, 2018 at 2:57 AM Todd Chester >> multi method words(Str:D $input: $limit = Inf --> Positional) > > > On 9/26/18 7:21 AM, Brandon Allbery wrote: > > > $limit sets a limit on how many words it will make. Inf means ther

Re: Could this be any more obscure?

2018-09-26 Thread Brandon Allbery
You're imposing a shape on this, then getting angry at us when it turns out to be wrong. I'm sorry nobody could read your mind ahead of time to find out the "proper" way to shape it. $limit sets a limit on how many words it will make. Inf means there's no limit. Your assumption that it must be

Re: extending built-in classes

2018-09-24 Thread Brandon Allbery
There's a certain aspect of "there is nothing so permanent as a temporary hack" here. On Tue, Sep 25, 2018 at 12:19 AM Joseph Brenner wrote: > Larry Wall wrote: > > > Joseph Brenner wrote: > >> Sounds good, thanks. > > > Well, yes, *sounds* good. :-) > > Monkey patching is allowed but

Re: extending built-in classes

2018-09-22 Thread Brandon Allbery
"use MONKEY-TYPING;" and then you have "augment" https://docs.perl6.org/syntax/augment.html On Sat, Sep 22, 2018 at 2:33 PM Joseph Brenner wrote: > I was just wondering if there's any way to extend an existing > class in perl 6. I'd like to be able to do things like drop > a custom debugging

Re: Ping Larry and Friends: Need NativeCall help

2018-09-18 Thread Brandon Allbery
I feel like https://github.com/xmonad/xmonad/issues/70 all over again. It's indeed not just Perl 6. Or C, for that matter. On Tue, Sep 18, 2018 at 7:41 PM ToddAndMargo wrote: > On 9/18/18 6:32 AM, Richard Hainsworth wrote: > > Have you looked at the documentation for nativecall? It has a

Re: Please explain this to me

2018-09-16 Thread Brandon Allbery
several times, and > >> I'm still > >> > not sure I get it all :) > >> > >> I am spacing on the difference between > >> > >> my $foo = 42; and > >> my $foo := 42; > >> > >> To add

Re: metamorphosis or alchemy?

2018-09-16 Thread Brandon Allbery
on-complex number, etc. There is similarly a role packaging up various operations common to all string-like types, called Stringy. On Mon, Sep 17, 2018 at 12:03 AM ToddAndMargo wrote: > On 9/16/18 8:51 PM, Brandon Allbery wrote: > > You're assuming "Real" means

Re: Please explain this to me

2018-09-16 Thread Brandon Allbery
If you say "my $foo = 42", you are saying that $x is a box, and you are putting 42 into it. You can put something else into that box later. If you say "my $foo := 42", you are saying that $x is 42 itself, not a box containing 42. You can think of it as a constant of sorts. Because it's not a box,

Re: metamorphosis or alchemy?

2018-09-16 Thread Brandon Allbery
ed an integral value to floating without asking, never to return), use the Real role as a type to hide the difference between them. If you want to be specific, use the correct type. On Sun, Sep 16, 2018 at 11:51 PM Brandon Allbery wrote: > You're assuming "Real" means "a float of

Re: metamorphosis or alchemy?

2018-09-16 Thread Brandon Allbery
You're assuming "Real" means "a float of some kind". It's not; it defines all the operations in common over non-Complex numbers (Int, Rat, Num, etc.). What you are looking for, Perl 6 calls Num. On Sun, Sep 16, 2018 at 8:53 PM ToddAndMargo wrote: > Hi All, > > I am confused, again: > > > $ p6

Re: Need help with a variable inside a regex

2018-09-15 Thread Brandon Allbery
To interpolate a variable as a regex instead of as a string literal, you need to wrap it in < >. On Sat, Sep 15, 2018 at 4:09 AM ToddAndMargo wrote: > On 09/15/2018 12:42 AM, ToddAndMargo wrote: > > Hi All, > > > > I am truing to use a variable inside a regex. > > > > This work (without the

Re: .kv ?

2018-09-14 Thread Brandon Allbery
But the point of this is the method is saying up front that it must be given a variable that is defined; it's not waiting to test it or possibly just bomb out later. This produces better error messages (the user doesn't have to know about what's going on inside the method, the error cites the

Re: need p5/p6 :: help

2018-09-14 Thread Brandon Allbery
It thinks it's interpolating a variable $x::... and then it gets stuck because it sees $y instead of the rest of a variable name. You can use braces to control what's part of the name: pyanfar Z$ 6 'my $x = "abc"; my $y = "def"; say "{$x}::{$y}"' abc::def Otherwise, you couldn't interpolate the

Re: Can methods have multiple inputs?

2018-09-14 Thread Brandon Allbery
In that case, you're not giving it two items; you are giving it a single List that happens to have two items within it. A method has one invocant. If you are invoking method foo on that, its invocant is a List. > my $a; my $b; say ($a, $b).^name List On Fri, Sep 14, 2018 at 6:47 PM ToddAndMargo

Re: .kv ?

2018-09-14 Thread Brandon Allbery
functions for no reason. On Fri, Sep 14, 2018 at 6:41 PM ToddAndMargo wrote: > On 09/14/2018 03:10 PM, Brandon Allbery wrote: > > On Fri, Sep 14, 2018 at 5:56 PM ToddAndMargo > <mailto:toddandma...@zoho.com>> wrote: > > > >'To opt into a non-null

Re: $? and $! equivalents

2018-09-14 Thread Brandon Allbery
Magic variables make multiple threads impossible, which is why perl 5 is stuck with ithreads: what happens if two threads each "run" something at around the same time? In Perl 6, you have a Proc object for each subprocess, and can query it for its status and/or result code; for things like sub

Re: .kv ?

2018-09-14 Thread Brandon Allbery
On Fri, Sep 14, 2018 at 5:56 PM ToddAndMargo wrote: > 'To opt into a non-nullable version of a type add the :D > "smiley" to it." > > This is confusing. And I don't think correct, but I could be wrong. > Curt stated it a lot better: > >If I say "my Int $x", >$x is

Re: ->

2018-09-14 Thread Brandon Allbery
And then you discover <->. On Fri, Sep 14, 2018 at 5:10 PM Parrot Raiser <1parr...@gmail.com> wrote: > Obviously, discussions about "->" will be easier if it has a name. How > about "lance", or, if you want to be less martial, "poker'? > -- brandon s allbery kf8nh allber...@gmail.com

Re: ->

2018-09-14 Thread Brandon Allbery
Pick a glyph, any glyph…. On Fri, Sep 14, 2018 at 4:54 PM ToddAndMargo wrote: > On 09/14/2018 01:09 PM, Mike Stok wrote: > > > > > >> On Sep 14, 2018, at 4:03 PM, ToddAndMargo > wrote: > >> > >> On 09/14/2018 01:00 PM, Larry Wall wrote: > >>> > >>> "-> is how we spell λ in Perl 6" > >>>

Re: ->

2018-09-14 Thread Brandon Allbery
It's still reading the block signature (parameters and return type) that it expects after the ->, until it sees the start of the block/closure. Think of what follows it as a sub declaration without the sub name or parentheses. A semicolon there says that what follows are optional parameters, so

Re: ->

2018-09-14 Thread Brandon Allbery
It's part of a "pointy block". But this doesn't seem to be documented directly as such, it's only mentioned at https://docs.perl6.org/language/control#for . On Fri, Sep 14, 2018 at 3:28 PM ToddAndMargo wrote: > Hi All, > > I use `->` all the time. What is its official name? > > for @x.kv ->

Re: Please explain this to me

2018-09-11 Thread Brandon Allbery
I'd like to point out that Todd is from Perl 5, which doesn't distinguish between subs and methods because its built-in OO is a minimalist hack. An introduction to true objects might be in order. On Tue, Sep 11, 2018 at 8:34 AM Simon Proctor wrote: > Also Todd I gave a talk on signatures types

Re: 3 kinds of yadda

2018-09-10 Thread Brandon Allbery
Bash is treating ! as the history substitution character, and either erroring out or substituting a previous command line. ^ has related behavior at the start of a line. ... is specially recognized by the compiler, for example treating a class stubbed with ... as a forward declaration. I don't

Re: Is Proxy a first class part of P6 or not?

2018-09-05 Thread Brandon Allbery
The real problem is that, in the absence of Proxy, rakudo can optimize a bunch of things away because it knows it has full control of the value. But if it encounters a Proxy, it has to assume that the Proxy might be manipulating state outside of the current thread, or even outside of rakudo, that

Re: Handing over control

2018-09-03 Thread Brandon Allbery
.com> wrote: > > Is Windows really that brain-dead? Pity it has to sabotage everyone else. > > > > This invokes vim successfully, but leaves an ugly error message around: > > > > perl6 -e 'exit shell("vim sample")' > > No such method 'Int' for invocant o

Re: Handing over control

2018-09-03 Thread Brandon Allbery
t; This invokes vim successfully, but leaves an ugly error message around: > > perl6 -e 'exit shell("vim sample")' > No such method 'Int' for invocant of type 'Proc' > in block at -e line 1 > > > On 9/3/18, Brandon Allbery wrote: > > It's not basic: Wi

Re: Handing over control

2018-09-03 Thread Brandon Allbery
It's not basic: Windows doesn't have it at all, it has to be simulated. The intent is that system dependent things like that should be external to the core. On Mon, Sep 3, 2018 at 12:56 PM Parrot Raiser <1parr...@gmail.com> wrote: > Thanks for the reply. That didn't show up with any search

Re: string to integer?

2018-08-07 Thread Brandon Allbery
n interger? > >> > >> $str = "601" -- > $int = 601 > >> > >> > >> Many thanks, > >> -T > > On 08/06/2018 02:01 PM, Brandon Allbery wrote: > > Prefix + numifies, prefix ~ stringifies. > > > > pyanfar

Re: string to integer?

2018-08-06 Thread Brandon Allbery
Prefix + numifies, prefix ~ stringifies. pyanfar Z$ 6 'my Str $a = "5"; dd +$a' 5 pyanfar Z$ 6 'my Int $a = 5; dd ~$a' "5" On Mon, Aug 6, 2018 at 4:59 PM ToddAndMargo wrote: > Hi All, > > How do I assign a string that looks like an integer > into an interger? > > $str = "601" -- > $int = 601

Re: need regex help

2018-08-03 Thread Brandon Allbery
That document also says that _ is considered a letter (that is, is matched by : https://docs.perl6.org/language/regexes#Predefined_Character_Classes), so that's the same thing as . I observed that earlier as well. On Fri, Aug 3, 2018 at 2:37 PM Parrot Raiser <1parr...@gmail.com> wrote: > If I've

Re: need regex help

2018-08-01 Thread Brandon Allbery
Set operations have to be inside the <>. You want something like: /<[alnum-alpha]>/. That said, this would be the same as //, I think? Please describe in words what you intended with that regex. (I suspect /<[alpha]>/ is what you really want, based on your earlier statement.) On Thu, Aug 2, 2018

Re: What does ^parents really tell you?

2018-07-29 Thread Brandon Allbery
I think you want ^mro? On Sun, Jul 29, 2018 at 1:28 PM Joseph Brenner wrote: > If you look at the type diagram: > > https://docs.perl6.org/type/Str#___top > > You can see that: >Str is Cool is Any is Mu > > But if you use the ^parents method on a string, you don't get > "Cool", instead

Re: return code?

2018-07-28 Thread Brandon Allbery
Yes, that's what I was addressing: you can tell run() to do that, keeping stderr separate with :err(). qxx does that internally. On Sat, Jul 28, 2018 at 4:12 PM ToddAndMargo wrote: > On 07/28/2018 12:56 PM, Brandon Allbery wrote: > > You can control where run() sends things. >

Re: > vs gt

2018-07-28 Thread Brandon Allbery
If you really want a headache, go look at the revision history for vercmp() in the RPM repo. On Sat, Jul 28, 2018 at 4:08 PM ToddAndMargo wrote: > On 07/28/2018 08:26 AM, Brandon Allbery wrote: > > I think you can use Version.new on that and compare them reasonably > > dire

Re: return code?

2018-07-28 Thread Brandon Allbery
You can control where run() sends things. See the :out and :err named parameters. I think :err($*ERR) is what you want here, although you might also want :err($*OUT) which effectively redirects its stderr to rakudo's stdout. (That said, I don't know if it processes those in the right order; it

Re: > vs gt

2018-07-28 Thread Brandon Allbery
>>> Why does this work: > >>> > >>> if $CurlStr.chars > 200 { > >>> > >>> But this does not? > >>> > >>> if $CurlStr.chars gt 200 { > >>> > >>> 79 was not larger than 20

Re: > vs gt

2018-07-27 Thread Brandon Allbery
> is numeric comparison: (79 > 200) is false. gt is string comparison: ("79" > "200") is true because "7" is lexically larger than "2". On Sat, Jul 28, 2018 at 1:54 AM ToddAndMargo wrote: > Hi All, > > Why does this work: > > if $CurlStr.chars > 200 { > > But this does not? > > if

Re: -c bug to report

2018-07-25 Thread Brandon Allbery
There's been discussion about having -c run the optimize stage as well, since some information needed for full checking doesn't exist in a useful form until then. On Wed, Jul 25, 2018 at 2:49 PM ToddAndMargo wrote: > Hi Simon, > > Maybe I am trying to get "-c" to do too many things. > > What I

Re: MAIN subroutine

2018-07-19 Thread Brandon Allbery
not just explicit initialization that relies on this. On Thu, Jul 19, 2018 at 5:48 PM Brandon Allbery wrote: > Consider that "declarations" are actually executable code. They have > compile-time meaning, but many also have runtime meaning. This is most > obvious w

Re: MAIN subroutine

2018-07-19 Thread Brandon Allbery
Consider that "declarations" are actually executable code. They have compile-time meaning, but many also have runtime meaning. This is most obvious when it's a variable with an initializer: the initialization is at runtime, not compile time. Which means MAIN has to run after all such, or variables

Re: using run

2018-06-20 Thread Brandon Allbery
I don't manage the docs. But a ticket has already been opened: https://github.com/perl6/doc/issues/2111 On Thu, Jun 21, 2018 at 12:59 AM Todd Chester wrote: > > > On 06/20/2018 08:58 AM, Brandon Allbery wrote: > > A pipe is for communication with a process. "Piped to a

Re: using run

2018-06-20 Thread Brandon Allbery
If you're going to use terms in a different way than what they actually mean, it's going to be difficult to produce something that does what you believe it should do *and* what it should actually do. A pipe is for communication with a process. "Piped to a file" means what? What's the process

Re: IO ???

2018-06-16 Thread Brandon Allbery
oes this and IO.d >does that. >Any such list exist? >Many thanks, >-T > > > On 06/03/2018 10:03 AM, Brandon Allbery wrote: > > It's a bit subtle to track down, but the IO method gives you an IO::Path > object. https://docs.perl6.org/

Re: Malformed UTF-8?

2018-06-16 Thread Brandon Allbery
Something's wrong with the data file you are reading. Perl 6 is expecting UTF-8 encoding and getting something else (usually an ISO-8859 encoding). On Sat, Jun 16, 2018 at 1:09 AM ToddAndMargo wrote: > rakudo-pkg-Fedora28-2018.05-01.x86_64.rpm > $ perl6 -v > This is Rakudo version 2018.05 built

Re: EVAL?

2018-06-14 Thread Brandon Allbery
I'm trying to not second-guess whoever maintains the glossary. And by that message also pointing up the omission. On Thu, Jun 14, 2018 at 2:01 PM The Sidhekin wrote: > On Thu, Jun 14, 2018 at 7:57 PM, Brandon Allbery > wrote: > >> You can never be certain in *any* case.

Re: EVAL?

2018-06-14 Thread Brandon Allbery
Not to mention "language designer isn't from your culture, and the word has different connotations in theirs". The eastern (or for that matter western) US does not define the world. On Thu, Jun 14, 2018 at 1:57 PM Brandon Allbery wrote: > You can never be certain in *any* case. Ch

Re: EVAL?

2018-06-14 Thread Brandon Allbery
in this sense, since at least the 1960s and probably earlier. So also check various CS glossaries. Such as FOLDOC: http://foldoc.org/pragma On Thu, Jun 14, 2018 at 1:52 PM ToddAndMargo wrote: > On 06/14/2018 10:49 AM, Brandon Allbery wrote: > > That's actually the origin of it: pr

Re: EVAL?

2018-06-14 Thread Brandon Allbery
That's actually the origin of it: pragmatic / real-world behavior, as opposed to idealized situations. On Thu, Jun 14, 2018 at 1:47 PM ToddAndMargo wrote: > On 06/14/2018 10:43 AM, The Sidhekin wrote: > > > >More relevant, Perl 6 documentation: > > https://docs.perl6.org/language/pragmas >

  1   2   3   4   5   6   >