[Date Prev][Date Next][Thread Prev][Thread Next]
- 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" <email@example.com>
To: "Lua list" <firstname.lastname@example.org>
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.
>> > 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.