Похожие чаты

Foo (int, int) foo (int, int, double) foo (int, int, bool) :

int
foo (int, int, double, string)


can this be done in almost paradigms? 🤔 oop, logic, functional, etc.

1 ответов

26 просмотров

Funny enough, but no )) N2 and N3 are especially interesting, because those have same number of input parameters. And in order to distinguish them, compiler must be smart enough to differentiate "double" and "bool" types. For example, same javascript doesn't support it because of it's untyped. Same for python. C doesn't support it because it's old, and commitee tends to keep it super simple (which is good). C++ supports it for non-oop code, which I demonstrated with an example, you have to compile it with c++ compiler, but it uses only C features, there are no any oop features used there. In java you can't have non-oop code, so we can cross it out. Scala or groovy are running on jvm, so it's not 100% correct to put them into equation here. Haskell doesn't have direct support for it afaik, only by using another feature for emulating it, but it's better than in javascript. Erlang is a very special language, and overloading is not applicable to it at all. Well, I don't know much about other languages to answer it. But the fact is that I just can't find any example of pure non-oop language that has function overloading feature there directly, without emulation.

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта