Re: Real, Num, Rat question

2018-05-27 Thread Brandon Allbery
"Real" is a role (a collection of common methods reusable by multiple classes/types), not itself a class/type. Similarly, "Positional" is a role which provides common methods to "Array", "List", and "Seq" among others. On Sun, May 27, 2018 at 5:50 PM ToddAndMargo wrote: >

Re: need mkdir, chown, chmod, del

2018-06-03 Thread Brandon Allbery
Same answer: https://docs.perl6.org/type/IO::Path is where all the path-related things live. On Sun, Jun 3, 2018 at 1:05 PM ToddAndMargo wrote: > Hi All, > > I need the Perl6 commands for the following LINUX > commands. > > mkdir make directory > chown change ownership > chmod

Re: <> question

2018-06-03 Thread Brandon Allbery
Yes, it's a quick way to mak a list of quoted strings. Think qw() in perl 5, but < > is equivalent to single quotes whereas << >> is equivalent to double quotes. https://docs.perl6.org/language/quoting#Word_quoting:_%3C_%3E On Sun, Jun 3, 2018 at 1:42 PM ToddAndMargo wrote: > What is this? > >

Re: need second pair of eyes

2018-06-03 Thread Brandon Allbery
I'm still trying to figure out why you have just "lib" instead of "use lib" there. And why it's not throwing an error. On Sun, Jun 3, 2018 at 6:02 PM ToddAndMargo wrote: > On 06/03/2018 02:50 PM, Brandon Allbery wrote: > > Double quotes, or the one we were just

Re: need second pair of eyes

2018-06-03 Thread Brandon Allbery
gt;> >>>> bash: syntax error near unexpected token `=' > >> >>>> > >> >>>> Huh ??? > >> >>>> > >> >>>> > >> >>>> This is RunNoShell.pm6 > >> &g

Re: need second pair of eyes

2018-06-03 Thread Brandon Allbery
, 2018 at 6:22 PM ToddAndMargo wrote: > On 06/03/2018 03:07 PM, Brandon Allbery wrote: > > I'm still trying to figure out why you have just "lib" instead of "use > > lib" there. And why it's not throwing an error. > > As poop! I was mixing Perl 5 and Perl 6.

Re: need second pair of eyes

2018-06-03 Thread Brandon Allbery
018 at 6:33 PM ToddAndMargo >> <mailto:toddandma...@zoho.com>> wrote: > >> > >> On 06/03/2018 03:24 PM, Brandon Allbery wrote: > >> > It is allowed if you have 'unit module RunNoShell;' at the top of > >> > RunN

Re: need second pair of eyes

2018-06-03 Thread Brandon Allbery
bash doesn't like nested single quotes, even with escapes. So the first \' gave you a literal backslash and ended the quoted part, then the second \' gave you a literal ' and continued without quoting. The final ' would then open a new quoted string, but bash doesn't get that far because it sees

Re: need second pair of eyes

2018-06-03 Thread Brandon Allbery
; >> >> <mailto:toddandma...@zoho.com <mailto:toddandma...@zoho.com>>> > >> wrote: > >> >> > >> >> On 06/03/2018 03:24 PM, Brandon Allbery wrote: > >> >> > It is allo

Re: How to print colorized text to the terminal

2018-06-03 Thread Brandon Allbery
"say" uses the .gist method, which quotes the output for readability. You probably want "put" instead. On Sun, Jun 3, 2018 at 8:42 PM Xin Cheng wrote: > Hi, > > I am trying to make a program to do grep with perl6 regular expression, > and I would like to colorize the matched part to the

Re: need second pair of eyes

2018-06-03 Thread Brandon Allbery
t; On Sun, Jun 3, 2018 at 6:33 PM ToddAndMargo > >> >> mailto:toddandma...@zoho.com> > >> <mailto:toddandma...@zoho.com <mailto:toddandma...@zoho.com>> > >> >> >> <mailto:toddandma...@zoho.com > >>

Re: need second pair of eyes

2018-06-03 Thread Brandon Allbery
On Sun, Jun 3, 2018 at 6:33 PM ToddAndMargo wrote: > On 06/03/2018 03:24 PM, Brandon Allbery wrote: > > It is allowed if you have 'unit module RunNoShell;' at the top of > > RunNoShell.pm6. Otherwise you defined it in the main namespace and > > looking for it in the

Re: <> question

2018-06-03 Thread Brandon Allbery
On Sun, Jun 3, 2018 at 4:09 PM ToddAndMargo wrote: > $ touch a b c > $ p6 'chmod 0o777 < a b c >;' > ===SORRY!=== Error while compiling -e > Preceding context expects a term, but found infix > instead. > at -e:1 > --> chmod 0o777 < a b c >⏏; > You're missing the comma after the mode

Re: need second pair of eyes

2018-06-03 Thread Brandon Allbery
s *.pm6"); say $a;' > >>>> > >>>> bash: syntax error near unexpected token `=' > >>>> > >>>> Huh ??? > >>>> > >>>> > >>>> This is RunNoShell.pm6 > >>>&g

Re: IO ???

2018-06-03 Thread Brandon Allbery
It's a bit subtle to track down, but the IO method gives you an IO::Path object. https://docs.perl6.org/type/IO::Path On Sun, Jun 3, 2018 at 1:01 PM ToddAndMargo wrote: > Hi All, > > I have a been looking around the docs pages and I am > not finding a list of what the various IO functions do. >

Re: need second pair of eyes

2018-06-03 Thread Brandon Allbery
; and import them, if they are to be visible from outside the file they are in. If your perl 5 is older, you cannot make a "my" sub.) On Sun, Jun 3, 2018 at 10:49 PM ToddAndMargo wrote: > On 06/03/2018 06:02 PM, Brandon Allbery wrote: > > t doesn't affect export at all. It

Re: my keeper on random numbers

2018-05-27 Thread Brandon Allbery
In the long form, yes. That's why the ^ shorthand exists. With the long form you have to start from an object of the same type to get to its metamodel, then pass the object you're actually asking about to the metamodel method; the simplest way to do this is to reuse the same object. On Sun, May

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: .sub confusion

2018-05-01 Thread Brandon Allbery
On Tue, May 1, 2018 at 4:49 AM, ToddAndMargo wrote: > .sub is a method call and I can't write them. They come with Perl. > You can write them. But they are 'method', not 'sub', and must be defined within a class. If you put 'is export' on a method so defined, it can

Re: odd and even

2018-05-01 Thread Brandon Allbery
On Tue, May 1, 2018 at 9:17 PM, Larry Wall wrote: > On Tue, May 01, 2018 at 01:43:44AM -0700, ToddAndMargo wrote: > : The worst thing I had problems with in Perl was folks telling it > : was "Lexiconical". What? I wish they would have also said "which > : means Perl figures out

Re: who own my code?

2017-10-22 Thread Brandon Allbery
This is still best discussed elsewhere... isn't there a stackexchange for this kind of stuff? On Sun, Oct 22, 2017 at 4:24 PM, vijayvithal jahagirdar < jahagirdar...@gmail.com> wrote: > Now If I implement this for one customer does the code becomes his IP and > I cannot implement it for another?

Re: How to accomplish a method interpolation?

2017-12-30 Thread Brandon Allbery
I think this is just name collision; this sounds like a dungeon crawler type thing and it's a "bag of holding". On Sat, Dec 30, 2017 at 6:45 AM, Elizabeth Mattijsen wrote: > > On 30 Dec 2017, at 06:13, clasclin . wrote: > > > > I'm reading a book "Make your

Re: How to accomplish a method interpolation?

2017-12-30 Thread Brandon Allbery
with each key works, you build that into the object. On Sat, Dec 30, 2017 at 7:07 AM, Elizabeth Mattijsen <l...@dijkmat.nl> wrote: > But that's the kind of semantic that Bag/BagHashes are meant to perform: a > "bag of holding”! Or am I missing something? > > > >

Re: Chained sequence operators

2018-01-26 Thread Brandon Allbery
You probably want an enum to get that behavior. Strings are strings; Perl has no idea what they mean. On Fri, Jan 26, 2018 at 4:45 PM, ToddAndMargo wrote: > Sweet! > $ perl6 -e 'my $x=(1...5...1); say $x;' > (1 2 3 4 5 4 3 2 1) > > Characters too! > $ perl6 -e 'my

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: > 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: 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: 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: 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: 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: -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: 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: 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: 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: 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: Does words have a delimiter?

2018-04-14 Thread Brandon Allbery
"words" is just a shorthand for a common invocation of "split", really. On Sat, Apr 14, 2018 at 1:27 AM, ToddAndMargo wrote: > Hi All, > > I am over on > https://docs.perl6.org/routine/words > and I can't make heads of tails out of it. > > Does "words" have a

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: 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: 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: 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-users@perl.org> wrote: > On 10/7/18 7:58 PM, ToddAndMargo via perl6-users

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: 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: 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-users@perl.org> wrote: > Hi All, > > Why does this work > >

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: 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: 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-users@perl.org> wrote: > >> On

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: 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: 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: 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: 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: 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: 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: 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
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
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: 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: 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: 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: 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: 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: 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: 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
ri, Oct 5, 2018 at 11:27 PM ToddAndMargo via perl6-users < perl6-users@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
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: 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: 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: 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: 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
.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: 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: 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: 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: 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
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
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
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: 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
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
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
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
() 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
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
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
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
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
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-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: ->

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

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: 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: 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: .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
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
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

<    1   2   3   4   >