"Paul \"LeoNerd\" Evans" <leonerd@leonerd.org.uk> writes: > I propose the addition of a new SV type, of SVt_BOOL. Should I write an > RFC? Yes please! > This type will act much like the existing "booleans" of PL_sv_no and > PL_sv_yes, except its type will remain distinct, so it will be possible > to distinguish "that SV is a boolean". This is a requirement for > certain kinds of data serialisation - such as JSON or MsgPack - and may > be useful for many other purposes too. > > Still to be determined: a pureperl interface on it. E.g. would this be > possible: > > use feature 'bool'; > > my $yes = true; # new literal value keywords > my $no = false; # > > use Scalar::Util 'svtype'; > > is( svtype($yes), "BOOL", 'true is SVt_BOOL'); Should these also pass? is( svtype(!0) ,"BOOL", 'PL_sv_yes is SVt_BOOL' ); is( svtype(!1) ,"BOOL", 'PL_sv_no is SVt_BOOL' ); And if so, only in the scope of `use feature 'bool';`, or everywhere? - ilmariThread Previous | Thread Next