Contents | Index | < Browse | Browse >

7.10.  Internal Structure Manipulation Routines

     The following routines are	the means  whereby  the	 ADL
programmer  may	 modify	the Internal Structures	described in
Chapter	3.  See	also Chapter 4 for the use of some of  these
routines.

$sdem	( $sdem	rout ) -> No return value.   Activates	rout
	as a daemon.

	Example:
		     ($sdem Looker)
		     ($sdem Follower)



$ddem	( $ddem	rout ) ->  No  return  value.	De-activates
	rout as	a daemon.  No action is	taken if rout is not
	an active daemon.

	Example:
		     ($ddem Follower)



$sfus	( $sfus	actor rout  count  )  ->  No  return  value.
	Activates rout as a fuse associated with actor to be
	executed in count turns.

	Example:
		     ($sfus .ME	LampDie	300)



$dfus	( $dfus	actor  rout  )	->  No	return	value.	 De-
	activates  rout	as a fuse associated with actor.  No
	action is taken	if rout	is not an active fuse.

	Example:
		     (IF @BatteryFound THEN
			     ($dfus .ME	LampDie)
		     )



$incturn( $incturn [ nturns ] )	-> No return value.   Incre-
	ments  the turn	counter	by nturns (or 1	if nturns is
	not given) and activates any fuses  associated	with
	the  current  actor  that  have	 "burned down".	 The
	"burned	down" fuses are	then de-activated.  The	 ADL
	programmer  to "halt time" by refraining from incre-
	menting	the turn counter.   Usually,  ($incturn)  is
	only  called  when the daemons are executing for the
	primary	actor.	For other actors,  ($incturn  0)  is
	used  to  see  whether the fuses associated with the
	current	actor have burned down,	without	incrementing
	the turn counter.

	Example:
		     sleep(ACTION) = ($incturn 300) ;



$turns	( $turns ) -> Returns the current value	of the	turn
	counter.

	Example:
		     (IF ($eq @Verb north) THEN
			     (IF ($gt ($turns) 230) THEN
				     ($move .ME	room3)
			      ELSE
				     ($move .ME	room5)
			     )
		     )



$prompt	( $prompt rout )  ->  No  return  value.   Sets	 the
	prompter to be rout.

	Example:
		     ($prompt Prompter)



$actor	(  $actor  obj	str  flag  )  ->  No  return  value.
	Activates  obj	as  a new Actor	with the line buffer
	initialized to str.  If	flag is	 non-zero  then	 the
	new Actor will be interactive.	If flag	is zero	then
	the new	Actor will be non-interactive.	 If  str  is
	zero then the line buffer will be initialized to the
	empty string.

	Example:
		     ($actor Myself NULL TRUE)
		     ($setg s "Go east then south.  Push button.  Go north")
		     ($actor robot @s FALSE)



$delact	( $delact obj )	-> No  return  value.	Deletes	 the
	Actor  associated  with	obj from the Actor list.  No
	action is performed if obj is not an active Actor.

	Example:
		     (IF ($prop	robot BROKEN) THEN
			     ($delact robot)
		     )



$define	( $define str1 str2 ) -> No return  value.   Informs
	the parser that	upon input from	an Actor, the string
	str1 is	to be replaced with the	 contents  of  str2.
	This  process  continues  until	 an infinite loop is
	detected or until a word is found for which there is
	no  corresponding  expansion.	Str1 must contain no
	spaces.	 Str2 may contain several words	separated by
	spaces.	  Note	that in	the case of multiple defini-
	tions  (such  as  ($define  "a"	 "b")  followed	  by
	($define "a" "c")), the	macro table should be viewed
	as a stack with	$define	pushing	macro definitions on
	the stack and $undef popping definitions.

	Example:
		     (IF ($eq @MyDir 1)	THEN
			     ($define "left" "north")
			     ($define "right" "south")
		      ELSE
			     ($define "left" "south")
			     ($define "right" "north")
		     )



$undef	( $undef str ) -> No  return  value.   This  routine
	removes	 str and its expansion from the	macro table.
	No action is performed	if  str	 is  not  an  active
	macro.

	Example:
		     ($undef "left")
		     ($undef "right")