[DGD] Delay statements in scripting

Par Winzell zell at skotos.net
Sun Jan 4 18:02:11 CET 2004


> Instead of programming in LPC, you write in a scripting language (which
> can be identical) which is translated into LPC.  All local variable and
> function argument references are replaced with references to some pool
> where they can be kept in case of a delay.  Each function is called with
> an additional argument, the entry point; each function call and each
> delay creates a new entry point just before, and just after the function
> call or delay, respentively.  You arrange the code for quickly restarting
> at this entry point.  LPMOO puts the whole function within a switch, as
> follows:
> 
>     int foo(int entry, mixed *variables_and_arguments)
>     {
> 	switch (entry) {
> 	case 0:
> 	    /* normal start of the function */
> 	    ...
> 	case 1:
> 	    /* further within */
> 	    ...
> 			    case 2:
> 				/*
> 				 * still further, several compound statements
> 				 * deep, switch allows this
> 				 */
> 				 ...
> 	}
>     }


This is precisely what Merry does.

Zell

_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list