On Thu, Jan 24, 2008 at 02:31:26PM -0500, Mathieu Bouchard wrote:
On Wed, 23 Jan 2008, Hans-Christoph Steiner wrote:
What other programming language has aliases?
Ruby accepts both 'indices' and 'indexes' as selectors in the Array and Hash classes. Ruby has 'alias' as a reserved word.
Perl has so many redundant language constructs for doing the same thing multiple ways that it's not even worth mentioning them all (And that is considered by Perl programmers as a major feature of the language).
PHP has aliases for heaps and heaps of functions (eg is_int == is_integer).
Haskell's 'type' keyword effectively creates an alias from sub-types.
Javascript has the 'with' statement that is similar to aliasing and JS also allows you to declare variables/functions/objects in multiple ways with different syntax.
Many languages have a shortened form of if statement that is effectively a low-syntax alias for the regular if statement.
Best,
Chris.
------------------- http://mccormick.cx