[perl #117307] [BUG] Sequences with strings and a Code stopping condition go backwards in Rakudo

2013-03-23 Thread Carl Mäsak via RT
Pm (>):
> S03 has:
> 
> For functions deduced when there is only one value on the left, 
> the final value is used to determine whether *.succ or *.pred is 
> more appropriate.  The two values are compared with C to 
> determine the direction of the progression.
> 
> Rakudo evaluates C< "perl" cmp { ... } >   as C,
> therefore it's using the .pred/decreasing progression.

Aye. That's clearly to spec.

> So, one of the following:
>   a) &infix: should produce a different result for Str vs Code
>  (if so, what?),

&infix: is consistent the way it is, but it's a consistency that 
surprises people. (Basically, comparing across incompatible is 
impossible.) Adding an exception for Str vs Code feels wrong, and is the 
opposite of what &infix: would need to be saner.

>   b) &infix:<...> should assume .succ if the final value is a Code 
object,

This alternative makes sense to me. It's similar to how &infix:<...> 
assumes .succ in this case: '"perl" ... *'

>   c) Rakudo is correct, or

No. :)

>   d) Some other spec clarification or change needs to be made.

I'm very satisfied with how the sequence spec has turned out. It's 
stable and in some kind of sweet spot. I don't imagine it needs an 
overhaul of any kind, actually. But the way this particular case worked 
surprised me as a user.


ezmlm warning

2013-03-23 Thread perl6-language-help
Hi! This is the ezmlm program. I'm managing the
perl6-langu...@perl.org mailing list.

I'm working for my owner, who can be reached
at perl6-language-ow...@perl.org.


Messages to you from the perl6-language mailing list seem to
have been bouncing. I've attached a copy of the first bounce
message I received.

If this message bounces too, I will send you a probe. If the probe bounces,
I will remove your address from the perl6-language mailing list,
without further notice.


I've kept a list of which messages from the perl6-language mailing list have 
bounced from your address.

Copies of these messages may be in the archive.

To retrieve a set of messages 123-145 (a maximum of 100 per request),
send an empty message to:
   

To receive a subject and author list for the last 100 or so messages,
send an empty message to:
   

Here are the message numbers:

   35153
   35154

--- Enclosed is a copy of the bounce message I received.

Return-Path: <>
Received: (qmail 15398 invoked from network); 11 Mar 2013 05:50:58 -
Received: from x1.develooper.com (207.171.7.70)
  by x6.develooper.com with SMTP; 11 Mar 2013 05:50:58 -
Received: (qmail 28962 invoked by uid 225); 11 Mar 2013 05:50:58 -
Delivered-To: perl6-language-return-35153-perl6-all-poster=perl@perl.org
Received: (qmail 28958 invoked by alias); 11 Mar 2013 05:50:58 -
Received: from unknown (HELO x6.develooper.com) (10.0.100.16)
  by x1.dev with SMTP; 11 Mar 2013 05:50:58 -
Received: by x6.develooper.com (Postfix)
id 4844517753; Sun, 10 Mar 2013 22:50:54 -0700 (PDT)
Date: Sun, 10 Mar 2013 22:50:54 -0700 (PDT)
From: mailer-dae...@x6.develooper.com (Mail Delivery System)
Subject: Undelivered Mail Returned to Sender
To: perl6-language-return-35153-perl6-all-poster=perl@perl.org
Auto-Submitted: auto-replied
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
boundary="8C33E17BD2.1362981054/x6.develooper.com"
Message-Id: <20130311055054.4844517...@x6.develooper.com>

This is a MIME-encapsulated message.

--8C33E17BD2.1362981054/x6.develooper.com
Content-Description: Notification
Content-Type: text/plain; charset=us-ascii

This is the mail system at host x6.develooper.com.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to 

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

   The mail system

: host mx.develooper.com[207.171.7.76] said: 552 The
Date in the header was too far in the past (in reply to end of DATA
command)

--8C33E17BD2.1362981054/x6.develooper.com
Content-Description: Delivery report
Content-Type: message/delivery-status

Reporting-MTA: dns; x6.develooper.com
X-Postfix-Queue-ID: 8C33E17BD2
X-Postfix-Sender: rfc822; 
perl6-language-return-35153-perl6-all-poster=perl@perl.org
Arrival-Date: Sun, 10 Mar 2013 22:50:38 -0700 (PDT)

Final-Recipient: rfc822; perl6-all-pos...@perl.org
Original-Recipient: rfc822;perl6-all-pos...@perl.org
Action: failed
Status: 5.0.0
Remote-MTA: dns; mx.develooper.com
Diagnostic-Code: smtp; 552 The Date in the header was too far in the past

--8C33E17BD2.1362981054/x6.develooper.com
Content-Description: Undelivered Message
Content-Type: message/rfc822

Received: from lists-nntp.develooper.com (localhost.localdomain [127.0.0.1])
by x6.develooper.com (Postfix) with SMTP id 8C33E17BD2
for ; Sun, 10 Mar 2013 22:50:38 -0700 (PDT)
Received: (qmail 13509 invoked by uid 514); 11 Mar 2013 05:50:19 -
Mailing-List: contact perl6-language-h...@perl.org; run by ezmlm
Precedence: bulk
List-Post: 
List-Help: 
List-Unsubscribe: 
List-Subscribe: 
List-Id: 
Delivered-To: mailing list perl6-langu...@perl.org
Delivered-To: moderator for perl6-langu...@perl.org
Received: (qmail 1670 invoked from network); 8 Mar 2013 00:18:22 -
Delivered-To: perl6-langu...@perl.org
X-Spam-Status: No, hits=-2.0 required=8.0

tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,SPF_PASS
X-Spam-Check-By: la.mx.develooper.com
DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=github.com; q=dns/txt;
 s=mailo; t=1362701893; h=Date: From: Reply-To: To: Message-Id: Subject:
 Mime-Version: Content-Type: Content-Transfer-Encoding: Sender;
 bh=VZfkewjsJY4mIB95c7edzV390Lm+3sN9HJPgGc+tWXI=; 
b=v00BPteJV42V84AoJZ97rDd2YSFAf0TmHLHv/CyGfq4zuiPdtXpdJZN2D/c1CFC3JqDtjS91
 AggP90qjAgyGRLB+/3k6l9yZCWtF/L4yqT+DDeIXypcqqP0ZSwtemf5hEL4nhmyyRxRmCbAL
 dijETs3TYENNOZSf7hScf/zAh88=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=github.com; s=mailo; q=dns;
 h=Date: From: Reply-To: To: Message-Id: Subject: Mime-Version:
 Content-Type: Content-Transfer-Encoding: Sender;
 b=NgDgdZ3mg06+eGt8zUw0W7rPggiaWBi8dOXDARLGHk+

Re: ADT and GADT (a partial implementation)

2013-03-23 Thread Timo Paulssen
On 21.03.2013 17:45, Carl Mäsak wrote:
> [...]
> 
> Using hashes and subclasses:  Using
> classes and subclasses: 
> 
> [...]

I came up with a prototype to create those classes like in the second gist
automatically by supplying a haskell-like declaration of the data type.

(skip to the end of the mail for the code)

Here's what it can do:

my %res = create_adt("Tree = Branch Tree left, Tree right | Leaf Str 
storage");
my \Tree = %res;

# create the tree with named parameters
my $t =
Tree.new-branch(
:left(Tree.new-branch(
:left(Tree.new-leaf(:storage(1))),
:right(Tree.new-leaf(:storage(2),
:right(Tree.new-leaf(:storage(3;

# create the tree with positional arguments
my $t2 =
Tree.new-branch(
Tree.new-branch(
Tree.new-leaf(1),
Tree.new-leaf(2)),
Tree.new-leaf(3));
say $t2.gist;
# outputs:  (reformatted for email)
# Tree.new-branch(
#left => Tree.new-branch(
# left => Tree.new-leaf(storage => 1),
# right => Tree.new-leaf(storage => 2)),
#right => Tree.new-leaf(storage => 3))

my \Branch = %res;
my \Leaf = %res;

# haskell-style map for the tree
sub treemap($t, *&code) {
given $t {
when Branch {
return Tree.new-branch(
treemap($t.left, &code),
treemap($t.right, &code))
}
when Leaf {
return Tree.new-leaf(code($t.storage))
}
}
}

say treemap($t2, * * 10).gist;
# outputs:
# Tree.new-branch(
#left => Tree.new-branch(
# left => Tree.new-leaf(storage => 10),
# right => Tree.new-leaf(storage => 20)),
#right => Tree.new-leaf(storage => 30))


There are currently some limitations:

1) there is no compiler support for checking that all cases have been covered,
   but as masak mentioned, I'm confident this can be done with a macro, because
   those run at compile-time basically.
2) you cannot yet use Leaf and Branch for declaring multi subs, because the
   symbols are not there at compile-time, but see below.
3) I have not yet figured out how to properly do pattern matching/decomposing,
   so the names "left", "right" and "storage" need to be supplied in the
   definition unlike in haskell.
4) I'm not sure how to do type parameters (think data Tree A = ...), because
   perl6 has only parametric roles, not parametric classes.

One thing rakudo needs to get for this to be much smoother is support for the
sub EXPORT to return a hash-like of symbols that will be installed in the
caller's package. This would make Tree, Branch and Leaf available as
compile-time symbols, so that multi methods/subs can use them for dispatch.

I mean to turn this into a module for the perl6 modules list some time in the
Future.

Finally, here's the runnable code. Feel free to play around with it and tell me
on this mailing list or the IRC channel what further problems (or even
solutions!) you find.

https://gist.github.com/timo/5226114

Have Fun!
  - Timo


Re: [perl #117307] [BUG] Sequences with strings and a Code stopping condition go backwards in Rakudo

2013-03-23 Thread Patrick R. Michaud
On Sat, Mar 23, 2013 at 07:50:55AM -0700, Carl Mäsak via RT wrote:
> >   b) &infix:<...> should assume .succ if the final value is a Code 
> object,
> 
> This alternative makes sense to me. It's similar to how &infix:<...> 
> assumes .succ in this case: '"perl" ... *'

Similar, yes, but also a little "off".  In the case of "perl" ... * ,
&infix:<...> assumes .succ because the * transforms to Inf, and
"perl" cmp Inf is Order::Increase.  So, it's a special case like *, 
but it's a separate special case.

I'm wondering if Code objects just shouldn't participate in 
&infix: somehow.  

And also if there ought to be something akin to an Order::None 
somewhere.

Either of these might help to more cleanly get the &infix:<...> 
semantics right in this case, as well as potentially solve a 
lot of other cmp-related oddities.

Pm


Re: [perl #117307] [BUG] Sequences with strings and a Code stopping condition go backwards in Rakudo

2013-03-23 Thread Brandon Allbery
On Sat, Mar 23, 2013 at 12:16 PM, Patrick R. Michaud wrote:

> And also if there ought to be something akin to an Order::None
> somewhere.
>

Order::NonComparable, possibly which behaves as a (delayed?) exception of
some kind?

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


Parrot 5.2.0 "Stuffed Parrot" Released!

2013-03-23 Thread Bruce Gray
I am not dead yet   I can dance and I can sing
I am not dead yet  I can do the Highland Fling
I am not dead yet No need to go to bed
No need to call the doctor  Cause I'm not yet dead
-- Spamalot

On behalf of the Parrot team, I'm proud to announce Parrot 5.2.0, also known
as "Stuffed Parrot".  Parrot (http://parrot.org/) is a virtual machine aimed
at running all dynamic languages.

Parrot 5.2.0 is available on Parrot's FTP site
(ftp://ftp.parrot.org/pub/parrot/releases/devel/5.2.0/), or by following the
download instructions at http://parrot.org/download.  For those who would like
to develop on Parrot, or help develop Parrot itself, we recommend using Git to
retrieve the source code to get the latest and best Parrot code.

Parrot 5.2.0 News:
- Core
+ IO now only syncs buffers for the IO types where syncing makes sense.
= PIO_VF_SYNC_IO flag added
- Build
+ installable_pdump now has the correct rpath (blib corrected to lib).
- Libraries
+ Tcl/Glob.pir has been removed. (PGE/Glob.pir remains intact)
- Ecosystem
+ All Parrot tarballs are now symlinked to the 'all' directory,
  regardless of their true homes ('devel' or 'stable'), to better
  allow for automated downloads.
ftp://ftp.parrot.org/pub/parrot/releases/all/


The SHA256 message digests for the downloadable tarballs are:
1245d11f2b2ea44e6465aff6da5a533324d69b6eb3ddf7d84e81385ea95150ad 
parrot-5.2.0.tar.gz
0c538d780f9c70c510e142a8a663c30474125c9fcf9fe25d2129e68fc7baec8d 
parrot-5.2.0.tar.bz2

Many thanks to all our contributors for making this possible, and our sponsors
for supporting this project.  Our next scheduled release is 16 Apr 2013.

Enjoy!

-- 
Bruce Gray (Util of PerlMonks)



[perl #117317] [BUG] printf with too few arguments returns "Null PMC Access" - again

2013-03-23 Thread via RT
# New Ticket Created by  Ira Byerly 
# Please include the string:  [perl #117317]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org:443/rt3/Ticket/Display.html?id=117317 >


Hello,

Oddly, this is exactly the same symptom that was reported and resolved in
2009 in bug #62316.  It looks like it sneaked back into the latest version
of Rakudo.

$ perl6 -e 'printf "%s"'
Null PMC access in get_string()
  in sub sprintf at src/gen/CORE.setting:2471
  in sub printf at src/gen/CORE.setting:2476
  in block  at -e:1

$ perl6 -v
This is perl6 version 2013.03 built on parrot 4.10.0 revision RELEASE_4_10_0

Niecza rejects this with a more appropriate "Unhandled exception: Not
enough arguments for this format string".

Best regards,
Ira Kevin Byerly
quester  (on #perl6 and perlmonks)
quester...@gmail.com