{"issue":{"state":"open","pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"milestone":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/d1588981e0248aaa0174906c99df180e?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"d1588981e0248aaa0174906c99df180e","url":"https://api.github.com/users/petdance","login":"petdance","id":41100},"labels":[{"name":"bug","color":"1AA195","url":"https://api.github.com/repos/petdance/scratch/labels/bug"},{"name":"core","color":"DAA3CE","url":"https://api.github.com/repos/petdance/scratch/labels/core"},{"name":"Pri-normal","color":"6770F0","url":"https://api.github.com/repos/petdance/scratch/labels/Pri-normal"},{"name":"Sev-medium","color":"473A34","url":"https://api.github.com/repos/petdance/scratch/labels/Sev-medium"}],"assignee":null,"updated_at":"2011-11-14T06:14:55Z","comments":0,"closed_at":null,"url":"https://api.github.com/repos/petdance/scratch/issues/1164","body":"And instead, boolean contexts fall back to expecting ints. This is not semantically correct, and leads to issues, especially when trying to expose a HLL's object system to the rest of parrot.\nIn my specific case, I implemented get_bool on Python objects, but Rosella's is_true and winxed's if coerce to int. Rosella and Winxed are doing the least wrong thing possible with that they've got.\r\n\r\nImplementing get_integer to return 0 for false, 1 for true and the value for Python ints is simply incorrect. At least in python 0 is falsy, which makes it possible to have this workaround, in other languages it would be required to simply not implement get_bool or get_integer, to not break things.\r\n\r\n\r\nThe workaround in Winxed is the ternary operator (bla ? 1 : 0), which ends up calling bla.get_bool.\r\n\r\nOriginally http://trac.parrot.org/parrot/ticket/2178 by lucian","html_url":"https://github.com/petdance/scratch/issues/1164","title":"Parrot lacks a boolean type","number":1164,"id":2227486,"created_at":"2011-11-14T06:14:55Z"},"action":"opened"}