[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua Needs
- From: Gabriel Bertilson <arboreous.philologist@...>
- Date: Mon, 26 Nov 2018 18:16:28 -0600
I haven't done game programming in Lua, but it occurred to me that the
component syntax would allow you to use utf8 functions as string
methods: ('βλαβλα'):utf8.codepoint(1, -1) instead of
utf8.codepoint('βλαβλα', 1, -1). That's neat. The utf8 library would
have to be added as a field inside the __index metafield of the string
On Mon, Nov 26, 2018 at 6:02 PM Russell Haley <firstname.lastname@example.org> wrote:
> On Mon, Nov 26, 2018 at 2:30 AM Soni "They/Them" L. <email@example.com> wrote:
>> On 2018-11-26 7:22 a.m., Pierre Chapuis wrote:
>> > On Mon, Nov 26, 2018, at 01:15, Soni They/Them L. wrote:
>> >> - Lua has little to no support for composition-based OOP, whereas it has
>> >> many features to support inheritance (__index/__newindex) and other
>> >> forms of OOP (self:methods()). This isn't a big deal, tho, as it can be
>> >> easily solved with a rather small patch.
>> > Can you give an example of what you would want here?
>> > Because for me, "composition-based OOP" does not need much
>> > language support. For what it's worth I almost never use inheritance
>> > in Lua (or any other language, really).
>> The classic Cratera `foo:[component].method()` (note the colon) syntax.
>>  https://bitbucket.org/TeamSoni/cratera
> I looked at cratera once but didn't grasp the benefits because I don't write games. Months later I was reading Roblox game code and the use case for cratera became crystal clear. Likewise, Garry's Mod has very deep component nesting and a library like cratera would simplify development.
>  I still don't write games so I may be off mark.