Похожие чаты

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 ответов

10 просмотров

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.

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

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

@LGCYMan @JustinKKW Q/A List 1. this part confuses me on #8: "From there, a bridge between erc20 LGXY and erc20 LGXY will be out once that swap is closed." does this mean ...
Sig | LGCY | BattleVerse L1 | BitWin
1
How do I get FrxEth? Need it to execute a contract
Abdullah $BTON
18
Did @Beeker really get banned? That's ridiculous. He's one of the few left here with half a brain and you might not always like his narrative @dgb_ycagel , but he often keeps ...
Leroy Gerrits
1
Anyone here suffers from unexplained aural migraines, who would be up for talking for a bit? Doesn't *have* to be aural, but I am not asking about headaches, I mean actual mi...
Martin Rys
55
async login(req: Request, res: Response, next: NextFunction): Promise<void> { try { const { errors, input } = await RequestValidator(LoginRequest, req.body...
. .
1
Я тут за тем, чтобы задать вопрос, так как не знаю ассемблер, учу с/с++. Короче, насколько дорога операция перехода в функцию при ее вызове? Дело в том, что в с++ есть макросы...
Максим Рябцев
12
A couple thoughts from a random internet stranger: 1. If you want this project to gain traction you cannot keep being negative. If I just came here after finding out about Kd...
Eric Wild
46
Hi Guys, I just end stake and there is shortage of the actual tokensamount and that shortage  appear eth stake in token column, any idea what is going on, meta mask scam our h...
Ivan Creates
10
А какие чаты вообще в ходу? Auto aim? И что еше
do you think you're better off alone? А
13
What website can you interact with the chip process?
Firstname Lastname
9
Карта сайта