From: Vincent Pit Date: Tue, 5 Aug 2008 14:17:55 +0000 (+0200) Subject: This is 0.02 X-Git-Tag: v0.02^0 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FSub-Nary.git;a=commitdiff_plain;h=d3746e574d46fdfb258a4f3c76fb1534cba0c839 This is 0.02 --- diff --git a/Changes b/Changes index 09b3976..46886ce 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,14 @@ Revision history for Sub-Nary +0.02 2008-08-05 16:20 UTC + + Add : Support for matches, eval, keys, values, each readline, stat, + localtime, gmtime, caller, get{pw,gr,host,net,proto,serv}*, + constant ranges. + + Doc : POD nits. + + Fix : Array assignment count. + + Tst : More of them, lots. + + Tst : All op tests now go in t/24-ops.t. + 0.01 2008-08-04 16:35 UTC First version, released on an unsuspecting world. diff --git a/META.yml b/META.yml index 34705a9..c84889a 100644 --- a/META.yml +++ b/META.yml @@ -1,6 +1,6 @@ --- #YAML:1.0 name: Sub-Nary -version: 0.01 +version: 0.02 abstract: Try to count how many elements a subroutine can return in list context. license: perl author: diff --git a/README b/README index 9f80bb0..587b889 100644 --- a/README +++ b/README @@ -3,7 +3,7 @@ NAME list context. VERSION - Version 0.01 + Version 0.02 SYNOPSIS use Sub::Nary; @@ -22,7 +22,7 @@ METHODS "new" The usual constructor. Currently takes no argument. - "nary $coderf" + "nary $coderef" Takes a code reference to a named or anonymous subroutine, and returns a hash reference whose keys are the possible numbers of returning scalars, and the corresponding values the "probability" to get them. The special @@ -88,7 +88,12 @@ PROBABILITY OF RETURN 1/4", 3 with probability "1/2 * 1/2 + 1/2 * 1/2 = 1/2" and 4 with probability "1/4" too. - * The 'list' state is absorbant in regard of all the other ones. + * If a core function may return different numbers of scalars, each kind + is considered equally possible. + For example, "stat" returns 13 elements on success and 0 on error. + The according probability will then be "{ 0 => 0.5, 13 => 0.5 }". + + * The "list" state is absorbing in regard of all the other ones. This is just a pedantic way to say that "list + fixed length = list". That's why @@ -96,9 +101,10 @@ PROBABILITY OF RETURN return 1, simple(), @_ } - is considered as always returning an unbounded list. The convolution - law also does not behave the same when "list" elements are involved - : in the following example, + is considered as always returning an unbounded list. + + Also, the convolution law does not behave the same when "list" + elements are involved : in the following example, sub oneorlist { if (rand < 0.1) { diff --git a/lib/Sub/Nary.pm b/lib/Sub/Nary.pm index 219e8c3..4e24478 100644 --- a/lib/Sub/Nary.pm +++ b/lib/Sub/Nary.pm @@ -16,13 +16,13 @@ Sub::Nary - Try to count how many elements a subroutine can return in list conte =head1 VERSION -Version 0.01 +Version 0.02 =cut our $VERSION; BEGIN { - $VERSION = '0.01'; + $VERSION = '0.02'; } =head1 SYNOPSIS