dhh1128 / intent

the intent formal language
https://intentlang.org
2 stars 1 forks source link

support aliases #101

Open dhh1128 opened 9 years ago

dhh1128 commented 9 years ago

An important compatibility mechanism on *nix is the ability to create symbolic links or hard links in the file system, so that applications that expect a file in a particular place can find it there, even if that location is now deprecated.

We need a similar mechanism in source code, such that if a method or member or class is renamed, the old name can still be used to access it. In C++, renaming a member can be accomplished by creating an anonymous union containing the old and the new name; renaming a method can be handled by duplicating the method and making the old name call the new name; renaming a class can be handled by a typedef. Obviously this won't solve the problem of tweaking the semantics of the name, and it will be limited to cases where a new name doesn't collide with an old one that has a different meaning, but it should still provide important flexibility and remove an impediment to refactoring.