Polymorphism is the ability of something to appear as something else depending on the context in which it is used. In RPL it is much the same. Procedures in RPL permit this by looking at the parameters provided and return value expected (if any) and choosing between possibly many routines with the same name. For instance, a function called combine() could be declared in two different ways without conflicting:
function combine(num1, num2);
function combine(string1$, string2$);
These two procedures, despite having the same ‘name’ are quite different. In the first, the parameters are two integers, and in the second there are two strings. Now, let’s say that each combine() function simply adds the two parameters and returns the integer summation. In the first, it is a direct addition, but in the second, perhaps it converts the strings to integers first before adding them.
Indeed, the functionality (no pun intended) of each procedure doesn’t have to be related at all. The first combine() function could do a summation and the second could return the price of a cheeseburger after adding extra mayo and pickles. However, this is usually bad programming practice, as the name of a procedure is usually intended to give some in hint as to its purpose.
If the two purposes are different, it leads to confusion in development. So, for instance, you could call them like the following (note that two different procedures are being called):
x = combine(5, 10); (* x gets 15 *)
x = combine("5", "10"); (* x gets 15 *)
Also note that the polymorphism described here is not the same as OO polymorphism and dynamic binding of procedure calls. Rapture has compile-time context polymorphism only.