Making New Words

Early vs Late Binding

Smojo binds 1st’s original action when it creates 2nd. This isn’t lost after 1st is redefined. This is known as early binding, since 1st’s action is bound to 2nd’s body at the point of 2nd’s creation. When 1st is redefined, a new action is assigned to 1st on the dictionary. Subsequent usage of 1st will use this new action.

By contrast, late binding, which is not the default in Smojo, would resolve the action of 1st at 2nd’s runtime. So with late binding, 2nd would have 2 different actions, one before 1st’s redefinition and one after it, since 2nd would actively resolve the actions at runtime.

It is actually possible to get Smojo to use late binding in special cases, eg: if you are transporting code across multiple computers or if you need upgrades or are dependent on specific versions depending on the local computer. In these scenarios, you’d want to use late binding. But it can lead to bad bugs if used indiscriminately.