From: oreillym@tartarus.uwa.edu.au (Michael O'Reilly)
Newsgroups: rec.games.mud.lp
Subject: Re: Distributed lpmud
Date: 17 Dec 1992 11:57:07 +0800
Organization: Home
NNTP-Posting-Host: tartarus.uwa.edu.au

> >BTW: Any comments on seperating class definitions from the file
> >system?? In Lpmud, the object name (usually) comes from the source
> >file. In my system, the class names, and class libraries are othogonal
> >to the file system. Any comments on the wisdom of this??
> 
> Personaly I think the file system mapping is quite neat :)  It allows
> you to easily edit/find files, and a heiracy is a nice way to
> organise things.

I still intend to have a heirracy , but it will be dependant on the file
system. This is partly because because haveing several classes in the
one file makes nonsense of this. Also, it would be nice if the class list
was a graph. i.e. if A is a super type of B and C, and B is a super type
of D, and both C and D are super typef of E, then
	E/D/B/A and E/C/A both valid names for A. Not sure on this point
tho.


 
> When we were thinking of drivers we went with the modula idea sort of
> we had a bit at the start where you declared all the public information
> and a bit after that where you declared all of your private junk and
> how the code for the public methods.  This allows you to compile just
> the public bit of an object, so you don't gain all the extra references
> to objects forceing you to rush off and load other thingys.

Hmmm. I am not sure if this is needed. If the class exists, then it is
fully compiled. A similar capaciy is achived via virtual classes. I.e.
defineing the interface without defineing any code. So Room is..
	class Exit {
		String direction;
		Int dx, dy; // Delta co-ords of room to exit to.
		};

	class Room {
		String short(void);
		String long(void);
		Array{Exit} query_exits(void);
		}
And leaving it there. Then any implementation of an actualy room would
simply say that it "isa" Room, and define the various methods needed.
 
> >Also, I implement security on access to system resources by simply
> >implements classes as an object, and then passing to the compiler, an
> >array of the classes or class libraries that it knows about. (The
> >number of global variables in this driver is tending to about 1. :)
> 
> Ummm.  Did you miss some words? :)
Yes.
Also, I implement access security to system resources by simply
implementing classes as objects, and then passing to the compiler an
array of the classes that it can use. This prevents a user program
creating a new instance of the class 'Scheduler' for instance (which
would allow it to change it's thread priority). This means that there is
no global list of classes. There is only local lists of classes that
each user knows of. 


> >Exception handleing? General failure handleing?
> So the expcetion was a case statement.  Actually I think ada uses
> a slightly different version (or is it modula?)
> 
> block
>   except on i
>     case i of
>       RANGE_CHECK :
>         bright blue;
>       default :
>         raise i;
>     end-case;
> end-block;
> 
> Bing.  It was the most reasonable method we could think of at the time.
> It allows for you to handle excpetions at any block level, which is
> just about everywhere :)  You can trap out just the ones you want to
> deal with and pass the rest back up.  We were implementing constants as
> a type of inherit.  A uses statement, though...  I quite like inherit,
> shrug.  So all the excpetions would be somewhere, it is also flexible
> in that you can extend the range fairly easily.

Nice. Questions:
1) How do you implement this??? I.e. what does the above compile to?? A
simple implementation that springs to mind is to simply push the address
of the exception handler on a special 'exception stack', and pop it off
when the block exits.  

2) It really really hate the idea of useing the C pre-processor to
define constants like RANGE_CHECK. I also hate the idea of use inherits
to do it (at least, in the way you seem to imply). I get the idea the
right way to do this sort of stuff is to add the concept of generators
to the language. (This is something I got from Mike. Hope I understand
this right).

The idea is the '1' is a generator for an integer. As are all the digit
strings. And "xyzzy" is a generator for a string. And so on. So things
like RANGE_CHECK should be a generator for the exception labels. This is
all fine so far. My problems comes in things like this.

Say you have the token 'nil'. This is a generator for the empty list.
But you also have the generator 'nil' which is a generator for the empty
binary tree. SO what happens when you do..
	a = nil.
Does this look at the of a to work out what nil is a generator for!?
This seems pretty horrible. Someone with functional language experience
care to answer here?

haveing written that, a soluton springs to mind. If you simply define
the intersection of the List type and Tree type to be the 'nil' token,
then every thing is fine. So the type of 'nil' is (list | Tree). Hmm.
Does this work??

> Shrug.
> Bing onwards,
> David.

Michael
Newsgroups: rec.games.mud.lp