Re: Why can't I "write"?

2017-09-22 Thread ToddAndMargo
On Sat, Sep 23, 2017 at 8:19 AM, ToddAndMargo > wrote: On 09/22/2017 11:09 PM, ToddAndMargo wrote: Hi All, https://docs.perl6.org/routine/write (IO::Handle) method write

overwrite?

2017-09-22 Thread ToddAndMargo
Hi All, I want to overwrite a file. Looking at: https://docs.perl6.org/routine/open I see ":truncate". This seems liek it will do the trick. Problem: I would like to read from the file first before truncating (ro). Is there a way to do this, or should I 1) open the handle with :ro 2) re

Re: Why can't I "write"?

2017-09-22 Thread Fernando Santagata
Hi, "write" is a method; its signature is method write(IO::Handle:D: Blob:D $buf --> True) so it has to be called as a method, not a sub. Also note the way the first argument is declared, as a IO::Handle:D:, without a comma separating it from the second argument. That's the type of the object t

Re: Why can't I "write"?

2017-09-22 Thread ToddAndMargo
On 09/22/2017 11:09 PM, ToddAndMargo wrote: Hi All, https://docs.perl6.org/routine/write (IO::Handle) method write Defined as: method write(IO::Handle:D: Blob:D $buf --> True) Writes $buf to the filehandle. This method can be called even when the handle is no

Why can't I "write"?

2017-09-22 Thread ToddAndMargo
Hi All, https://docs.perl6.org/routine/write (IO::Handle) method write Defined as: method write(IO::Handle:D: Blob:D $buf --> True) Writes $buf to the filehandle. This method can be called even when the handle is not in binary mode. This: 48: my $Handle = o

chaining substitutions?

2017-09-22 Thread ToddAndMargo
Hi All, Question. Can I chain these two substitutions together? $ perl6 -e 'my $x="State : abc "; $x ~~ s/.*?" : "//; $x ~~ s/" ".*//; say "<$x>";' Many thanks, -T

[perl #131676] doing a role fails to find inherited methods in some cases

2017-09-22 Thread Brian S. Julin via RT
On Mon, 07 Aug 2017 08:25:10 -0700, c...@zoffix.com wrote: > On Thu, 29 Jun 2017 03:46:02 -0700, c...@zoffix.com wrote: > > Mu provides iterator method, but when you mix in a role that wants it > > implemented, it doesn't find it: > > > > m: role Meow { method iterator {…} }; class Bar does Meow {}

[perl #132149] [BUG] Some Method objects use wrong .gist method

2017-09-22 Thread via RT
# New Ticket Created by Zoffix Znet # Please include the string: [perl #132149] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=132149 > Method objects have their own `.gist` method[^1] that just print `.name`. However, under

[perl #129829] .pick on large ranges returns binary-sparse result

2017-09-22 Thread Brian S. Julin via RT
On Mon, 10 Oct 2016 04:29:33 -0700, elizabeth wrote: > > On 10 Oct 2016, at 05:19, Zoffix Znet via RT > follo...@perl.org> wrote: > > > > Looks like libtommath has now been fixed: > > https://github.com/libtom/libtommath/pull/57 > > > > On Sat Oct 08 14:47:40 2016, timo wrote: > >> Apparently libt

[perl #128810] Leading multi-line declarator block on role breaks stubs in composition

2017-09-22 Thread Brian S. Julin via RT
On Mon, 01 Aug 2016 21:44:28 -0700, lue wrote: > m: #|(abc) role A { method foo { ... } }; class B does > A { method foo { "OK" } }; say B.foo > rakudo-moar f1313d: OUTPUT«===SORRY!=== Error while > compiling ␤Method 'foo' must be implemented by A because it is > required by a role␤at :1␤» > m:

[perl #123770] Coercer syntax doesn't check for definedness

2017-09-22 Thread Brian S. Julin via RT
On Mon, 09 Feb 2015 06:35:57 -0800, elizabeth wrote: > [15:31:47] m: sub a(Int(Cool:D) $a) { say $a }; a Cool > # feels this should fail > [15:31:48] <+camelia> rakudo-moar d29715: OUTPUT«use of > uninitialized value of type Cool in numeric context in sub a at > /tmp/L77KWsiM9N:1␤␤0␤» > [15

[perl #126433] Parameter coercion with type smiley doesn't work

2017-09-22 Thread Brian S. Julin via RT
On Fri, 23 Oct 2015 03:29:12 -0700, elizabeth wrote: > [12:14:56] m: sub a(Int:D() $a) { dd $a }; a "42" # > type smileys not complete first citizen yet :-( > [12:14:57] <+camelia> rakudo-moar 3df263: OUTPUT«Type check failed > in binding $a; expected Int but got Str␤ in sub a at > /tmp/b

[perl #132006] Instant.Instant is missing (say now.Instant)

2017-09-22 Thread Brian S. Julin via RT
On Thu, 31 Aug 2017 23:56:21 -0700, elizabeth wrote: > Fixed with 51709e01c0788c466af , tests needed. > > > On 31 Aug 2017, at 22:05, Aleks-Daniel Jakimenko-Aleksejev (via RT) > > wrote: > > > > # New Ticket Created by Aleks-Daniel Jakimenko-Aleksejev > > # Please include the string: [perl #132

[perl #104980] [TESTNEEDED] natively typed attributes and BUILD methods don't mix

2017-09-22 Thread Brian S. Julin via RT
On Fri, 22 Sep 2017 16:25:28 -0700, b...@abrij.org wrote: > On Thu, 21 Sep 2017 22:56:20 -0700, barto...@gmx.de wrote: > > On Thu, 21 Sep 2017 19:50:01 -0700, b...@abrij.org wrote: > > > > > > Current behavior (don't have a rakudo-j here): > > > > > > $ perl6-m -e 'class A { has str $.x; method BUI

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

2017-09-22 Thread Brian S. Julin
# New Ticket Created by "Brian S. Julin" # Please include the string: [perl #132148] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=132148 > We've had a native 'str' type for a while, and still have one even though NativeCall

[perl #104980] [TESTNEEDED] natively typed attributes and BUILD methods don't mix

2017-09-22 Thread Brian S. Julin via RT
On Thu, 21 Sep 2017 22:56:20 -0700, barto...@gmx.de wrote: > On Thu, 21 Sep 2017 19:50:01 -0700, b...@abrij.org wrote: > > > > Current behavior (don't have a rakudo-j here): > > > > $ perl6-m -e 'class A { has str $.x; method BUILD(:$!x) { } }; say > > A.new(:x).x' > > foo > > > > If r-j now works

[perl #132146] [LTA] Consistency of `&` coercer

2017-09-22 Thread via RT
# New Ticket Created by Zoffix Znet # Please include the string: [perl #132146] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=132146 > IRC: https://irclog.perlgeek.de/perl6/2017-09-22#i_15205100 If you give the `&` coercer s