Search code examples
programming-languagesmetaprogramminglanguage-designlanguage-features

Looking for Programming Language that allows you to change true and false


For my curiosity sake I'm looking for a dynamic object oriented language that allows you to change true to false and vice versa.

Something like this:

true = false, false = true;

This should also affect any conditional statements, therefore 42 == 42 should return False. Basically, with this premise, nothing in the language would be safe from the programmer.

Is there any language like this?


Solution

  • Smalltalk will let you do this.

    Everything in Smalltalk-80 is available for modification from within a running program. This means that, for example, the IDE can be changed in a running system without restarting it. In some implementations, the syntax of the language or the garbage collection implementation can also be changed on the fly. Even the statement true become: false is valid in Smalltalk, although executing it is not recommended. When used judiciously, this level of flexibility allows for one of the shortest required times for new code to enter a production system.

    http://en.wikipedia.org/wiki/Smalltalk