dotgnu-visionaries
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Visionaries] DG-Scheme


From: Peter Minten
Subject: Re: [Visionaries] DG-Scheme
Date: Fri, 25 Apr 2003 16:46:02 +0200

Peter Minten wrote:
> 
> Peter Minten wrote:
> >
> > Hi folks,
> >
> > I did a little thought experiment today, making Scheme truly OO and AO 
> > (Aspect
> > Oriented), it turned out that's not so hard, if you add the idea of 
> > metadata. A
> > language that is flexible, OO, AO and has metadata would be the ideal 
> > language
> > for many webservices. I believe DG-Scheme (as I call it) meets those
> > qualifications. What follows is an explanation about the specifics of 
> > DG-Scheme
> > (well, as far as I've managed to map them out in a couple of hours).
> 
> Additions.

Addendum.

DG-Scheme will support a very basic variant of pointers. Scheme already does
things by reference, but sometimes this boils down to by value. To work around
that a variable can be put in a list and the list can be passed by value, the
reference to the var is not maintained however. DG-Scheme has a class that has
only one field that can contain any variable (like fields usually do), this
class is called Reference. The Reference class has a constructor that
initializes the variable (Reference.new), and a variable accessor
(refobj.deref). The functions (ref value-to-be-put-in-the-reference) and (deref
refobj) are the shortcuts.

It's handy to know what the type of the object in the reference is. One could
get that by address@hidden but it's also possible to use address@hidden
Advantage of the latter is that it will also work for arrays, hashes, etc (but
not lists since those are technically a chain of pairs and not a single object).
It's also possible to use generic methods to select on subtype, using an
extended (and changed, now object first not type) selector syntax: (obj type .
subtypes). For example (foo Array Hash Integer), an array that contains hashes
that contain integers.

Another change is that generic methods can't be the default, I hadn't do enough
thinking about it when I said that. Generic methods are procedures that store
references to lambda procedures in their data and search activate a matching one
when called. Generic methods are stored in the object Generic (which is of class
Procedure). The data is accessible using the hash methods, key is a list of
types. The shorthand form (define-generic) simply calls (Generic.add
method-parameters procedure).

Greetings,

Peter



reply via email to

[Prev in Thread] Current Thread [Next in Thread]