[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Questions about writing a C library
- From: Jamie Webb <j@...>
- Date: Wed, 24 Mar 2004 14:42:17 +0000
On Wednesday 24 March 2004 05:20, Phil Bewig wrote:
> I have mentioned a few times that I feel a strongly
> functional flavor in lua. I suspect that in addition
> to lists, lua would be improved with some library support
> for higher-order functions. Function composition,
> currying, identity and negation functionals might all
> be useful.
> In a parallel universe far from here, I am
> currently finalizing srfi-40 for streams; would an
> explicit delay/force, as in scheme, fit the language?
How does this differ from nullary closures?
> Closures mean that lua has the tools to be programmed in
> continuation-passing style; has anybody done that and
No theoretical reason why you couldn't, but I think the syntax would drive you
crazy (it'd be even worse than Scheme :-).
> Please don't think I am trying to force lua
> to fit my idea of the perfect language. I'm not. I'm
> just responding to what I see when I look at the language.
> Hopefully my comments as an outsider might trigger those
> of you who are experts to add features and expressive
> power to the language, wisely, in keeping with its own
> unique character.
I think it might be worth noting that a major part of Lua's 'unique character'
is its simplicity. At one point for example, I had great plans to write a
library that would endow Lua with sophisticated OOP capabilities; I decided
not to bother in the end, because the ad-hoc OOP done by most Lua practioners
suffices in most cases, and can be extended in small ways if necessary. One
thing I do agree with you on though is that I would like to see (optional)
type-checking made a more formal part of the language (incidentally, in
answer to your question about that, you probably want luaL_checkudata() and
-- Jamie Webb