[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: How to comprehend "in Lua, all functions are anonymous. Like any other value, they do not have names. " at a deeper level?
- From: Matěj Cepl <mcepl@...>
- Date: Tue, 13 Oct 2020 09:56:11 +0200
孙世龙 sunshilong píše v Út 13. 10. 2020 v 09:38 +0800:
> How to comprehend "in Lua, all functions are anonymous. Like any other
> value, they do not have names. " at a deeper level?
https://en.wikipedia.org/wiki/First-class_function
The same goes for all functional languages, but it is also the
saving grace for JavaScript, and it is present (although not
that prominent) in Python. For most classical (C/C++, Java,
Pascal, etc.) functions are completely different animals from
values which are manipulated inside of them. For these modern
languages, functions are just same objects as integers.
Matěj
--
https://matej.ceplovi.cz/blog/, Jabber: mcepl@ceplovi.cz
GPG Finger: 3C76 A027 CA45 AD70 98B5 BC1D 7920 5802 880B C9D8
I would like to die sleeping, like my father — rather than
screaming and helpless, like his passengers.
Attachment:
signature.asc
Description: This is a digitally signed message part