Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Simple Vocabulary Question

Cyrus Odets
Registered User
Join date: 5 Oct 2005
Posts: 51
01-12-2006 11:49
Just a simple question, real simple for anyone whom is a programmer in another event-driven language.

What do you call a script curent "location(s) of execution"?

I'll explain better...

Lets say that you have the following simple function...

SampleFunction(string testName) {
integer i = llListFindList(testList, (list)testName);
llOwnerSay("My name is: " +llList2String(testList, i));
llOwnerSay("My age is: " +llList2String(testList, i+1));
}

If the code 'pointer' (for lack of a better term) is currently executing one of these lines...what do you call that position?

Similarly....if I alter the above example as so....

SampleFunction(string testName) {
llMessageLinked(0, 0, testName, NULL_KEY);
integer i = llListFindList(testList, (list)testName);
llOwnerSay("My name is: " +llList2String(testList, i));
llOwnerSay("My age is: " +llList2String(testList, i+1));
}

link_message(integer sender_num, integer num, string str, key id)
{
llOwnerSay(str);
}

Then we have sort of a multi-thread thing going....the code hits the "llMessageLinked" and begins executing the code in the link_message event while, still continuing onwards to execute the remaining lines in SampleFunction.

So I'm just curious as to the vocabulary used here in order to describe the current "location(s) of execution in the code"?

Thanks!
Rickard Roentgen
Renaissance Punk
Join date: 4 Apr 2004
Posts: 1,869
01-12-2006 11:59
lsl is not multithreaded. the linked_message event will not fire until that function has exited and all previous events in the queue have been handled. As for what the position is called... if i were debuging I would probalby ask at what point the script failed... so point? I have no idea.
_____________________
Ben Bacon
Registered User
Join date: 14 Jul 2005
Posts: 809
01-13-2006 01:17
From: Cyrus Odets
So I'm just curious as to the vocabulary used here in order to describe the current "location(s) of execution in the code"?
I'm not aware of a single standard - but looking at myself and developers with whom I've worked, "Instruction Pointer" or "Current Statement".

IP is usually used by the older developers (myself included) and the low-level guys, because it is what the processor calls it, and many of us started in assembly or similar.

Newer developers, used to modern high-level language debuggers tend to think of the current statement.

For LSL specifically, the "call stack" in my head is usually worded something like "executing the 2nd OwnerSay in SampleFunction, which was called by the touch_start event in the scanning state"