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

now.WHAT has broken Str context #3000

Closed
p6rt opened this issue Dec 16, 2012 · 4 comments
Closed

now.WHAT has broken Str context #3000

p6rt opened this issue Dec 16, 2012 · 4 comments

Comments

@p6rt
Copy link

p6rt commented Dec 16, 2012

Migrated from rt.perl.org#116114 (status was 'rejected')

Searchable as RT116114$

@p6rt
Copy link
Author

p6rt commented Dec 16, 2012

From @bbkr

<bbkr_> rakudo​: print now.WHAT
<p6eval> rakudo 7fd707​: OUTPUT«use of uninitialized variable $v of type Instant in string context in block at /tmp/vPks5sMJeI​:1â�¤â�¤Â»

@p6rt
Copy link
Author

p6rt commented Dec 17, 2012

From @moritz

There's nothing broken about this. .WHAT returns a type object, which
warns when used as a string.

Note that if you use say() instead of print(), say() uses .gist instead
of .Str to turn the type object into a string, which is why you don't
get a warning.

If you want to print the name of a type, either use

print now.^name

or

print now.HOW.gist

(that latter includes the pair of empty parens)

Cheers,
Moritz

1 similar comment
@p6rt
Copy link
Author

p6rt commented Dec 17, 2012

From @moritz

There's nothing broken about this. .WHAT returns a type object, which
warns when used as a string.

Note that if you use say() instead of print(), say() uses .gist instead
of .Str to turn the type object into a string, which is why you don't
get a warning.

If you want to print the name of a type, either use

print now.^name

or

print now.HOW.gist

(that latter includes the pair of empty parens)

Cheers,
Moritz

@p6rt p6rt closed this as completed Dec 17, 2012
@p6rt
Copy link
Author

p6rt commented Dec 17, 2012

@moritz - Status changed from 'new' to 'rejected'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant