@remi said in (are (arguments for (using lisp)) (still valid?)):
You can't do that natively in C++. You can emulate it with various workarounds (some of them are described in the Wiki page). But they're not direct features of the language, like it apparently is in C#. Those workarounds are going to be either more (boilerplate or weird) code, or worse performances. Likely both at the same time.
You actually can do it in C++, because it does have function overloading, although only at compile time. The same is true in C#, except that the "compiler part" is available at runtime (intended for scripting languages, which is why the usage is so awkward in C#).
Basically, Stroustrup decided that overriding is something completely different and unrelated to overloading and must never be confused (which is why they have similar names, because the C++ design philosophy is ). Otherwise, he would have to implement CLOS multiple dispatch.
But, back to the C# thing, the part that bothers me is that it is up to the caller to ensure they say "hey, this variable is dynamic
, don't forget to dispatch based on it" which sounds wrong to me. The workaround (shown in this subthread and in the Wiki page) is to use another wrapper function around it, but that's ugly boilerplate, which makes the feature less attractive.
As said above - this dynamic
part should not be in the language at all, as it is basically just .NET implementation internal thing. IMHO it is exposed only to make C# the "ultimate" .NET language that is superset of every other .NET langauge.