[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua evolution and C99
- From: Dirk Laurie <dpl@...>
- Date: Tue, 9 Aug 2011 08:23:12 +0200
On Tue, Aug 09, 2011 at 02:46:07AM +0200, Leo Razoumov wrote:
> On Fri, Aug 5, 2011 at 07:45, Luiz Henrique de Figueiredo
> <email@example.com> wrote:
> > What C99 features would enhance Lua? Some interesting ones, like complex
> > numbers and a larger math library are available as external Lua libraries
> > at http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/ . I think there is even
> > a patch to make lua_Numbers complex.
> Actually, making lua_Numbers complex is a bad idea.
In fact the lcomplex package at that site implements complex numbers
as userdata, so lua_Numbers are intact.
- LHF's libraries show that access to C99 features via add-on packages
is as easy as putting `#define _GNU_SOURCE 1` or `#include <complex.h>`
in one's C code.
- The Lua distribution is written in "clean C, the common subset of ANSI C
and C++", which is a subset of C99 too, isn't it?
- The few places where the underlying C implementation is obtrusive, e.g
string.format, tend to annoy "pure Lua" users.
So this C99 issue seems to another of those where the user can perfectly
well roll his own, no need to hassle the Lua team.