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
Bool.pick always returns false. #1894
Comments
From lembark@wrkhors.comUsing the June release: $ perl6 --version Attempting to print some random numers via Bool.pick #!/opt/parrot/bin/perl6 use v6; .say if Bool.pick for ^100; $ perl6 hak The same basic process using (0..1) does work: $ cat hak use v6; .say if (^2).pick for ^100; $ perl6 hak I get the same result from the command line with a file -- |
From @pmichaudOn Mon Jun 28 04:49:23 2010, lembark@wrkhors.com wrote:
For a wide variety of reasons, Rakudo currently implements Bool as a For now, the workaround is to do (False,True).pick until we can properly Pm |
The RT System itself - Status changed from 'new' to 'open' |
From @markjreedThat is terribly confusing. I'm tempted to argue for .pick not being Do any of the other non-Enumerated types besides Bool have a finite On Monday, June 28, 2010, Patrick R. Michaud via RT
-- |
From @masakOn Mon Jun 28 11:38:07 2010, markjreed wrote:
I think you misunderstand. The confusion doesn't originate in Perl 6, but in Rakudo. It wouldn't manifest if Bool were Bool is an enumerated type in the spec. By the spec, .pick on an enumeration type *should* If it's really really important that Bool.pick return a random Bool, you can always inject your use MONKEY_TYPING; In fact, I see no reason not to patch Rakudo itself with this method for the time being. |
From @markjreedI didn't misunderstand. I just find it confusing that $foo.pick I get that Bool.pick is supposed to work either way. On Tuesday, June 29, 2010, Carl Mäsak via RT
-- |
From lembark@wrkhors.comOn Mon, 28 Jun 2010 08:13:21 -0700
Q: Why would the object type be false? I would have thought that Bool.pick and print for ^100 turning into 'Bool' and print for ^100; would print all of the values, rather than printing
Actually ^2.pick works nicely also, just seemed thanx -- |
From @thundergnatTested on Rakudo 2010.11 Works correctly now.
|
From @moritzWorks now, and is tested in S32-list/pick.t |
@moritz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#76238 (status was 'resolved')
Searchable as RT76238$
The text was updated successfully, but these errors were encountered: