INTRODUCTION

This is a new datatype for MOO 1.8.0.  See waif-progman.html for a
dscription.  You can visit place.org 7777 (auto registration enabled)
to see a MOO with WAIFs enabled.

If you have questions, find me online or send me mail at ben@ben.com.
The canonical distribution location is:

	http://www.ben.com/MOO


UPGRADING FROM v0.x

Copy in waif.c/waif.h as usual, and apply patch `WAIF.DIFF.new-in-0.x'
for the versions after the one you are upgrading from, rather than the
entire WAIF.DIFF patch.  You can probably just apply the whole patch if
you are willing to ignore all but a few of the blocks getting rejected.


INSTALLATION

1.	Unpack this in your server source directory.  You'll need
	server source within a few versions of MOO 1.8.0r5, which is
	available at:

		ftp://ftp.place.org/pub/moo/unofficial/

2.	Apply the diff with something like:

		patch -E -p0 < WAIF.DIFF

	If anything fails and you have .rej files, you will have to
	merge by hand.  The diffs are not complicated.  The bulk of
	the new code is in waif.c.

3.	The patch will change Makefile.in.  You can either re-run
	./configure or just ./config.status if you're working from an
	existing tree.  If this diff hunk fails, just add `waif.c'
	right after `version.c' on the list of sources.

4.	Type make!

5.	SAVE A COPY OF YOUR DATABASE!  There is currently no way to
	back out of your WAIF conversion unless you can find and remove
	all waif references in your entire DB (should be possible, but
	currently untried).


SAMPLES

Here are uncommented @dumps from some waif objects that are interesting
on a JHCore, starting with a useful implementation of $waif.  Find more
at place.org 7777.


@create $root_class named root waif:root waif,waif
@prop $waif."type" 10 r
;$waif.("key") = 0
;$waif.("aliases") = {"root waif", "waif"}
;$waif.("unique") = 0
;$waif.("offered") = #-1
;$waif.("object_size") = {293, 900645925}

@verb $waif:"new" this none this
@program $waif:new
"WIZARDLY";
set_task_perms(caller_perms());
w = new_waif();
w:initialize(@args);
return w;
.

@verb $waif:":initialize" this none this
@program $waif::initialize
"the perms check you want is probably:";
if ((caller == this) || (caller == this.class))
  "allows pass() and :new()";
else
  raise(E_PERM);
endif
.

"***finished***


@building-option +create-set-co
@create $waif named group of objects:group of objects,ogroup
@prop _.":location" #-1 rc
@prop _.":objects" {} rc
@prop _.":english_list_args" {} rc
;_.("key") = 0
;_.("aliases") = {"group of objects", "ogroup"}
;_.("offered") = #-1
;_.("object_size") = {357, 900317222}

@verb _:":name" this none this
@program _::name
return $language:name_list(this.objects, this.english_list_args, @args);
.

@verb _:":verb_sub :noun_sub :adj_sub" this none this rx #35
@program _::verb_sub
return this:gender_obj():(verb)(@args);
.

@verb _:":gender_obj" this none this
@program _::gender_obj
return (length(this.objects) > 1) ? $they | `this.objects[1]:(verb)() ! ANY => $it';
.

@verb _:":dname*c :iname*c" this none this
@program _::dnamec
cap = (verb[$] == "c") ? {"c"} | {};
article = verb[1];
return this:name({article, @args}, @cap);
.

@verb _:":tell :notify :tell_lines" this none this
@program _::tell
"map to everything";
set_task_perms(caller_perms());
for victim in (this.objects)
  victim:(verb)(@args);
endfor
.

@verb _:":moveto" this none this
@program _::moveto
"set_task_perms(caller_perms());";
where = args[1];
this.location = where;
for victim in (this.objects)
  victim:moveto(where);
endfor
.

@verb _:":initialize" this none this
@program _::initialize
this.objects = args[1];
if (length(args[1]))
  this.location = this.objects[1].location;
endif
.

@verb _:":you" this none this
@program _::you
return $you;
.

"***finished***
