Похожие чаты

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

14 просмотров

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...

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

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

а через ESC-код ?
Alexey Kulakov
29
30500 за редактор? )
Владимир
47
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
Чёт не понял, я ж правильной функцией воспользовался чтобы вывести отладочную информацию? но что-то она не ловится
notme
18
Привет)) уже кажется эту тему перемусолили, но вот я так и не понял. Я сейчас сижу на 27дюймов 2к мониторе. На Актуальной макоси, если я куплю 27д 4к монитор: - будет ли изобр...
Vladislav Piskunov
15
Hi guys, any problem with Pulsebrige? Trying to transfer from wETH to ETH. First it tells me to connect my metamask "through mobile app" not desktop. Then I did and confirmed ...
Snowflakecrypto
13
any reference of this implementation?
BitBuddha
29
У меня есть функция где происходит это: write_bit(buffer, 1); write_bit(buffer, 0); write_bit(buffer, 1); write_bit(buffer, 1); write_bit(buffer, 1); w...
~
13
Страшнейшая правда про списки ЦБ. С первых дней жизни P2P сферы, молодые человеки, начитавшись законодательной базы и "внутренних" документов, решили, что им противостоит сер...
Foxcool
3
&"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.42.34433\bin\Hostx64\x64\dumpbin.exe" /EXPORTS C:\Users\Yeet\Tauon\vcpkg\installed\x64-window...
Martin Rys
6
Карта сайта