Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lossy .perl for 0 but True #4545

Open
p6rt opened this issue Sep 18, 2015 · 1 comment
Open

lossy .perl for 0 but True #4545

p6rt opened this issue Sep 18, 2015 · 1 comment
Labels
Bug

Comments

@p6rt
Copy link

@p6rt p6rt commented Sep 18, 2015

Migrated from rt.perl.org#126097 (status was 'new')

Searchable as RT126097$

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Sep 18, 2015

From zefram@fysh.org

If .perl is used to serialise a value of 0 but True, it doesn't represent
the but-True aspect. Evaling the result produces a mundane false zero.
.WHICH and eqv recognise the difference.

$ ./perl6 -e 'my $a = 0 but True; say $a.perl; my $b = $a.perl.EVAL; say ?$a, " ", ?$b; say $a.WHICH, " ", $b.WHICH; say $b eqv $a'
0
True False
Int+{<anon>}|0 Int|0
False

The same goes for many other values modified by "but".

-zefram

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.