Re: Where is "Subject"?

2017-02-27 Thread ToddAndMargo

On 02/27/2017 11:34 PM, ToddAndMargo wrote:

Hi All,

Follow up on Net::SMTP:

Thank you for all the help!

I am posting this back to help others.  And, yes, I know I
don't have to use "~" so much.

-T

Comments:

1) "@to" is an array, not a string

2) the "To:", "From:", and "Subject:" are headers that
   you make up yourself.  And they are comments that
   show up on the receiver.  They are not the actual
   "To:", "From:", and "Subject:"

3) you terminate the headers with a blank line and
   add them to you message.

4) :diag turns on all output of the transaction.  Errors
   are output to STDERR ($ERR) regardless of the state
   of :diag

Here is a copy of a sub I wrote to handle this:


sub eMailReport () {
   # Reference: https://github.com/retupmoca/P6-Net-SMTP
   my $smtp = "a";
   my $port = ;
   my $username = "ccc";
   my $password = "ddd";


Ooops: forgot this:

   my $from = "$username";


   my @to   = qw [ xxx yyys ];   # This is an array, not a string

   # Note: prepend headers followed by a blank line to the message
   my $Headers;
   for @to { $Headers ~= "To: " ~ "$_" ~ "\n"; }
   $Headers ~= "From: " ~ "$IAm " ~ "<" ~ "$username" ~ ">\n";
   $Headers ~= "Subject: $IAm ERROR(s) = $ErrorCount\n\n";

   my $Message  = "$Headers" ~ "$Report";

   # Note: :debug will send all output to stderr.  (Errors will always
be sent regardless.)
   # if ( not my $client = Net::SMTP.new(:server( $smtp ), :port( $port
), :debug ) ) {
   if ( not my $client = Net::SMTP.new(:server( $smtp ), :port( $port )
) ) {
   $ErrorCount += 1;
   PrintRed( "SMTP: unable to open $smtp\n" );
   AddToReport ( "SMTP: unable to open $smtp\n" );
   return;
}

   if ( not $client.auth( $username, $password ) ) {
   $ErrorCount += 1;
   PrintRed( "SMTP: something is wrong with the username and/or
password\n\n" );
   AddToReport ( "SMTP: something is wrong with the username and/or
password\n\n" );
   return;
}

   if ( not $client.send( $from, @to, $Message ) ) { PrintRed "SMTP
Error: Failed to send\n\n"; }

   $client.quit;
}




--
~~
Computers are like air conditioners.
They malfunction when you open windows
~~


Re: Where is "Subject"?

2017-02-27 Thread ToddAndMargo

Hi All,

Follow up on Net::SMTP:

Thank you for all the help!

I am posting this back to help others.  And, yes, I know I
don't have to use "~" so much.

-T

Comments:

1) "@to" is an array, not a string

2) the "To:", "From:", and "Subject:" are headers that
   you make up yourself.  And they are comments that
   show up on the receiver.  They are not the actual
   "To:", "From:", and "Subject:"

3) you terminate the headers with a blank line and
   add them to you message.

4) :diag turns on all output of the transaction.  Errors
   are output to STDERR ($ERR) regardless of the state
   of :diag

Here is a copy of a sub I wrote to handle this:


sub eMailReport () {
   # Reference: https://github.com/retupmoca/P6-Net-SMTP
   my $smtp = "a";
   my $port = ;
   my $username = "ccc";
   my $password = "ddd";
   my @to   = qw [ xxx yyys ];   # This is an array, not a string

   # Note: prepend headers followed by a blank line to the message
   my $Headers;
   for @to { $Headers ~= "To: " ~ "$_" ~ "\n"; }
   $Headers ~= "From: " ~ "$IAm " ~ "<" ~ "$username" ~ ">\n";
   $Headers ~= "Subject: $IAm ERROR(s) = $ErrorCount\n\n";

   my $Message  = "$Headers" ~ "$Report";

   # Note: :debug will send all output to stderr.  (Errors will always 
be sent regardless.)
   # if ( not my $client = Net::SMTP.new(:server( $smtp ), :port( $port 
), :debug ) ) {
   if ( not my $client = Net::SMTP.new(:server( $smtp ), :port( $port ) 
) ) {

   $ErrorCount += 1;
   PrintRed( "SMTP: unable to open $smtp\n" );
   AddToReport ( "SMTP: unable to open $smtp\n" );
   return;
}

   if ( not $client.auth( $username, $password ) ) {
   $ErrorCount += 1;
	   PrintRed( "SMTP: something is wrong with the username and/or 
password\n\n" );
	   AddToReport ( "SMTP: something is wrong with the username and/or 
password\n\n" );

   return;
}

   if ( not $client.send( $from, @to, $Message ) ) { PrintRed "SMTP 
Error: Failed to send\n\n"; }


   $client.quit;
}



Re: Terminal::ANSIColor problem

2017-02-27 Thread ToddAndMargo

On 02/26/2017 04:13 AM, ToddAndMargo wrote:

Hi All,

Reference: https://github.com/tadzik/Terminal-ANSIColor/

How do I clean this Perl 5 line for Perl 6?

44:  use Terminal::ANSIColor qw( BOLD BLUE RED GREEN RESET );

# perl6 -c CimTrakCheckAndResatart.pl6
===SORRY!=== Error while compiling
/home/linuxutil/CimTrakCheckAndResatart.pl6
Undeclared names:
BLUE used at line 44
BOLD used at line 44
GREEN used at line 44
RED used at line 44
RESET used at line 44
Undeclared routine:
qw used at line 44


Many thanks,
-T





Follow up: this is what I wound up with:


#!/usr/bin/perl6

use Terminal::ANSIColor;

sub PrintRed   ( $Str ) { print color('bold'), color('red'),   "$Str", 
color('reset'); }
sub PrintGreen ( $Str ) { print color('bold'), color('green'), "$Str", 
color('reset'); }
sub PrintBlue  ( $Str ) { print color('bold'), color('blue'),  "$Str", 
color('reset'); }


PrintRed   "I Am Red\n";
PrintGreen "I Am Green\n";
PrintBlue  "I Am Blue\n";
print  "Back to Reset\n\n";


$ ./Color.pl6
I Am Red
I Am Green
I Am Blue
Back to Reset


Thank you all for the help!
-T


Re: [perl #130876] [BUG] repl error report suppressed by prior output

2017-02-27 Thread Zefram
Zoffix Znet via RT wrote:
>Fix:   https://github.com/rakudo/rakudo/commit/61a65cee3d

You've just moved the problem along.  There's now a new class of
object that, if evaluated to, will be treated as if evaluation failed on
exception.  Successful evaluation can yield literally any value, so if you
want to represent the disjunction of an evaluation result with something
that's not an evaluation result then you can't have evaluation results
just represented as themselves.  That doesn't leave any distinct values
to represent the other things.  You need more structure: for example,
your single $output value could be a list of the form (True, $value)
to represent a normal evaluation result and (False, $ex) to represent
evaluation terminating by exception.

-zefram


Re: mocking Proc

2017-02-27 Thread Lloyd Fournier
Ah nice. Wrapping  makes more sense than augmenting Proc anyway.

LL



On Tue, Feb 28, 2017 at 4:22 AM Brian Duggan  wrote:

> On Monday, February 27, Brian Duggan wrote:
> > I tried numerous variants with multis and signatures that match the
> > existing signatures, but didn't have any success.
>
> Okay, looks like wrap does what I want:
>
> use module;
>
> ( sub (|args) { say 'bye' } );
> hello;
>
> Brian
>


[perl #130876] [BUG] repl error report suppressed by prior output

2017-02-27 Thread Zoffix Znet via RT
On Mon, 27 Feb 2017 14:27:04 -0800, zef...@fysh.org wrote:
> Zoffix Znet via RT wrote:
> >Fix:   https://github.com/rakudo/rakudo/commit/db70a1fda8
> 
> This doesn't distinguish between an exception being thrown and the
> expression evaluating to an exception object.  The former is an error
> condition that must be reported; the latter is a successful evaluation
> in the same category as evaluating to a string.  Incorrect behaviour
> (failing to suppress output of a normal evaluation which produced its
> own output) can be seen thus:
> 
> > say 123; try { my Int $a; $a = "foo" }; say 456; $!
> 123
> 456
> Type check failed in assignment to $a; expected Int but got Str ("foo")
>   in block  at  line 1
> 
> Your single $output variable is too narrow to make the distinctions that
> you need.
> 
> -zefram
> 


Thanks for catching that one. Fixed now.

Fix:   https://github.com/rakudo/rakudo/commit/61a65cee3d
Tests: https://github.com/rakudo/rakudo/commit/61a65cee3d


[perl #130887] [BUG] .perl omits backtrace of exception

2017-02-27 Thread via RT
# New Ticket Created by  Zefram 
# Please include the string:  [perl #130887]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=130887 >


> try { my Int $a; $a = "foo" }; say ?$!.backtrace; say ?$!.perl.EVAL.backtrace
True
False

.perl.EVAL is failing to round-trip the exception object, as demonstrated
by the differing truthiness of the value returned by .backtrace.

-zefram


Re: [perl #130876] [BUG] repl error report suppressed by prior output

2017-02-27 Thread Zefram
Zoffix Znet via RT wrote:
>Fix:   https://github.com/rakudo/rakudo/commit/db70a1fda8

This doesn't distinguish between an exception being thrown and the
expression evaluating to an exception object.  The former is an error
condition that must be reported; the latter is a successful evaluation
in the same category as evaluating to a string.  Incorrect behaviour
(failing to suppress output of a normal evaluation which produced its
own output) can be seen thus:

> say 123; try { my Int $a; $a = "foo" }; say 456; $!
123
456
Type check failed in assignment to $a; expected Int but got Str ("foo")
  in block  at  line 1

Your single $output variable is too narrow to make the distinctions that
you need.

-zefram


[perl #130886] multi subs with inconsistent where clauses don't work correctly

2017-02-27 Thread via RT
# New Ticket Created by  Brad Gilbert 
# Please include the string:  [perl #130886]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=130886 >


This prints the numbers 1 to 9 then fails with a constraint error

my \one-out-of-ten = 
(|(False,False,False,False,False,False,False,False,False,True) xx *).iterator;

multi sub rarely ( $_ where one-out-of-ten.pull-one ){ say "test $_"; 
nextsame}
multi sub rarely ( $_ ) { .say }

(1..100).map: 

If I switch it so that it usually matches it doesn't fail

my \nine-out-of-ten = 
(|(False,True,True,True,True,True,True,True,True,True) xx *).iterator;

multi sub often ( $_ where nine-out-of-ten.pull-one ){ say "test $_"; 
nextsame }
multi sub often ( $_ ) { .say }

(1..100).map: 

It does seem as if the constraint is being called twice
because the first skip is on 5.



The reason I stumbled across this I thought something like this
could be good for logging one out of every ten inputs.


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

2017-02-27 Thread Elizabeth Mattijsen
Fixed with https://github.com/rakudo/rakudo/commit/ae7bcf1b8e , more tests 
needed

> On 27 Feb 2017, at 00:55, Aleks-Daniel Jakimenko-Aleksejev (via RT) 
>  wrote:
> 
> # New Ticket Created by  Aleks-Daniel Jakimenko-Aleksejev 
> # Please include the string:  [perl #130870]
> # in the subject line of all future correspondence about this issue. 
> # https://rt.perl.org/Ticket/Display.html?id=130870 >
> 
> 
> Code:
> my %h1 = <1 a 2 b>;
> my %h2 = <3 c 4 d>;
> my %h3 = <5 e 6 f>;
> %h2 = %h1, %h2, %h3;
> say %h2
> 
> Result:
> {1 => a, 2 => b, 5 => e, 6 => f}
> 
> 
> Notice that it has everything except for elements of %h2.
> 
> If this behavior is correct, then it should throw a warning. But I'd argue 
> that it should work exactly the same way as if it was an assignment to a 
> different hash.


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

2017-02-27 Thread Elizabeth Mattijsen
FWIW, I’m working on a fix

> On 27 Feb 2017, at 17:11, Brandon Allbery  wrote:
> 
> Or to put this another way: the current behavior seems like an 
> overoptimization where it finds the target container in the source and 
> optimizes into an update. This is only safe if the target is the first thing 
> in the list of new contents; you must deoptimize in all other situations 
> (unless your 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 that creates a container by unpacking any containers it encounters 
> and combining their contents with any non-containers it finds, in the 
> specified order, to make a new collection of contents. It operates on the 
> level of contents, not containers. If I want a container to be an item, I'm 
> fine with itemizing it explicitly.
> 
> On Mon, Feb 27, 2017 at 11:03 AM, Parrot Raiser <1parr...@gmail.com> wrote:
> I agree with Brandon on this one.
> 
> RHS retaining its original value, even when being updated 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 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 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-Aleksejev (via RT) <
> >>> perl6-bugs-follo...@perl.org> wrote:
> >>> >
> >>> > # New Ticket Created by  Aleks-Daniel Jakimenko-Aleksejev
> >>> > # Please include the string:  [perl #130870]
> >>> > # in the subject line of all future correspondence about this issue.
> >>> > # https://rt.perl.org/Ticket/Display.html?id=130870 >
> >>> >
> >>> >
> >>> > Code:
> >>> > my %h1 = <1 a 2 b>;
> >>> > my %h2 = <3 c 4 d>;
> >>> > my %h3 = <5 e 6 f>;
> >>> > %h2 = %h1, %h2, %h3;
> >>> > say %h2
> >>> >
> >>> > Result:
> >>> > {1 => a, 2 => b, 5 => e, 6 => f}
> >>> >
> >>> >
> >>> > Notice that it has everything except for elements of %h2.
> >>> >
> >>> > If this behavior is correct, then it should throw a warning. But I'd
> >>> argue that it should work exactly the same way as if it was an
> >>> assignment
> >>> to a different hash.
> >>>
> >>
> >>
> >>
> >> --
> >> brandon s allbery kf8nh   sine nomine
> >> associates
> >> allber...@gmail.com
> >> ballb...@sinenomine.net
> >> unix, openafs, kerberos, infrastructure, xmonad
> >> http://sinenomine.net
> >>
> >
> >
> >
> > --
> > brandon s allbery kf8nh   sine nomine
> > associates
> > allber...@gmail.com
> > ballb...@sinenomine.net
> > unix, openafs, kerberos, infrastructure, xmonad
> > http://sinenomine.net
> >
> 
> 
> 
> -- 
> brandon s allbery kf8nh   sine nomine associates
> allber...@gmail.com  ballb...@sinenomine.net
> unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net
> 
> 
> 
> -- 
> brandon s allbery kf8nh   sine nomine associates
> allber...@gmail.com  ballb...@sinenomine.net
> unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net


[perl #130876] [BUG] repl error report suppressed by prior output

2017-02-27 Thread Zoffix Znet via RT
On Mon, 27 Feb 2017 00:21:17 -0800, zef...@fysh.org wrote:
> > say "a"; "a" + 2; say "b"
> a
> > "a" + 2
> Cannot convert string to number: base-10 number must begin with valid
> digits or '.' in '^a' (indicated by ^)
>   in block  at  line 1
> 
> In both of these cases the addition signals an exception, terminating
> the evaluation phase of the repl.  But the exception is only reported
> in
> the second case.  The behaviour in the first case, with the exception
> going unreported, is quite confusing in any case less obvious than
> this example.  The criterion determining whether the exception gets
> reported is whether the evaluation has sent anything to the output
> stream.
> This is obviously the same logic that's being used to suppress
> printing
> the result of evaluation: it's OK to suppress that, but silly to also
> suppress error reports.
> 
> -zefram


Thank you for the report. This is now fixed.

Fix:   https://github.com/rakudo/rakudo/commit/db70a1fda8
Tests: https://github.com/rakudo/rakudo/commit/db70a1fda8


Re: Your thoughts on Padre?

2017-02-27 Thread Luca Ferrari
On Mon, Feb 27, 2017 at 4:32 PM, Brandon Allbery  wrote:
> 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:
>> .
>> I personally use spacemacs with perl6 mode and it does the job for me.
>
>
> That's the age of a fork, probably. I used Padre a bit over a decade ago;
> it's not "one year old".

Sorry, bad wording: I meant its activity (commits) seems to be one
year old. The last commit seems to be one year old.
This shows that you are right: the proect started sometime in 2008 (10
years ago): .
Last time I installed and used it I had the problem with SQLite3
Locker.pm 
;
please note that at least in Ubuntu Padre is shipped as version 1
while 1.01 is available.

Luca


Re: mocking Proc

2017-02-27 Thread Brian Duggan
On Monday, February 27, Brian Duggan wrote: 
> I tried numerous variants with multis and signatures that match the
> existing signatures, but didn't have any success.

Okay, looks like wrap does what I want:

use module;

( sub (|args) { say 'bye' } );
hello;

Brian


Re: mocking Proc

2017-02-27 Thread Brian Duggan
On Monday, February 27, Lloyd Fournier wrote: 
> You will have to use augment in this case I think:
> https://docs.perl6.org/syntax/augment
> 
> Augment Proc with your own shell method and  should call it.

No luck..

use MONKEY-TYPING;
augment class Proc  {
method shell() {
  ...
}
}

gives

Package 'Proc' already has a method 'shell' (did you mean to declare a
multi-method?)

I tried numerous variants with multis and signatures that match the
existing signatures, but didn't have any success.

Brian


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

2017-02-27 Thread Brandon Allbery
To unpack this a bit: in this case I understand the comma to be an infix
operator that creates a container by unpacking any containers it encounters
and combining their contents with any non-containers it finds, in the
specified order, to make a new collection of contents. It operates on the
level of contents, not containers. If I want a container to be an item, I'm
fine with itemizing it explicitly.

On Mon, Feb 27, 2017 at 11:03 AM, Parrot Raiser <1parr...@gmail.com> wrote:

> I agree with Brandon on this one.
>
> RHS retaining its original value, even when being updated 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 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 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-Aleksejev (via RT) <
> >>> perl6-bugs-follo...@perl.org> wrote:
> >>> >
> >>> > # New Ticket Created by  Aleks-Daniel Jakimenko-Aleksejev
> >>> > # Please include the string:  [perl #130870]
> >>> > # in the subject line of all future correspondence about this issue.
> >>> > # https://rt.perl.org/Ticket/Display.html?id=130870 >
> >>> >
> >>> >
> >>> > Code:
> >>> > my %h1 = <1 a 2 b>;
> >>> > my %h2 = <3 c 4 d>;
> >>> > my %h3 = <5 e 6 f>;
> >>> > %h2 = %h1, %h2, %h3;
> >>> > say %h2
> >>> >
> >>> > Result:
> >>> > {1 => a, 2 => b, 5 => e, 6 => f}
> >>> >
> >>> >
> >>> > Notice that it has everything except for elements of %h2.
> >>> >
> >>> > If this behavior is correct, then it should throw a warning. But I'd
> >>> argue that it should work exactly the same way as if it was an
> >>> assignment
> >>> to a different hash.
> >>>
> >>
> >>
> >>
> >> --
> >> brandon s allbery kf8nh   sine nomine
> >> associates
> >> allber...@gmail.com
> >> ballb...@sinenomine.net
> >> unix, openafs, kerberos, infrastructure, xmonad
> >> http://sinenomine.net
> >>
> >
> >
> >
> > --
> > brandon s allbery kf8nh   sine nomine
> > associates
> > allber...@gmail.com
> > ballb...@sinenomine.net
> > unix, openafs, kerberos, infrastructure, xmonad
> > http://sinenomine.net
> >
>



-- 
brandon s allbery kf8nh   sine nomine associates
allber...@gmail.com  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net


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

2017-02-27 Thread Brandon Allbery
Or to put this another way: the current behavior seems like an
overoptimization where it finds the target container in the source and
optimizes into an update. This is only safe if the target is the first
thing in the list of new contents; you must deoptimize in all other
situations (unless your 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 that creates a container by unpacking any containers it encounters
> and combining their contents with any non-containers it finds, in the
> specified order, to make a new collection of contents. It operates on the
> level of contents, not containers. If I want a container to be an item, I'm
> fine with itemizing it explicitly.
>
> On Mon, Feb 27, 2017 at 11:03 AM, Parrot Raiser <1parr...@gmail.com>
> wrote:
>
>> I agree with Brandon on this one.
>>
>> RHS retaining its original value, even when being updated 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 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 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-Aleksejev (via RT)
>> <
>> >>> perl6-bugs-follo...@perl.org> wrote:
>> >>> >
>> >>> > # New Ticket Created by  Aleks-Daniel Jakimenko-Aleksejev
>> >>> > # Please include the string:  [perl #130870]
>> >>> > # in the subject line of all future correspondence about this issue.
>> >>> > # https://rt.perl.org/Ticket/Display.html?id=130870 >
>> >>> >
>> >>> >
>> >>> > Code:
>> >>> > my %h1 = <1 a 2 b>;
>> >>> > my %h2 = <3 c 4 d>;
>> >>> > my %h3 = <5 e 6 f>;
>> >>> > %h2 = %h1, %h2, %h3;
>> >>> > say %h2
>> >>> >
>> >>> > Result:
>> >>> > {1 => a, 2 => b, 5 => e, 6 => f}
>> >>> >
>> >>> >
>> >>> > Notice that it has everything except for elements of %h2.
>> >>> >
>> >>> > If this behavior is correct, then it should throw a warning. But I'd
>> >>> argue that it should work exactly the same way as if it was an
>> >>> assignment
>> >>> to a different hash.
>> >>>
>> >>
>> >>
>> >>
>> >> --
>> >> brandon s allbery kf8nh   sine nomine
>> >> associates
>> >> allber...@gmail.com
>> >> ballb...@sinenomine.net
>> >> unix, openafs, kerberos, infrastructure, xmonad
>> >> http://sinenomine.net
>> >>
>> >
>> >
>> >
>> > --
>> > brandon s allbery kf8nh   sine nomine
>> > associates
>> > allber...@gmail.com
>> > ballb...@sinenomine.net
>> > unix, openafs, kerberos, infrastructure, xmonad
>> > http://sinenomine.net
>> >
>>
>
>
>
> --
> brandon s allbery kf8nh   sine nomine
> associates
> allber...@gmail.com
> ballb...@sinenomine.net
> unix, openafs, kerberos, infrastructure, xmonad
> http://sinenomine.net
>



-- 
brandon s allbery kf8nh   sine nomine associates
allber...@gmail.com  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net


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

2017-02-27 Thread Parrot Raiser
I agree with Brandon on this one.

RHS retaining its original value, even when being updated 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 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 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-Aleksejev (via RT) <
>>> perl6-bugs-follo...@perl.org> wrote:
>>> >
>>> > # New Ticket Created by  Aleks-Daniel Jakimenko-Aleksejev
>>> > # Please include the string:  [perl #130870]
>>> > # in the subject line of all future correspondence about this issue.
>>> > # https://rt.perl.org/Ticket/Display.html?id=130870 >
>>> >
>>> >
>>> > Code:
>>> > my %h1 = <1 a 2 b>;
>>> > my %h2 = <3 c 4 d>;
>>> > my %h3 = <5 e 6 f>;
>>> > %h2 = %h1, %h2, %h3;
>>> > say %h2
>>> >
>>> > Result:
>>> > {1 => a, 2 => b, 5 => e, 6 => f}
>>> >
>>> >
>>> > Notice that it has everything except for elements of %h2.
>>> >
>>> > If this behavior is correct, then it should throw a warning. But I'd
>>> argue that it should work exactly the same way as if it was an
>>> assignment
>>> to a different hash.
>>>
>>
>>
>>
>> --
>> brandon s allbery kf8nh   sine nomine
>> associates
>> allber...@gmail.com
>> ballb...@sinenomine.net
>> unix, openafs, kerberos, infrastructure, xmonad
>> http://sinenomine.net
>>
>
>
>
> --
> brandon s allbery kf8nh   sine nomine
> associates
> allber...@gmail.com
> ballb...@sinenomine.net
> unix, openafs, kerberos, infrastructure, xmonad
> http://sinenomine.net
>


Re: mocking Proc

2017-02-27 Thread Lloyd Fournier
Hmm,

You will have to use augment in this case I think:
https://docs.perl6.org/syntax/augment

Augment Proc with your own shell method and  should call it.

On Tue, 28 Feb 2017 at 1:59 am, Brian Duggan  wrote:

> On Monday, February 27, Lloyd Fournier wrote:
> > Do you mean without modifying module.pm?
>
> Yes, ideally without modifying module.pm.
>
> Brian
>


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 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-Aleksejev (via RT) <
>> perl6-bugs-follo...@perl.org> wrote:
>> >
>> > # New Ticket Created by  Aleks-Daniel Jakimenko-Aleksejev
>> > # Please include the string:  [perl #130870]
>> > # in the subject line of all future correspondence about this issue.
>> > # https://rt.perl.org/Ticket/Display.html?id=130870 >
>> >
>> >
>> > Code:
>> > my %h1 = <1 a 2 b>;
>> > my %h2 = <3 c 4 d>;
>> > my %h3 = <5 e 6 f>;
>> > %h2 = %h1, %h2, %h3;
>> > say %h2
>> >
>> > Result:
>> > {1 => a, 2 => b, 5 => e, 6 => f}
>> >
>> >
>> > Notice that it has everything except for elements of %h2.
>> >
>> > If this behavior is correct, then it should throw a warning. But I'd
>> argue that it should work exactly the same way as if it was an assignment
>> to a different hash.
>>
>
>
>
> --
> brandon s allbery kf8nh   sine nomine
> associates
> allber...@gmail.com
> ballb...@sinenomine.net
> unix, openafs, kerberos, infrastructure, xmonad
> http://sinenomine.net
>



-- 
brandon s allbery kf8nh   sine nomine associates
allber...@gmail.com  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net


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:
> .
> I personally use spacemacs with perl6 mode and it does the job for me.
>

That's the age of a fork, probably. I used Padre a bit over a decade ago;
it's not "one year old".

-- 
brandon s allbery kf8nh   sine nomine associates
allber...@gmail.com  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net


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-Aleksejev (via RT) <
> perl6-bugs-follo...@perl.org> wrote:
> >
> > # New Ticket Created by  Aleks-Daniel Jakimenko-Aleksejev
> > # Please include the string:  [perl #130870]
> > # in the subject line of all future correspondence about this issue.
> > # https://rt.perl.org/Ticket/Display.html?id=130870 >
> >
> >
> > Code:
> > my %h1 = <1 a 2 b>;
> > my %h2 = <3 c 4 d>;
> > my %h3 = <5 e 6 f>;
> > %h2 = %h1, %h2, %h3;
> > say %h2
> >
> > Result:
> > {1 => a, 2 => b, 5 => e, 6 => f}
> >
> >
> > Notice that it has everything except for elements of %h2.
> >
> > If this behavior is correct, then it should throw a warning. But I'd
> argue that it should work exactly the same way as if it was an assignment
> to a different hash.
>



-- 
brandon s allbery kf8nh   sine nomine associates
allber...@gmail.com  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net


Re: mocking Proc

2017-02-27 Thread Lloyd Fournier
I was thinking just do: 'sub shell(...) is export { }'. And then 'use
MyCrazyShell;'  in module.pm.

Do you mean without modifying module.pm?

LL

On Tue, Feb 28, 2017 at 1:46 AM Brian Duggan  wrote:

> On Monday, February 27, Lloyd Fournier wrote:
> > I'd do the follwiing:
> >
> > 1. make a sub named shell to overwrite the existing one that calls .shell
> > on Proc.
>
> Once I make a 'shell', is it possible for the test file
> to inject my 'shell' into module.pm's namespace?
>
> e.g. I was hoping for something like
>
> $::(CLIENT::<>) = sub (...) { ... }
>
> ?
>
> Brian
>


Re: mocking Proc

2017-02-27 Thread Brian Duggan
On Monday, February 27, Lloyd Fournier wrote: 
> Do you mean without modifying module.pm?

Yes, ideally without modifying module.pm.

Brian


[perl #130883] problem with RESOURCES and PERL6LIB env variable

2017-02-27 Thread via RT
# New Ticket Created by  mt1957 
# Please include the string:  [perl #130883]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=130883 >


Hi,

In  Rakudo version 2017.02-56-g9f10434 built on MoarVM version 
2017.02-7-g3d85900
implementing Perl 6.c I observed the following;

Assume that a distribution is at /x/y (on Unix) then;

1) when no environment variable PERL6LIB is set, the modules from the 
/x/y/lib directory can not be found. This is normal.

2) when PERL6LIB is set to the empty string, suddenly it is able to find 
the modules. This is not ok. this is the same when a dot is in the 
string ('.'), to find modules in the current directory. What also 
happens is that the path to the resource is calculated wrong. Assume 
/x/y/resources/a.b, %?RESOURCES returns /x/resources/a.b missing 
the /y. When the bowels of the %?RESOURCES are displayed, the repo key 
misses the '/lib' at the end of its repository path.

3) when 'lib' is used in the PERL6LIB variable all is fine.


I was in the habit of using the string '.,lib' until perl6 choose the 
dot over the 'lib' part and got faulty RESOURCES results in one of my 
repositories.

Thanks,
Marcel


Re: mocking Proc

2017-02-27 Thread Brian Duggan
On Monday, February 27, Lloyd Fournier wrote: 
> I'd do the follwiing:
> 
> 1. make a sub named shell to overwrite the existing one that calls .shell
> on Proc.

Once I make a 'shell', is it possible for the test file
to inject my 'shell' into module.pm's namespace?

e.g. I was hoping for something like

$::(CLIENT::<>) = sub (...) { ... }

?

Brian


Re: Your thoughts on Padre?

2017-02-27 Thread Luca Ferrari
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:
.
I personally use spacemacs with perl6 mode and it does the job for me.

Luca


Re: mocking Proc

2017-02-27 Thread Lloyd Fournier
I'd do the follwiing:

1. make a sub named shell to overwrite the existing one that calls .shell
on Proc.
2. make a class that inherits from Proc: class MyProc is Proc { }
3. Look at https://github.com/rakudo/rakudo/blob/nom/src/core/Proc.pm and
decide what methods you need to override to get the behaviour you want.
4. return a MyProc from your custom shell()

LL

On Tue, Feb 28, 2017 at 12:45 AM Brian Duggan  wrote:

> Hi perl6-users,
>
> Suppose I have a file like this:
>
> # module.pm
> sub hello is export {
> shell "echo hello world"
> }
>
> and another like this:
>
> # test.t
> use module;
> hello;
>
> I want to have 'hello' invoke a 'shell' that I write,
> rather than the real one, so that I can mock the
> behavior of a command.  What would be the best way
> to do this?
>
> thanks
> Brian
>


mocking Proc

2017-02-27 Thread Brian Duggan
Hi perl6-users,

Suppose I have a file like this:

# module.pm
sub hello is export {
shell "echo hello world"
}

and another like this:

# test.t
use module;
hello;

I want to have 'hello' invoke a 'shell' that I write,
rather than the real one, so that I can mock the
behavior of a command.  What would be the best way
to do this?

thanks
Brian


Re: [perl #130877] [BUG] called-without-args error refers to non-existent method

2017-02-27 Thread Zefram
Elizabeth Mattijsen via RT wrote:
>My point is that without knowing the object on which one attempts to
>call a method, one cannot know whether or not the method call will fail.

That's true, but the conclusion one would reach from that is that one
can't suggest calling the sub in method form even when it *is* available
as a method on Mu.  If you're going to run with that logic then that part
of the error message needs to be removed for all the subs that get it,
including ones like "say" as well as "bag".  Or if you really want to
refer to method calling, reword it something like ".$name if you meant
to call a method of that name on \$_".  What is being called is whatever
method exists of that name, not necessarily the sub with which the error
message is concerned.  My suggested wording is good for all the subs
that get these messages, whether or not available as methods on Mu.

But it's pretty normal style to rely on the methods on Mu being available
essentially unchanged in all subclasses.  There are other error messages
that recommend calling such methods.  (Try interpolating a type object
into a string, for example.)  So I think it's reasonable for these error
messages to suggest calling those methods that do actually exist in Mu.
If you're getting antsy about the overridability of Mu methods, there's
an awful lot of code and documentation that should change to stop relying
on those methods, not just a couple of messages.

-zefram


Re: [perl #130877] [BUG] called-without-args error refers to non-existent method

2017-02-27 Thread Elizabeth Mattijsen

> On 27 Feb 2017, at 11:29, Zefram  wrote:
> 
> Elizabeth Mattijsen via RT wrote:
>> Fixed with https://github.com/rakudo/rakudo/commit/b11dc88a3e , no tests 
>> needed.
> 
> That only changed one of the two types of message to which I referred.
> mkdir still has the unchanged message.

Good point, fixed with https://github.com/rakudo/rakudo/commit/6cb9be294d .


> I don't think the change made there fixes the problem.  The altered
> message still implies that *the sub being called* can be called as a
> method.

My point is that without knowing the object on which one attempts to call a 
method, one cannot know whether or not the method call will fail.

  class A {
  method mkdir() { “foo” }
  }
  mkdir with A.new;

Seems to be perfectly valid error message in this case.


> The alteration is merely a clarification of the meaning that
> the message had before.  It's a reasonable change to make for those
> subs that *are* widely available as methods (WHAT, say), but that part
> of the message is still wrong for those that are not (bag, mkdir).

Again, without knowing the runtime environment, we cannot see whether the 
method calls will work or not.

Re: [perl #130877] [BUG] called-without-args error refers to non-existent method

2017-02-27 Thread Zefram
Elizabeth Mattijsen via RT wrote:
>Fixed with https://github.com/rakudo/rakudo/commit/b11dc88a3e , no tests 
>needed.

That only changed one of the two types of message to which I referred.
mkdir still has the unchanged message.

I don't think the change made there fixes the problem.  The altered
message still implies that *the sub being called* can be called as a
method.  The alteration is merely a clarification of the meaning that
the message had before.  It's a reasonable change to make for those
subs that *are* widely available as methods (WHAT, say), but that part
of the message is still wrong for those that are not (bag, mkdir).

-zefram


Re: [perl #130877] [BUG] called-without-args error refers to non-existent method

2017-02-27 Thread Elizabeth Mattijsen
Fixed with https://github.com/rakudo/rakudo/commit/b11dc88a3e , no tests needed.

> On 27 Feb 2017, at 10:30, Zefram (via RT)  
> wrote:
> 
> # New Ticket Created by  Zefram 
> # Please include the string:  [perl #130877]
> # in the subject line of all future correspondence about this issue. 
> # https://rt.perl.org/Ticket/Display.html?id=130877 >
> 
> 
>> bag
> ===SORRY!===
> Argument to "bag" seems to be malformed
> --> bag^
> Other potential difficulties:
>Function "bag" may not be called without arguments (please use () or 
> whitespace to denote arguments, or  to refer to the function as a noun, 
> or use .bag if you meant $_)
>--> bag^
>> $_ = 3; .bag
> No such method 'bag' for invocant of type 'Int'
>  in block  at  line 1
> 
> The error message given in response to "bag" with no argument list advises
> one to use ".bag" to perform this operation on $_.  In fact there is no
> widely-available .bag method, so this part of the error message is bogus.
> The same problem arises with some subs that generate a different type
> of message for the same situation, such as "mkdir".  This part of the
> message is correct for some of the other subs that generate these types
> of errors, such as "WHAT" and "say".  If it's desired to keep this part
> of the message for those subs, then the message will have to vary in
> whether it includes this part, according to whether the sub is actually
> available as a method.
> 
> -zefram


Re: [perl #130875] [BUG] clashing Nil type constraints incorrectly described

2017-02-27 Thread Elizabeth Mattijsen
Feels to me that Nil should not be allowed as a type constraint at all.

> On 27 Feb 2017, at 09:11, Zefram (via RT)  
> wrote:
> 
> # New Ticket Created by  Zefram 
> # Please include the string:  [perl #130875]
> # in the subject line of all future correspondence about this issue. 
> # https://rt.perl.org/Ticket/Display.html?id=130875 >
> 
> 
>> my Int $a of Nil
> ===SORRY!=== Error while compiling:
> Mu not allowed here; variable list already declared with type Int
> at line 2
> --> ^
>expecting any of:
>constraint
>> my Nil $a of Int
> ===SORRY!=== Error while compiling:
> Int not allowed here; variable list already declared with type Mu
> at line 2
> --> ^
>expecting any of:
>constraint
> 
> In both of these cases of multiple type constraints, the Nil type
> constraint is incorrectly described as "Mu".  The same problem
> also occurs if both type constraints are specified in the "of" form.
> The error messages are otherwise correct, and the corresponding messages
> for other types are correct.  A Nil type constraint specified without
> a clash actually behaves (mostly correctly) as a Nil type constraint,
> not as a Mu type constraint.
> 
> -zefram


Re: [perl #130874] [BUG] Nil value misdescribed at repl

2017-02-27 Thread Elizabeth Mattijsen
Fixed with https://github.com/rakudo/rakudo/commit/a274bdd122 , tests needed

> On 27 Feb 2017, at 09:06, Zefram (via RT)  
> wrote:
> 
> # New Ticket Created by  Zefram 
> # Please include the string:  [perl #130874]
> # in the subject line of all future correspondence about this issue. 
> # https://rt.perl.org/Ticket/Display.html?id=130874 >
> 
> 
>> Nil.WHICH
> Nil|U28688864
>> Nil.perl
> Nil
>> Nil.gist
> Nil
>> Nil
> (Any)
> 
> The Nil value can be queried correctly via .perl et al, but if it is
> the value of an expression evaluated at the repl top level then it is
> incorrectly described by the print part of the repl.
> 
> -zefram


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

2017-02-27 Thread Elizabeth Mattijsen
FWIW, this feels like a DIHWIDT case

> On 27 Feb 2017, at 00:55, Aleks-Daniel Jakimenko-Aleksejev (via RT) 
>  wrote:
> 
> # New Ticket Created by  Aleks-Daniel Jakimenko-Aleksejev 
> # Please include the string:  [perl #130870]
> # in the subject line of all future correspondence about this issue. 
> # https://rt.perl.org/Ticket/Display.html?id=130870 >
> 
> 
> Code:
> my %h1 = <1 a 2 b>;
> my %h2 = <3 c 4 d>;
> my %h3 = <5 e 6 f>;
> %h2 = %h1, %h2, %h3;
> say %h2
> 
> Result:
> {1 => a, 2 => b, 5 => e, 6 => f}
> 
> 
> Notice that it has everything except for elements of %h2.
> 
> If this behavior is correct, then it should throw a warning. But I'd argue 
> that it should work exactly the same way as if it was an assignment to a 
> different hash.


[perl #130877] [BUG] called-without-args error refers to non-existent method

2017-02-27 Thread via RT
# New Ticket Created by  Zefram 
# Please include the string:  [perl #130877]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=130877 >


> bag
===SORRY!===
Argument to "bag" seems to be malformed
--> bag^
Other potential difficulties:
Function "bag" may not be called without arguments (please use () or 
whitespace to denote arguments, or  to refer to the function as a noun, or 
use .bag if you meant $_)
--> bag^
> $_ = 3; .bag
No such method 'bag' for invocant of type 'Int'
  in block  at  line 1

The error message given in response to "bag" with no argument list advises
one to use ".bag" to perform this operation on $_.  In fact there is no
widely-available .bag method, so this part of the error message is bogus.
The same problem arises with some subs that generate a different type
of message for the same situation, such as "mkdir".  This part of the
message is correct for some of the other subs that generate these types
of errors, such as "WHAT" and "say".  If it's desired to keep this part
of the message for those subs, then the message will have to vary in
whether it includes this part, according to whether the sub is actually
available as a method.

-zefram


[perl #130876] [BUG] repl error report suppressed by prior output

2017-02-27 Thread via RT
# New Ticket Created by  Zefram 
# Please include the string:  [perl #130876]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=130876 >


> say "a"; "a" + 2; say "b"
a
> "a" + 2
Cannot convert string to number: base-10 number must begin with valid digits or 
'.' in '^a' (indicated by ^)
  in block  at  line 1

In both of these cases the addition signals an exception, terminating
the evaluation phase of the repl.  But the exception is only reported in
the second case.  The behaviour in the first case, with the exception
going unreported, is quite confusing in any case less obvious than
this example.  The criterion determining whether the exception gets
reported is whether the evaluation has sent anything to the output stream.
This is obviously the same logic that's being used to suppress printing
the result of evaluation: it's OK to suppress that, but silly to also
suppress error reports.

-zefram


[perl #130875] [BUG] clashing Nil type constraints incorrectly described

2017-02-27 Thread via RT
# New Ticket Created by  Zefram 
# Please include the string:  [perl #130875]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=130875 >


> my Int $a of Nil
===SORRY!=== Error while compiling:
Mu not allowed here; variable list already declared with type Int
at line 2
--> ^
expecting any of:
constraint
> my Nil $a of Int
===SORRY!=== Error while compiling:
Int not allowed here; variable list already declared with type Mu
at line 2
--> ^
expecting any of:
constraint

In both of these cases of multiple type constraints, the Nil type
constraint is incorrectly described as "Mu".  The same problem
also occurs if both type constraints are specified in the "of" form.
The error messages are otherwise correct, and the corresponding messages
for other types are correct.  A Nil type constraint specified without
a clash actually behaves (mostly correctly) as a Nil type constraint,
not as a Mu type constraint.

-zefram


[perl #130874] [BUG] Nil value misdescribed at repl

2017-02-27 Thread via RT
# New Ticket Created by  Zefram 
# Please include the string:  [perl #130874]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=130874 >


> Nil.WHICH
Nil|U28688864
> Nil.perl
Nil
> Nil.gist
Nil
> Nil
(Any)

The Nil value can be queried correctly via .perl et al, but if it is
the value of an expression evaluated at the repl top level then it is
incorrectly described by the print part of the repl.

-zefram