On 2020-05-17 03:50, Elizabeth Mattijsen wrote:
[11:50:21] <lizmat> you don.t need the .Bool, .e already returns a Bool [11:53:07] <ToddAndMargo> sometimes IO.someletter returns True of Fail, not False. Tacking .Bool on the end, means I don't have to remember which ones [11:57:23] <ToddAndMargo> True or Fail. Typo [11:58:21] <lizmat> A Failure is always false [12:03:02] <ToddAndMargo> A Fail is a lot more than that. here is an example: >raku -e "say Q[z:\].IO.d;"Failed to find 'Z:\' while trying to do '.d' in block <unit> at -e line 1 [12:04:16] <ToddAndMargo> I use .bool at the end because I only want back a yes or no answer. And I certainly don't want it to crash. Always using .Bool keeps me out of trouble [12:19:21] <lizmat> say "directory foo exists" if "foo".IO.d [12:19:49] <lizmat> you don't have to worry about Failure then, which is the point of Failure to begin with [12:23:33] <ToddAndMargo> That is `if` converting the `X::IO::DoesNotExist` clutter into False for me. I never know when that will happen and when it won't, so tacking .Bool at the end keeps me out of trouble. I am not a purest here. I do not mind seeing .Bool at the end. It also tells me I will be seeing a Boolean. [12:28:42] <ToddAndMargo> bye bye for now. Thank you all for the tips!
Yup, That is it. Keep me from having to pull my hair out.