assignable mutators (S06/Lvalue subroutines)

2008-05-16 Thread Brandon Allbery
S06/Lvalue subroutines: "Lvalue subroutines return a proxy object that can be assigned to. (...)" S13/Methods: "Setter methods that expect the new value as an argument do not fall into the well-behaved category, however." When I take these two together, in a way which may be out of contex

Re: smtp question

2017-02-09 Thread Brandon Allbery
On Thu, Feb 9, 2017 at 11:41 PM, ToddAndMargo wrote: > I am looking at > https://github.com/retupmoca/P6-Net-SMTP > > I pretty much understand everything, but > >- > >send($from, $to, $message, :$keep-going) > >Sends an email $message (which can be a Str or something with a Str >m

Re: smtp question

2017-02-10 Thread Brandon Allbery
If this were Haskell it'd be ByteString. But it's Perl 6 and byte arrays are too much of a PITA at present, since you can't do string-y things with them sensibly. On Fri, Feb 10, 2017 at 4:23 AM, Francesco Rivetti wrote: > On 2017-02-10 5:51 AM, Brandon Allbery wrote: > &

Re: per 5 converter?

2017-02-12 Thread Brandon Allbery
On Sun, Feb 12, 2017 at 7:48 PM, ToddAndMargo wrote: > The case is, if I can't figure out the syntax in Perl 6, white a > quickie in Perl 5, translate it and see what I did wrong. > Translators are infamous for producing gobbledygook no self-respecting programmer would write -- brandon s a

Re: what is ".perl"?

2017-02-17 Thread Brandon Allbery
On Fri, Feb 17, 2017 at 9:47 PM, ToddAndMargo wrote: > What is the difference between these two commands and why would > you use ".perl"? > >say "$ServiceName"; >say $ServiceName.perl; > The first uses .gist, which produces a summary of an object ("just the gist"). For value types, it wi

Re: reverse of .lines?

2017-02-17 Thread Brandon Allbery
On Fri, Feb 17, 2017 at 10:26 PM, yary wrote: > On Fri, Feb 17, 2017 at 9:52 PM, ToddAndMargo > wrote: > >> @Lines = $StringFullOfLineFeeds.lines > > > @Lines = $StringFullOfLineFeeds.lines.reverse They want what Haskell calls unlines, not a reversed list of lines. I would presume some variant

Re: print to STDERR problem

2017-02-18 Thread Brandon Allbery
On Sat, Feb 18, 2017 at 10:33 PM, ToddAndMargo wrote: > am having issues writing to STDERR. I am using this as > a reference: >https://perl6.org/archive/rfc/30.html > >The p52p6 translator needs to be able to spot >instances of barewords and globs and translate them >

Re: print to STDERR problem

2017-02-19 Thread Brandon Allbery
On Sun, Feb 19, 2017 at 10:14 AM, Timo Paulssen wrote: > Can you suggest how to improve the warnings about its obsolescence? Right > now it says: They wanted to use a perl 5 to perl 6 converter. They were warned that all such had not been maintained in some time and were likely to generate inco

Re: [perl #130834] Is `use v5` still a thing?

2017-02-22 Thread Brandon Allbery
It should do *something*; I suspect the intent was to offload that something, since there was at one point the idea of exec()ing a perl 5. At the very least it should throw --- but that might be handled sufficiently by the default. On Wed, Feb 22, 2017 at 8:45 AM, Zoffix Znet wrote: > # New Tick

Re: Where is "Subject"?

2017-02-24 Thread Brandon Allbery
On Fri, Feb 24, 2017 at 2:50 AM, Luca Ferrari wrote: > On Fri, Feb 24, 2017 at 7:51 AM, ToddAndMargo > wrote: > > Am I blind or is there nowhere to set the subject of an eMail > > in Net::SMTP? > > I suspect it is implementing a quite low-level interface: smtp does > not know anything about a su

Re: Your thoughts on Padre?

2017-02-24 Thread Brandon Allbery
On Fri, Feb 24, 2017 at 5:45 PM, ToddAndMargo wrote: > http://padre.perlide.org/ > > Any good for Perl 6? You have a better one you like? Padre's maintained? I thought it died years ago. -- brandon s allbery kf8nh sine nomine associates allber...@gmail.com

Re: Terminal::ANSIColor problem

2017-02-26 Thread Brandon Allbery
On Sun, Feb 26, 2017 at 8:14 PM, ToddAndMargo wrote: > Speaking of syntax errors, what is wrong with these > two lines (not used a the same time)? > > use Terminal::ANSIColor qw[ color ]; > use Terminal::ANSIColor::color; > The first one attempts to import a symbol "color" from the module "Termi

Re: Terminal::ANSIColor problem

2017-02-26 Thread Brandon Allbery
On Sun, Feb 26, 2017 at 9:38 PM, ToddAndMargo wrote: > On 02/26/2017 06:02 PM, Brandon Allbery wrote: >> >> On Sun, Feb 26, 2017 at 8:14 PM, ToddAndMargo > <mailto:toddandma...@zoho.com>> wrote: >> >> Speaking of syntax errors, what is wrong with thes

Re: [perl #130870] Some self-referential issue with hash assignment (%h1 = %h1, %h2)

2017-02-27 Thread Brandon Allbery
I disagree; this is not Haskell, if I do something like that then I expect %h2 to retain its original value while the RHS is being evaluated. On Mon, Feb 27, 2017 at 4:35 AM, Elizabeth Mattijsen wrote: > FWIW, this feels like a DIHWIDT case > > > On 27 Feb 2017, at 00:55, Aleks-Daniel Jakimenko-

Re: Your thoughts on Padre?

2017-02-27 Thread Brandon Allbery
On Mon, Feb 27, 2017 at 9:39 AM, Luca Ferrari wrote: > On Sat, Feb 25, 2017 at 1:26 AM, Brandon Allbery > wrote: > > Padre's maintained? I thought it died years ago. > > Seems to me it is one year old now: > <https://github.com/PadreIDE/Padre/commits/master>. &

Re: [perl #130870] Some self-referential issue with hash assignment (%h1 = %h1, %h2)

2017-02-27 Thread Brandon Allbery
And yes, I know that it *is* retaining its value as an object pointer, just not the contents. But if I write something like that, I pretty clearly mean the *contents*. On Mon, Feb 27, 2017 at 10:46 AM, Brandon Allbery wrote: > I disagree; this is not Haskell, if I do something like that the

Re: [perl #130870] Some self-referential issue with hash assignment (%h1 = %h1, %h2)

2017-02-27 Thread Brandon Allbery
optimizer is *really* clever), and it's on the programmer to accept the resulting deoptimization and if necessary rewrite to avoid it. On Mon, Feb 27, 2017 at 11:08 AM, Brandon Allbery wrote: > To unpack this a bit: in this case I understand the comma to be an infix > operator tha

Re: [perl #130870] Some self-referential issue with hash assignment (%h1 = %h1, %h2)

2017-02-27 Thread Brandon Allbery
ed on the LHS > is a fundamental behaviour in Perl. Changing that, especially in > obscure special circumstances would be bad. > > On 2/27/17, Brandon Allbery wrote: > > And yes, I know that it *is* retaining its value as an object pointer, > just > > not the content

Re: debugging and HookGrammar

2017-02-28 Thread Brandon Allbery
On Tue, Feb 28, 2017 at 9:24 AM, Theo van den Heuvel wrote: > I reinstalled without rakudobrew. It helped. I will probably never know > what I did wrong with rakudobrew (possible traces of an older install). One thing it does wrong is it doesn't fetch tags for its repos, with the result that up

Re: Terminal::ANSIColor problem

2017-02-28 Thread Brandon Allbery
On Tue, Feb 28, 2017 at 3:46 PM, ToddAndMargo wrote: > On 02/28/2017 04:11 AM, yary wrote: > >> >> On Tue, Feb 28, 2017 at 12:53 AM, ToddAndMargo > > wrote: >> >> sub PrintRed ( $Str ) { print color('bold'), color('red'), >> "$Str", color('reset'); } >>

Re: Net::SMTP attachments?

2017-03-01 Thread Brandon Allbery
On Tue, Feb 28, 2017 at 4:04 PM, ToddAndMargo wrote: > Anyone know how to do an attachment with Net::SMTP. Didn't you ask that a couple months ago, and I told you to look for a MIME module? I am starting to think that Net::SMTP and other low level modules need to be buried somehow; people tend

Re: Net::SMTP attachments?

2017-03-01 Thread Brandon Allbery
That's why I said "bury". The basic problem here is a conflict between a mindset that builds stuff up from smaller parts, and the needs of people who need to use the higher level stuff. Building up from components is good for many reasons. But people who want to buy a car don't expect to be handed

Re: Net::SMTP attachments?

2017-03-01 Thread Brandon Allbery
y use case, leaving out the pieces-parts. On Wed, Mar 1, 2017 at 5:47 PM, Brandon Allbery wrote: > That's why I said "bury". > > The basic problem here is a conflict between a mindset that builds stuff > up from smaller parts, and the needs of people who need to use the h

Re: [perl #130900] [BUG] nul in pathname

2017-03-02 Thread Brandon Allbery
On Thu, Mar 2, 2017 at 5:29 AM, Zefram wrote: > It is less than awesome that > Perl 6 accepts "foo\x[0]bar" as a pathname, when it doesn't resemble > any pathname valid on the OS > It's also less than awesome that POSIX, at least, doesn't let you confirm that a filename is syntactically valid, e

Re: [perl #130900] [BUG] nul in pathname

2017-03-02 Thread Brandon Allbery
To be clear: the POSIX spec does, specifically, disallow NUL. *Only* NUL. Which then leaves: - any character disallowed by specific filesystems (consider CIFS) - the sequence `//` which is specifically undefined by POSIX Among others. Is it correct to disallow NUL and thereby have a special case

Re: [perl #130900] [BUG] nul in pathname

2017-03-02 Thread Brandon Allbery
On Thu, Mar 2, 2017 at 8:56 AM, Brandon Allbery wrote: > - the sequence `//` which is specifically undefined by POSIX In the interests of heading off incoming pedanticness, possibly to "defend" the indefensible: this is only undefined as a prefix. It is an error as an infix.

Re: [perl #130900] [BUG] nul in pathname

2017-03-02 Thread Brandon Allbery
On Thu, Mar 2, 2017 at 9:14 AM, Joachim Durchholz wrote: > For the other invalid characters, the error will (well: should) be caught > by the filesystem. > Trying to check that in advance is a security hole in waiting - somebody > might mount or unmount filesystems between check and use. > This,

Re: embedded sub question

2017-03-04 Thread Brandon Allbery
On Sat, Mar 4, 2017 at 9:22 PM, ToddAndMargo wrote: > I am coming frrom Modula2 here. > > I M2 (using Perl syntax), > >sub A () { > sub B () { >}} > > B can only be seen inside A. Outside of A, B is > invisible. > > What are the rules for embedded subs in Perl 6? > subs default to

Re: program/script question

2017-03-04 Thread Brandon Allbery
On Sat, Mar 4, 2017 at 10:23 PM, ToddAndMargo wrote: > This is one of those really dumb questions, but can I call > what I write in Perl a "program" or a "script"? Or, does > it even matter? > These days it doesn't really matter. The line was already significantly blurred in the 90s, and by now

Re: Is there a list out there of all the \n characters?

2017-03-06 Thread Brandon Allbery
On Mon, Mar 6, 2017 at 12:08 PM, Luca Ferrari wrote: > - \n\r (old mac) Pre-OS X used simply \r. not \n\r. -- brandon s allbery kf8nh sine nomine associates allber...@gmail.com ballb...@sinenomine.net unix, openafs, kerberos, inf

Re: Is there a list out there of all the \n characters?

2017-03-06 Thread Brandon Allbery
On Mon, Mar 6, 2017 at 12:35 PM, H.Merijn Brand wrote: > But don't be surprised to see > > \r\r\n > And other weird stuff. There's at least one program out there where someone apparently used od on the output of a telnet session, saw an ancient hack for ancient teletypes involving a NUL, and t

Re: program/script question

2017-03-07 Thread Brandon Allbery
On Tue, Mar 7, 2017 at 4:44 AM, Luca Ferrari wrote: > Usually a script is something that is not compiled, rather interpreted > on the fly (where "interpreted" could include any sort of JIT or alike > compilation). > This is one of those things where the ground has shifted enough to make the dist

Re: two questions: use 6, p5: package

2017-03-07 Thread Brandon Allbery
On Tue, Mar 7, 2017 at 3:12 AM, ToddAndMargo wrote: > 1) Looking at other code, I see this at the top a lot: > use v6; > > Mine have as the first line > #!/usr/bin/perl6 > > What is "use v6;" used for? > It ensures that perl 5 will choke if it gets asked to load the file

Re: How do I call system functions?

2017-03-08 Thread Brandon Allbery
On Wed, Mar 8, 2017 at 5:51 AM, ToddAndMargo wrote: > int XStoreBytes(Display *display, char *bytes, int nbytes); Do I want to know why you're using X11R3 compatibility functions? -- brandon s allbery kf8nh sine nomine associates allber...@gmail.com

Re: [perl #128526] [CONC] Proc::Async's .write appears to exit when the process run doesn't exist

2017-03-08 Thread Brandon Allbery
On Wed, Mar 8, 2017 at 11:33 AM, jn...@jnthn.net via RT < perl6-bugs-follo...@perl.org> wrote: > Fixed and tested in S17-procasync/nonexistent.t. (The change is to default > to ignoring SIGPIPE, since we error-check all operations anyway. Those who > do want to exit on SIGPIPE can write `signal(SI

Re: How do I call system functions?

2017-03-08 Thread Brandon Allbery
On Wed, Mar 8, 2017 at 1:00 PM, ToddAndMargo wrote: > On 03/08/2017 07:49 AM, Brandon Allbery wrote: > >> >> On Wed, Mar 8, 2017 at 5:51 AM, ToddAndMargo > <mailto:toddandma...@zoho.com>> wrote: >> >> int XStoreBytes(Display *display, char *bytes, i

Re: How do I call system functions?

2017-03-08 Thread Brandon Allbery
On Wed, Mar 8, 2017 at 1:23 PM, ToddAndMargo wrote: > > class Display is repr('CStruct') {} > > > Class Display has no attributes, which is illegal with > the CStruct representation. > > What in the world? > It's an opaque pointer; CStruct is the wrong representation to use. Try CPoint

Re: [perl #130970] [BUG] Set.new confused by Nil

2017-03-09 Thread Brandon Allbery
Erm. Isn't Nil a silent Failure? Insisting that it be propagated and retained in all circumstances basically asserts that it must be a distinct concrete value, and specifically *not* any form of Failure. Could someone clarify this? (At present my understanding is that it is a silent Failure and mo

Re: [perl #130969] [LTA] more inconsistent coercions for Bool

2017-03-09 Thread Brandon Allbery
On Thu, Mar 9, 2017 at 2:55 PM, Zefram wrote: > The same goes for coercions from other enum types. This should be your hint. Enums *are* numeric, specifically Int. I don't know what language you are trying to force Perl 6 to be, but you might want to consider the possibility that Perl 6 is not

Re: [perl #130969] [LTA] more inconsistent coercions for Bool

2017-03-09 Thread Brandon Allbery
, there may actually be some lingering inconsistency left over from when Bool had to be special-cased because it needed to exist in the setting before Enums could be defined.) On Thu, Mar 9, 2017 at 3:41 PM, Zefram wrote: > Brandon Allbery via RT wrote: > >This should be your hint. E

Re: [perl #130969] [LTA] more inconsistent coercions for Bool

2017-03-09 Thread Brandon Allbery
The discussion I'm thinking of starts around here: http://colabti.org/irclogger/irclogger_log/perl6?date=2017-03-04#l1490 On Thu, Mar 9, 2017 at 4:04 PM, Zefram wrote: > Brandon Allbery via RT wrote: > >In any case I am specifically thinking of a discussion recently in IRC >

Re: [perl #130982] [PERF] "for $a..$b -> $i { ... }" loops are sometimes much slower than c-style loops

2017-03-12 Thread Brandon Allbery
On Sun, Mar 12, 2017 at 12:48 AM, Lloyd Fournier wrote: > perl6-loop: 84.8739988 > c-loop: 67.65849241 (1.25 times faster) > native-loop: 0.4981954 (135.81 times faster) > Still quite a lot of optimization to be done on that front. WRT native int, one of the issues is needing to track when boxin

Re: Need help with a match

2017-03-13 Thread Brandon Allbery
You have two problems: (1) matches start from 0, not 1. (2) .* gobbles as much as possible (this is also true in Perl 5) so it matches to the ) at the end of (Sub|63218616). As in Perl 5, you add a ? to make it take the shortest match instead: #!/usr/bin/perl6 my $x='sub Test () { #`(Sub|63218616

Re: Need help with a match

2017-03-13 Thread Brandon Allbery
want one before the literal open paren so you don't also eat any spaces there.) #!/usr/bin/perl6 my $x='sub Test () { #`(Sub|63218616) ... }'; $x ~~ m/sub <.ws> (.*?) <.ws> \(/; say "$x\n$0"; On Mon, Mar 13, 2017 at 10:52 PM, Brandon Allbery wrote: > Yo

Re: more match humility

2017-03-13 Thread Brandon Allbery
Just to be a little more clear about what is happening here: Perl 5 tended to treat things as strings if you use them as strings, or as numbers if you use them as numbers. Perl 6 is more strict about that, but makes an exception for specifically numbers and strings; if you have noticed the class "

Re: [perl #131026] Failing to read from IO::Pipe fast enough, apparently loses data

2017-03-20 Thread Brandon Allbery
Note that 65535 is the POSIX-specified minimum largest write size that is guaranteed to be atomic (_PIPE_BUF), and derives from the usual size of kernel-side pipe buffers (Linux's are actually larger, but sizes larger than the POSIX minimum _PIPE_BUF are likely to incur portability issues, so libuv

Re: maintainability and "or"

2017-03-21 Thread Brandon Allbery
On Tue, Mar 21, 2017 at 7:38 AM, ToddAndMargo wrote: > $Name.IO.f or $Name.IO.open(:w).close; fwiw I consider this a perl3_to_5-ism; it's an optimization, and a fairly poor one for readability and maintainability, but one that used to be fairly important (people comparing perl 5 speed to perl 6

Re: maintainability and "or"

2017-03-21 Thread Brandon Allbery
On Tue, Mar 21, 2017 at 7:50 AM, Elizabeth Mattijsen wrote: > $PathAndName.IO.open(:w).close unless $PathAndName.IO.f; This has a readability issue, though: you've buried the lede. The condition should be up front where it stands out, not hidden at the back. The wide usage of the Perl 5 "or"

Re: Is this file check backwards?

2017-03-21 Thread Brandon Allbery
On Tue, Mar 21, 2017 at 5:52 AM, ToddAndMargo wrote: > Sound backwards to me. What am I missing? Conditionals in all language have a semantic gap issue. Test conditions are often the reverse of what makes for good code --- which is why you find inverted conditionals in perl (e.g. unless), and

Re: maintainability and "or"

2017-03-21 Thread Brandon Allbery
On Tue, Mar 21, 2017 at 2:37 PM, Patrick R. Michaud wrote: > On Tue, Mar 21, 2017 at 02:25:02PM -0400, Brandon Allbery wrote: > > On Tue, Mar 21, 2017 at 7:38 AM, ToddAndMargo > wrote: > > > $Name.IO.f or $Name.IO.open(:w).close; > > > > fwiw I consid

Re: [perl #131043] [BUG] Binding to `state` variable silently fails

2017-03-22 Thread Brandon Allbery
I can't help but think that binding a state variable should be illegal, and doing so will have unexpected effects. On Wed, Mar 22, 2017 at 1:48 PM, Zoffix Znet wrote: > # New Ticket Created by Zoffix Znet > # Please include the string: [perl #131043] > # in the subject line of all future corre

Re: Global search and replace inside string

2017-03-22 Thread Brandon Allbery
On Wed, Mar 22, 2017 at 2:50 PM, Chris Ramsey wrote: > > my $str = "some string with 'text' in it and more text"; > say $str.subst(/'.*'/, "'m'", :g); > > When running this code, I get the original string back, which makes me > think my regex isn't quite right. > > Basically I want to replace anyt

Re: Can this OR be shortened?

2017-03-24 Thread Brandon Allbery
On Fri, Mar 24, 2017 at 8:58 PM, ToddAndMargo wrote: > if $Terminal ~~ /xterm/ || /linux/ {} if $Terminal ~~ /xterm || linux/ {} -- brandon s allbery kf8nh sine nomine associates allber...@gmail.com ballb...@sinenomine.net unix,

Re: Can this OR be shortened?

2017-03-25 Thread Brandon Allbery
On Fri, Mar 24, 2017 at 10:45 PM, Brad Gilbert wrote: > Basically use | in regexes unless you need ||. There's been some discussion, here and in IRC, of the | form interacting in ways that are correct but which people often don't expect. This can result in match failures or unexpected slowness.

Re: regex and performance question

2017-03-27 Thread Brandon Allbery
On Mon, Mar 27, 2017 at 1:10 PM, ToddAndMargo wrote: > Am I reintroducing a "regex" It's a junction, not a regex. But junctions are even slower than regexes: they are, in effect, trying to emulate a quantum computer. I suspect it's doubly slow because not only are junctions themselves not optim

Re: Am I suppose to be able to change a variable's type on the fly?

2017-03-28 Thread Brandon Allbery
On Tue, Mar 28, 2017 at 3:09 AM, Francesco Rivetti wrote: > you don't change the type of a variable. instead you use a type which is > "broader" and accept any object type. This; and if you didn't specify a type, the type is Any. Which is not quite the root of the class/type hierarchy; that'd b

Re: [perl #131076] [LTA] Rakudo sees Perl 5 code even if there is none (for $x(42), $x(50) {…})

2017-03-29 Thread Brandon Allbery
That *is* Perl 5 syntax, though; it looks like the schema for $var (list) { ... } # the space is not required between the var and the parenthesized list On Wed, Mar 29, 2017 at 9:35 PM, Aleks-Daniel Jakimenko-Aleksejev < perl6-bugs-follo...@perl.org> wrote: > # New Ticket Created by Aleks-

Re: #!/usr/bin/perl6

2017-04-01 Thread Brandon Allbery
On Sat, Apr 1, 2017 at 6:01 PM, ToddAndMargo wrote: > On 04/01/2017 03:52 AM, Francis (Grizzly) Smit wrote: > >> #!/usr/bin/env perl6 >> >> is probably better let /usr/bin/env find the path to perl6 >> > > What do you mean? > `env` does a $PATH search, and usually is in /usr/bin so it's slightly

Re: [perl #131111] [@LARRY] %c = %a, %b and @c = @a, @b should behave similarly

2017-04-06 Thread Brandon Allbery
IIRC this hash behavior is deliberate so that hashes can be accumulated. Also, your proposed behavior would require an object hash, not a standard hash; (%a => %b) would necessarily stringify %a. On Thu, Apr 6, 2017 at 4:46 PM, Aleks-Daniel Jakimenko-Aleksejev < perl6-bugs-follo...@perl.org> wrote

Re: Perl6 NCurses module under Arch: libncursesw.so.6

2017-04-12 Thread Brandon Allbery
ABI version 6 is not compatible with version 5 (in particular, color handling changed). It is not safe to just use whatever ncurses happens to be around. On Wed, Apr 12, 2017 at 2:27 PM, mark carter wrote: > I'm running: > This is Rakudo version 2017.01 built on MoarVM version 2017.01 > implemen

Re: [perl #129843] [LTA] Indexing on a Str throws generic “out of range” message which is less than awesome (“hello”[2])

2017-05-08 Thread Brandon Allbery
On Mon, May 8, 2017 at 2:52 PM, Aleks-Daniel Jakimenko-Aleksejev via RT < perl6-bugs-follo...@perl.org> wrote: > Usually I'm against all perl5 error messages This is a Pythonism (and C and other such languages). Older Perl has the same behavior that you can't index a string that way, but must us

Re: [perl #129843] [LTA] Indexing on a Str throws generic “out of range” message which is less than awesome (“hello”[2])

2017-05-08 Thread Brandon Allbery
On Mon, May 8, 2017 at 4:49 PM, Joachim Durchholz wrote: > If the mental model for Perl6 strings is "array of characters" though Perl has never had that mental model, is my point. It's generally imported by folks who come from languages where strings *are* "arrays of characters" --- and where t

Re: Rakudo on JVM?

2017-05-16 Thread Brandon Allbery
On Tue, May 16, 2017 at 4:18 PM, Stephen Wilcoxon wrote: > I see in the release notes for Rakudo 2017.04, it basically says not to > use JVM backend. Why is this? Has support for the JVM been dropped? Not dropped; it's just that the JVM backend has always been more difficult, and is often (as

Re: [perl #131363] [LTA] Using dot instead of a semicolon as a statement end (say ‘hello’.)

2017-05-25 Thread Brandon Allbery
On Thu, May 25, 2017 at 8:58 AM, Aleks-Daniel Jakimenko-Aleksejev < perl6-bugs-follo...@perl.org> wrote: > Arguably, it can probably figure out that . was used instead of ;. The > problem is that . is interpreted as an infix, and therefore it only blows > up when it sees the next occurrence of two

Re: [perl #131398] Feature Request: trait for unimplemented subs/methods

2017-05-30 Thread Brandon Allbery
As already mentioned, we have three such stubbers already. You can even put a partial/incomplete implementation after them: just terminate the ... or w/e with a semicolon. What none of them will do for you is allow a syntactically incorrect body. But the proposed feature *also* will not allow that

Re: [perl #131481] [BUG] No perl6-debug

2017-06-03 Thread Brandon Allbery
I would argue that perl6-debug shouldn't exist; if you are debugging, you pretty much need to know the specific backend that's involved. Which is likely why rakudobrew killed the generic one (the directory listing, while mangled, *did* show perl6-debug-m). On Sun, Jun 4, 2017 at 2:12 AM, Zoffix Zn

Re: [perl #131492] Camelia produces different error message from commandline

2017-06-05 Thread Brandon Allbery
On Mon, Jun 5, 2017 at 5:32 PM, Parrot Raiser <1parr...@gmail.com> wrote: > perl6 –e "my \foo = Callable but role:: { };" Something bit you; note that you are not using "-e" but "–e" (U+2013 EN DASH). -- brandon s allbery kf8nh sine nomine associates allber...@gma

Re: [perl #126732] [RFC] Problem with superscripts when there is no number in front of it (³² == 9)

2017-06-08 Thread Brandon Allbery
On Thu, Jun 8, 2017 at 6:22 AM, Zoffix Znet via RT < perl6-bugs-follo...@perl.org> wrote: > > m: sub infix:<2> { $^a + $^b }; say 2 2 2 > rakudo-moar 1ac799: OUTPUT: «4␤» > > Because when an op is expected. There's just one op named `2`. And when > a term is expected, there's just one term

Re: need p5 to p6 help

2017-06-11 Thread Brandon Allbery
On Sun, Jun 11, 2017 at 6:52 PM, ToddAndMargo wrote: > P6: > $ perl6 -e 'my $x="\t"; if !~ /[^A-Za-z0-9]/ {say "outside"} else {say > "inside"};' > You missed a "$x" in there. Negation works differently in perl 6 regex. /<-[A..Z a..z 0..9]>/ pyanfar «work*master» Z$ 6 'my $x = "["; if $x !~~ /

Re: How do you call the variable types?

2017-06-15 Thread Brandon Allbery
On Sat, Jun 10, 2017 at 2:38 AM, Brent Laabs wrote: > I thought: > $ is Scalar > @ is Array > % is Hash > & is a function > Pedantically: $ forces item context, but otherwise allows any type (defaulting to Scalar); the item context gets you "scalar" behavior in most cases even with non-scalars

Re: [perl #131583] [BUG] Sort content of ^methods

2017-06-15 Thread Brandon Allbery
On Fri, Jun 16, 2017 at 12:41 AM, Gabor Szabo wrote: > Would it be used by people who use the REPL to experiment with the > languages? In that case the listing should be as user friendly as > possible and require as little typing as possible. Having ABC order is > IMHO the easiest to look through

Re: next

2017-06-16 Thread Brandon Allbery
On Fri, Jun 16, 2017 at 9:02 PM, ToddAndMargo wrote: > I am afraid I am not understanding "next" again. > > When you invoke it, does it pop you back at the start of > the loop or just cough up the next value? > The former. Or you can think of it as jumping past everything else in the loop body s

Re: next

2017-06-18 Thread Brandon Allbery
On Mon, Jun 19, 2017 at 12:41 AM, ToddAndMargo wrote: > On 06/17/2017 12:22 AM, yary wrote: > >> last if ++$true_count == 6; >> > > ++$true_count > > Is that the same as `$true_count + 1` ? > > And does it alter the value of $true_count > Yes and yes, just like in C and Perl 5; note that being p

Re: parameters from the command line: how do they do that?

2017-06-21 Thread Brandon Allbery
On Thu, Jun 22, 2017 at 1:18 AM, Todd Chester wrote: > > On 22/06/17 14:49, Todd Chester wrote: > >> I know how to read things on the command line. But > >> how to other's figure out what goes together when things > >> don't arrive in order? > > > On 06/21/2017 10:03 PM, Francis (Grizzly) Smit w

Re: parameters from the command line: how do they do that?

2017-06-21 Thread Brandon Allbery
On Thu, Jun 22, 2017 at 1:51 AM, Todd Chester wrote: > You want named parameters. >> >> sub MAIN(:$fixed-string, :$extended-regex, ...) { >> # $fixed-string and $extended-regex are Bools here, >> # True if the corresponding option specified >> } >> >> You should recognize this

Re: [perl #131695] Confusion in precedence with <<$foo>>[0]

2017-07-03 Thread Brandon Allbery
Perhaps this example should be provided somewhere as a 'gotcha'. On Mon, Jul 3, 2017 at 11:09 AM, jn...@jnthn.net via RT < perl6-bugs-follo...@perl.org> wrote: > On Mon, 03 Jul 2017 05:46:46 -0700, comdog wrote: > > It seems that term precedence with << >> gets confused. > > > The << >> quoting c

Re: Net::SMTP raw, where is the username and password?

2017-07-10 Thread Brandon Allbery
On Mon, Jul 10, 2017 at 3:17 PM, ToddAndMargo wrote: > On 07/10/2017 06:48 AM, Timo Paulssen wrote: > >> It seems like you don't know the internals of the SMTP protocol. In that >> case, it's a bad idea to try to use the raw mode, when the simple mode >> is much simpler to handle. >> > I need to

Re: [perl #131737] [BUG] WindowsOS: IO.dirname strips off drive name

2017-07-13 Thread Brandon Allbery
'dirname' represents a component of a path, not a path. I suspect the internal field components should be renamed, though, as people do not generally think in terms of the implementation of the shell's 'dirname', but instead of its effective behavior. (The implementation splits a path into its comp

Re: processing misunderstand or bug?

2017-07-15 Thread Brandon Allbery
On Sat, Jul 15, 2017 at 6:50 AM, Gabor Szabo wrote: > If I run this in one terminal and run "ps axuw" in another terminal I > see 2 processes running. > If I press Ctrl-C in the terminal where I launched the program, both > processes are closed. > > OTOH If I run "kill PID" with the process ID of

Re: processing misunderstand or bug?

2017-07-15 Thread Brandon Allbery
On Sat, Jul 15, 2017 at 8:34 AM, Brandon Allbery wrote: > Ctrl-C sends SIGINT to all processes in the terminal's foreground process > group. There is no concept of "current process" on a terminal; Unixlike > systems are multitasking, and all processes in the process gr

Re: processing misunderstand or bug?

2017-07-15 Thread Brandon Allbery
On Sat, Jul 15, 2017 at 10:23 AM, Gabor Szabo wrote: > If I understand correctly, then this means Ctrl-C sends a SIGINT to > both the main process I ran and the child process I created using > Proc::Async. When I run kill -2 PID it only sends the SIGINT to the > process I mentioned with PID. > (

Re: String to array problem

2017-07-16 Thread Brandon Allbery
On Sun, Jul 16, 2017 at 7:41 PM, ToddAndMargo wrote: > my $x='ls -al "Program Files" "Moe Curly Larry"'; > > Desired result: > my @y; >$y[0] = 'ls'; >$y[1] = '-la'; >$y[2] = 'Program Files'; >$y[3] = 'Moe Curly Larry'; > This was just discussed a few days ago, under the subject "

Re: String to array problem

2017-07-16 Thread Brandon Allbery
Nested quotes and escapes are handled by the Grammar-based solution I pointed to. You can't handle them in general with a simple regex. On Sun, Jul 16, 2017 at 8:54 PM, ToddAndMargo wrote: > > -Original Message- >> From: ToddAndMargo [mailto:toddandma...@zoho.com] >> Sent: Sunday, July 1

Re: String to array problem

2017-07-16 Thread Brandon Allbery
On 07/16/2017 05:57 PM, Brandon Allbery wrote: > >> Nested quotes and escapes are handled by the Grammar-based solution I >> pointed to. You can't handle them in general with a simple regex. >> > > Creating a new grammer? > -- brandon s allbery kf8nh

Re: [perl #131757] Untodoed evil hack in Backtrace.pm

2017-07-17 Thread Brandon Allbery
On Mon, Jul 17, 2017 at 2:40 AM, Joachim Durchholz wrote: > I think the whole concept of defining what's "interesting" in a backtrace >> by looking at the file name is pretty evil: > > So does Perl 6, actually; there's some discussion in the spec, and possibly in the docs for callframe. The probl

Re: [perl #131757] Untodoed evil hack in Backtrace.pm

2017-07-17 Thread Brandon Allbery
On Mon, Jul 17, 2017 at 4:20 AM, Joachim Durchholz wrote: > Am 17.07.2017 um 09:32 schrieb Brandon Allbery: > > On Mon, Jul 17, 2017 at 2:40 AM, Joachim Durchholz > <mailto:j...@durchholz.org>> wrote: > > > > I think the whole concept of defining what

Re: String to array problem

2017-07-17 Thread Brandon Allbery
And this is another reason for the Grammar solution: it lets you do just what is needed, in a constrained environment so you don't have any risk (unless you do something questionable in the Grammar, but then that's on you.) On Mon, Jul 17, 2017 at 6:15 AM, Brent Laabs wrote: > Just to make it cl

Re: [perl #131757] Untodoed evil hack in Backtrace.pm

2017-07-17 Thread Brandon Allbery
On Mon, Jul 17, 2017 at 2:49 AM, Joachim Durchholz via RT < perl6-bugs-follo...@perl.org> wrote: > 1) It cannot handle non-runtime code that one might want to filter. > 2) It hardcodes the definition of what's interesting. > 3) You cannot have runtime code that you *want* to be included in the > b

Re: [perl #128062] [BUG] (MoarVM) chdir does not respect group reading privilege

2017-07-17 Thread Brandon Allbery
It should not be testing, it should just try to do the operation and complain after if it fails. Race conditions should not be a language 'feature'. On Mon, Jul 17, 2017 at 6:02 PM, Zoffix Znet via RT < perl6-bugs-follo...@perl.org> wrote: > On Mon, 17 Jul 2017 10:26:43 -0700, molecules wrote: >

Re: zip mystery

2017-07-17 Thread Brandon Allbery
On Mon, Jul 17, 2017 at 8:18 PM, ToddAndMargo wrote: > But this does not: > > my $proc = run('zip', '-j', "$ZipLog", "$CimLog", "$LogFile", > "$DiagDir/*", :out); > > warning: name not matched: /opt/xxx/yyy/zzz/diags/* > > What am I doing wrong? > run() does not use a shell. The shell is what un

Re: Announce: Rakudo Star Release 2017.07

2017-07-25 Thread Brandon Allbery
On Tue, Jul 25, 2017 at 11:45 AM, Darren Duncan wrote: > However I assume it is the 3 bullet points that the release announcement > highlights: advanced macros, non-blocking I/O, bits of Synopsis 9 and 11. > The fact the announcement highlights these implies they are part of the > creators' defin

Re: Fwd: Re: Is win 32 being worked on?

2017-07-25 Thread Brandon Allbery
On Tue, Jul 25, 2017 at 3:37 PM, Mark Carter wrote: > On 25/07/2017 20:31, Darren Duncan wrote: > >> I would question why any desktop computer manufacturers were still even >> shipping non-64-bit capable hardware in 2010. >> > I dual-boot (rarely) with it, and it runs 64-bit Ubuntu. I am using a

Re: Fwd: Re: Is win 32 being worked on?

2017-07-25 Thread Brandon Allbery
On Tue, Jul 25, 2017 at 5:41 PM, Darren Duncan wrote: > On 2017-07-25 2:08 PM, Steve Mynott wrote: > >> To clarify Rakudo itself *should* compile on 32 bit Windows systems >> (using either MSVC or mingw and maybe cygwin). >> >> The problem with Rakudo Star is that some of the C based modules >> p

Re: [perl #131801] Stranded strings with combiners or ZWJ on borders break my NFG expectations ( (“\x[0305]a” x 2).chars.say )

2017-07-26 Thread Brandon Allbery
Combining chars look forward now? This breaks *my* expectations. On Wed, Jul 26, 2017 at 6:36 AM, Aleks-Daniel Jakimenko-Aleksejev < perl6-bugs-follo...@perl.org> wrote: > # New Ticket Created by Aleks-Daniel Jakimenko-Aleksejev > # Please include the string: [perl #131801] > # in the subject l

Re: Bi-directional communication with another process

2017-07-27 Thread Brandon Allbery
On Thu, Jul 27, 2017 at 7:49 PM, Norman Gaywood wrote: > my $input = q:to/EOS/; > line of text > another line > EOS > > my $cat = run 'cat', '-n', :in($input.print), :out; > my $output = $cat.out.get; > $cat.in.close; > $cat.out.close; > > say "done"; > say $output; > > But that is not correct.

Re: Bi-directional communication with another process

2017-07-27 Thread Brandon Allbery
missing a working 'select' call? > - David > > On Fri, Jul 28, 2017 at 12:04 PM, Brandon Allbery > wrote: > >> On Thu, Jul 27, 2017 at 7:49 PM, Norman Gaywood >> wrote: >> >>> my $input = q:to/EOS/; >>> line of text >>> another li

Re: : question

2017-07-28 Thread Brandon Allbery
That's not Perl, it's JSON generated by Perl. On Fri, Jul 28, 2017 at 5:39 PM, ToddAndMargo wrote: > On 07/28/2017 02:02 PM, Timo Paulssen wrote: > >> The first one is valid perl 6 code and the bottom one is not. It's >> likely you were looking at JSON (or equivalently JavaScript) and >> confuse

Re: : question

2017-07-28 Thread Brandon Allbery
On Fri, Jul 28, 2017 at 5:49 PM, ToddAndMargo wrote: > On 07/28/2017 02:41 PM, Brandon Allbery wrote: >>>> >>> > That's not Perl, it's JSON generated by Perl. > > Mumble, mumble ... I have a hard enough time learning > Perl without someone throwi

Re: split and one liner problem

2017-08-04 Thread Brandon Allbery
That's a weird thing to do. You call a function that returns the lines of input as a list, in a context that joins them back together as words, and then try to split the result on lines again. lines already gives you what you want. Don't split. perl6 -e 'for lines { say "<$_>"; }' On Friday, Aug

Re: split and one liner problem

2017-08-04 Thread Brandon Allbery
Hi All, > > > > > > What am I doing wrong here? > > > > $ echo -e "abc\ndef\nghi" | perl6 -e 'for ( split "\n", lines ) { > > say "<$_>"; }' > > > > > > > > > > I

  1   2   3   4   5   6   >