Chaz Meyers (cpm) wrote,
Chaz Meyers

Note to self: precidence matters!

Note to self:

variable = A and B ? some_method_returning_array() : []

`variable` is always set to `A` because `and` does not bind as tightly as `&&`! Oops!

I definitely did not spend an hour not realizing this. Not at all. :)
Tags: computers, nerdcore, ruby, you wish you were as cool as me

  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.