[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Could somebody explain to me about "Extending and Embedding"
- From: "jason zhang" <jzhang@...>
- Date: Tue, 26 Sep 2006 08:51:42 +0800
Thank you two!
----- Original Message -----
From: "Richard Ranft" <rranft@lvcablemodem.com>
To: "Lua list" <lua@bazar2.conectiva.com.br>
Sent: Wednesday, September 20, 2006 9:32 PM
Subject: RE: Could somebody explain to me about "Extending and Embedding"
> This is also discussed in an abstract way in the PiL book. Chapter 24
> starts with a description of this from the developers' point of view. The
> first 3 or 4 paragraphs should do the trick.
>
> Rich
>
>> > I often heard "Extending and Embedding" about Lua. But what's the
>> > exact difinitions about them?
>>
>> An application embeds Lua when it calls lua_open, that is, when it
>> creates a new Lua state. The Lua interpreter is the most familiar
>> case of this.
>>
>> A library or host application extends Lua when it registers
>> functions (by means of lua_pushcclosure, lua_pushcfunction and
>> friends) to be called from Lua.
>>
>> An embedding application often extends Lua as well, and an
>> extension library can embed Lua by opening new Lua states.
>
>