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

Consistency of & coercer #6543

Open
p6rt opened this issue Sep 22, 2017 · 2 comments
Open

Consistency of & coercer #6543

p6rt opened this issue Sep 22, 2017 · 2 comments
Labels
LTA Less Than Awesome; typically an error message that could be better

Comments

@p6rt
Copy link

p6rt commented Sep 22, 2017

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

Searchable as RT132146$

@p6rt
Copy link
Author

p6rt commented Sep 22, 2017

From @zoffixznet

IRC​: https://irclog.perlgeek.de/perl6/2017-09-22#i_15205100

If you give the `&` coercer some stuff that isn't a callable it just gives you the stuff back.
However, if the "stuff" you give is a sigil-less constant, it gives a Nil. Yet, if you parenthesize
that constant, you do get its actual value​:

  22​:13 Zoffix m​: constant $z = 42; say &$z
  22​:13 camelia rakudo-moar ffd179​: OUTPUT​: «42␤»
  22​:14 Zoffix m​: constant z = 42; say &z
  22​:14 camelia rakudo-moar ffd179​: OUTPUT​: «Nil␤»
  22​:14 Zoffix inconsistent
  22​:14 m​: constant z = 42; say &(z)
  22​:14 camelia rakudo-moar ffd179​: OUTPUT​: «42␤»

Feels like the Nil version needs to either return the actual value or throw; not silently return the wrong value.

@p6rt p6rt added the LTA Less Than Awesome; typically an error message that could be better label Jan 5, 2020
@JJ
Copy link

JJ commented Dec 30, 2020

Still returning Nil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LTA Less Than Awesome; typically an error message that could be better
Projects
None yet
Development

No branches or pull requests

2 participants