I find overloading very useful in my C# code. I know it can be done in many other languages too (C++ for sure).
Does LISP allow overloading or something equivalent?
This feature is present in most of the Object Oriented Languages such as C++ and Java. But C doesn't support this feature not because of OOP, but rather because the compiler doesn't support it (except you can use _Generic).
In which of the following languages is function overloading not possible? Explanation: Function Overloading is not possible in C as it is not an Object-Oriented Language.
C++ lets you specify more than one function of the same name in the same scope. These functions are called overloaded functions, or overloads. Overloaded functions enable you to supply different semantics for a function, depending on the types and number of its arguments.
Function overloading is a feature of object-oriented programming where two or more functions can have the same name but different parameters. When a function name is overloaded with different jobs it is called Function Overloading.
Common Lisp does not.
Common Lisp does not support 'overloading'.
Common Lisp provides polymorphism via CLOS, but not overloading.
Yes it does have "something similar", but more powerful: generic functions.
EDIT: I wasn't aware that the definition of overloading implies compile-time resolution. Thanks Rainer Joswig.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With