Похожие чаты

> does anyone know any non-oop language that supports overloading? Does

branching different implementations inside a single function qualify to be called as "Overloading" ?

If yes, JavaScript.

5 ответов

15 просмотров

lua.

@^@ ^
lua.

Are you sure about it? I spent around 30 mins looking at "programming in lua" and didn't find anything about overloading. It's dynamically typed language, it can't have type-based overloading by definition. Even if it could dispatch function calls to different implementations based on parameter types, it would do this ONLY in runtime. Which is not overloading. Neither google gives me anything for "lua function overloading". It actually says the opposite - overloading is not supported. http://lua-users.org/wiki/OverloadedFunctions https://scriptinghelpers.org/questions/24647/does-lua-support-overloading-functions-two-identically-named-functions-with-different-parameters You can check original question, I dropped C example that demonstrates full support for overloading. It will work only if compiled with C++ compiler actually)) That's exactly why I'm looking for a good pure example - non-oop language that supports functions overloading both by parameter number and parameter types. Just like in my C/C++ example.

@^@ ^
metatables in lua allow for overloading.

can you please give me some link with example? I am not familiar with lua, so it's very hard for me to understand where to search and what to search for)

Dmytro Buryak
can you please give me some link with example? I a...

Just search metatables in lua, you can choose which function get's called, when specific thing is passed to a metatable function, override it, etc...

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

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

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
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
Карта сайта