help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] Using Smalltalk as a scripting language


From: Paolo Bonzini
Subject: Re: [Help-smalltalk] Using Smalltalk as a scripting language
Date: Tue, 27 Oct 2009 21:48:30 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20091014 Fedora/3.0-2.8.b4.fc11 Lightning/1.0pre Thunderbird/3.0b4

On 10/27/2009 09:30 PM, Roland Plüss wrote:
On 10/26/2009 08:10 PM, Roland Plüss wrote:
Why the gst_set_executable_path does not exist in gstpub.h
I don't know.

Just an old version of GST.
It's 3.0.5 , that should not be too old shouldn't it?

No, but set_executable_path was added in 3.1. :-)

from that time on I operate on the game object sending all kinds of
messages. What goes for calling the initGame method I think I figured
out from the docs how this is supposed to be done but what goes for
loading the script files and parsing them I'm still at a loss.

_gst_process_file works.  If the file is just a bunch of class and
method definition, it won't block.

If the main program is written in Smalltalk, you actually want to make
it blocking though.
What exactly you understand as a main program? What I want is to load
only a bunch of classes with the script files. The main program is the
game loop run inside the game engine (c++) which then occasionally sends
messages to the game object ( which in turn is an instance of some game
base class provided to the developer ). So if I get you correctly then I
can simply call _gst_process_file for any single script file without
getting a block.

Yes.  I now understand you.

Is there a way to prevent this function call from ever
blocking?

No, that's not possible. You could run _gst_process_file in a separate thread though. When _gst_process_file finishes, the thread would tell the main thread that it can execute Smalltalk code. Until _gst_process_file finishes, the main thread could keep executing, but would not be able to execute Smalltalk code.

I guess I posed the wrong question. I talk about the c functions in the
gstpub.h file like for example _gst_process_file and company. I didn't
find a man page or anything in the docs which outlines how to use these
c functions or which kind of parameter values they know/accept.

The functions beginning with _gst_ are not public, only those beginning with gst_ are (each gst_ function has a private counterpart; they're exactly the same and are separated just for optimization purposes).

Most of these are documented in the info manual. gst_process_file is an exception (it is documented by an example, but not in the function reference).

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]