Type "help", "copyright", "credits" or "license" for more information. >>> temp_true = True >>> temp_false = False >>> True = temp_false >>> False = temp_true >>> True False >>> False True
Even the built-in constants True and False can be overwritten with arbitrary content. This flexibility is probably rarely required and if this happens by accident, the logic of the following program is most likely screwed.
>>> True = "hello world" >>> True 'hello world'Ruby does have a little advantage here, since it does not allow assigning new values to true and false.
No comments:
Post a Comment