develooper Front page | perl.perl6.language | Postings from September 2008

Does colonpair notation produce a Bool or Int?

Thread Next
From:
Patrick R. Michaud
Date:
September 25, 2008 21:59
Subject:
Does colonpair notation produce a Bool or Int?
Message ID:
20080926045932.GA21259@pmichaud.com
Lines 46-52 of t/spec/S02-literals/pairs.t claims that
the colonpair notation should produce a Bool instead of
an Int:

    #?rakudo todo 'Adverbial pairs without should produce a Bool (not Int)'
    is f2(:a),          "Bool", "':a' is a named";
    #?rakudo todo '.() sub calls'
    is(f2.(:a),         "Bool",  "in 'f2.(:a)', ':a' is a named");
    #?rakudo todo 'Adverbial pairs without should produce a Bool (not Int)'
    is $f2(:a),         "Bool",  "in '\$f2(:a)', ':a' is a named";

However, S02 says that C<:a> corresponds to C<< a => 1 >> in 
fatarrow notation, which seems to argue that C<:a> should in 
fact have an Int value.

Are the tests correct here, or am I reading too much into 
the synopsis description?

Pm

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About