Jani Kajala | 1 Oct 2002 01:02

Re: efficient calling of lua code

> But how do I correctly call this not explicitly defined "top level
> function" containing all code of my script?

You can't, but you can move the same code inside a function and call that
instead.

Jani

----- Original Message -----
From: "Jens Hassler" <lukey <at> gmx.de>
To: "Multiple recipients of list" <lua-l <at> tecgraf.puc-rio.br>
Sent: Monday, September 30, 2002 7:45 PM
Subject: Re: efficient calling of lua code

> Hi Jani,
>
> > Just define some functions in Lua code, dobuffer only once, and call
> > the Lua functions from C++ code...
>
> Okay, I know how to call Lua functions from C++, I do this in my game,
> too.
>
> But how do I correctly call this not explicitly defined "top level
> function" containing all code of my script?
>
> Thx,
> Jens

Picon

Re: efficient calling of lua code

>> But how do I correctly call this not explicitly defined "top level
>> function" containing all code of my script?
>
>You can't, but you can move the same code inside a function and call that
>instead.

In Lua 5.0, you can get the "top level function": it's left on the top of
the stack by lua_load in C and returned by loadfile or loadstring in Lua.
--lhf

Benoit Germain | 1 Oct 2002 15:02
Picon

'continue' keyword

Hi all,

I was putting together a little powerpoint slide (argh! yuck!) to give an
overview of LUA to a few colleagues, and I was writing a comment about
'break' being here to break out of loops, and I thought that there is no
'continue' keyword. Is this because nobody ever needed it, or is there some
other reason ? It could be useful though...

Cheers,

Benoit.

Joshua Jensen | 1 Oct 2002 17:17

RE: 'continue' keyword

> I was putting together a little powerpoint slide (argh! 
> yuck!) to give an overview of LUA to a few colleagues, and I 
> was writing a comment about 'break' being here to break out 
> of loops, and I thought that there is no 'continue' keyword. 
> Is this because nobody ever needed it, or is there some other 
> reason ? It could be useful though...

I can't even begin to say how useful this would be.  Many of my loops
have great big nested if-else blocks because I can't force start the
next pass of the loop (through 'continue')...

Josh

Picon

Re: efficient calling of lua code

>Is tolua available for Lua 5 or is it compatible to it? If not, when  
>will there be a new version?

A tolua for Lua 5.0 will be available by the time Lua 5.0 final is released,
which should still be in 2002.
--lhf

Ignacio Burgueño | 2 Oct 2002 00:11
Picon

Order of evaluation

Hi, I'm using Lua 4.0 and I ran into trouble with the order of evaluation.
 
I have two functions:
SetAttribute("name of attribute", "value")
and
GetUniqueID() which returns a string
 
If I do this:
SetAttribute("a name", GetUniqueID())
 
The former function gets called with an empty string as the second parameter and the GetUniqueID is called. (both are C functions)
 
I have similar code to this, and the order of evaluation is correct. I don't know what goes on in this case.
 
Thanks in advance
Ignacio Burgueño
David Burgess | 2 Oct 2002 00:45

Libraries in 5.0

What is the expected timing of LuaSQL and LuaSocket
being converted to Lua 5.0?

Philippe Lhoste | 2 Oct 2002 10:39
X-Face
Picon

Re: 'continue' keyword

Benoit Germain <bgermain <at> ubisoft.fr> wrote in
news:5D2A198567EED311BD0F009027A25C87DAD116 <at> SRVMAIL-ANN: 

> I was putting together a little powerpoint slide (argh! yuck!) to give
> an overview of LUA to a few colleagues, and I was writing a comment
> about 'break' being here to break out of loops, and I thought that there
> is no 'continue' keyword. Is this because nobody ever needed it, or is
> there some other reason ? It could be useful though...

I believe this question has been raised already.

I tried to search the archive using the Web interface, but the
<http://lua-users.org/lists/lua-l/> URL seems broken, I got a directory
listing (with only the 2002-05 folder, containing only msg00159.html)
instead of the search form. 

Searching 'continue' in the old (January) archive I have on my hard disk,
I see the topic was first mentioned on 30 Oct 1997! Message-Id:
<199710300318.JAA05107 <at> odusv.oduurl.ru> A lot of people stated they miss
continue (and break, which wasn't in the language at the time). 

Another request was in 15 Sep 2000 Message-ID:
<ce.aa17026.26f3498f <at> aol.com>, and I think it was asked recently too. 

Now, I can't remember the official answer :-)

--

-- 
--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--
Philippe Lhoste (Paris -- France)
Professional programmer and amateur artist
http://jove.prohosting.com/~philho/

Picon

new project added

ELinks
http://www.lua.org/uses.html#75

Picon

lua-l archive at lua-users.org

The page http://lua-users.org/lists/lua-l/ is showing only one line,
but everything seems to be there and accessible from
http://www.lua.org/lua-l-stats.html ...

--lhf


Gmane