Well - this is it.
What can you do that's different? I haven't a clue, there are so
many things.
First off, some policy:
-----------------------
-> All permissions policy is enforced EXACTLY the same way as
under plain old Unter. If not, you have found a bug; notify me.
This means that if you try to U-code at an attribute you don't
normally have permissions to access, you won't.
-> All spoofing policy should be enforced EXACTLY the same
way as in plain old Unter. if not, you have found a bug.
UNLESS you have defined the newlines-in-U option in config.h
-> Wherever possible, intellectual similarity between existing
Unter constructs has been preserved. This is NOT the case in
a few areas, namely:
${...} stuff isn't supported in U. It's not needed.
$me and so forth *are* supported and should work as
U-temporary variables (you can assign to
them but only affect local scope)
#object-id which is *NOT* used in macros *IS* used
in U-code. This is necessary for a lot of
reasons relating to making the language
grammar clean. If someone can think of a
*CLEAN* way to fit '#object' into the
macro language, feel free to do so.
Briefly, what can you do:
-------------------------
-> You can set U-code (type 'U') on ofails, osuccs, objects,
*BOOLEAN LOCKS* or anything you'd be able to stick a macro
on, and it should work "normally". If it does not, you have
found a bug; notify me.
-> U-code as a lock should return 0 or 1, or it defautls to 0.
U-code on locks runs as the locked object, permissions wise.
This should be an amusing capability.
-> You can type U-code directly into the MUD by preceeding it
with a '!', EG:
!echo("you see ",rnd(100)," fine happy otters!);
and the expected should happen.
-> Right now there is no documentation on the list of builtins
available to the U-interpreter, other than U/bltin.c. Most of
them should be pretty obvious, and if they aren't either you're
stupid or it's broken.
-> Assignments and object dereferences have typical old UberMUD
syntax, except there is no reference or pointer objects. If
you want to examine something, try:
!echo("Your name is ",$me.nam);
!echo(#0.nam);
etc. Permissions are enforced, so watch it. OWNERS are a list
in Unter, so you can't JUST examine an object's owner by
a deref, you need to iterate the list, EG:
!foreach $goober in (#thing.own) echo($goober.nam);
-> *THIS IS IMPORTANT* - calls to macro commands can be made
transparently from within U. Try it:
!$me.thang = @build("object","something");echo("saved ",$me.thang);
Most macro commands just return NULL or numeric zero, so you
can capture the return value, if you like:
!$tmp = @whisper("bob","eels!"); if($tmp == NULL) echo("whisper failed ", \
error($tmp));
-> Assignments work like they should:
!#33@DECMUD.nam = "FishLips";
!$me.nam = "wubba!";
-> You can iterate across parameters:
!foreacharg $foo { echo($foo); }
-> You can do simple math:
!$tmp = 0;foreacharg $foo { $tmp = $tmp + 1; } echo("params= ",$tmp);
-> Which can be reduced by the wise to:
!echo($#);
-> Assigning U-code programs is done like "normal", IE:
set me U wubba = echo("this is U-code, fool!");
!$me.wubba = "echo(\"this is U-code, fool!\");";
-> There is a type-casting operation that can be performed to set
the type of an assignment:
!$me.foo = (num)"125";
which will try to do the right thing.
This is enough to get you started, I suspect. Go have fun. I'm sure
stuff will crop up. Before you make some snotty remark about how I f***ed
up such-and-such, ask yourself why you didn't write this interpreter
yourself - 'cuz if you piss me off, I'll ask you exactly that question,
so you'd better have an answer ready.
mjr.