dotgnu-visionaries
[Top][All Lists]
Advanced

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

Re: [Visionaries] WebScheme


From: Peter Minten
Subject: Re: [Visionaries] WebScheme
Date: Fri, 09 May 2003 14:12:39 +0200

Peter Minten wrote:
> 
> Peter Minten wrote:
> >
> > Guess what? :-)
> 
> Uh ... now this is hard ... nearly got it ... ADDENDUM!

Hmm, this thread is getting really deep.

The reference model continues to be a pain in the brain. I just discovered I
made a terrible mistake with the r-data. R-data should not be storage location
bound but binding bound.

This means that references return to implicitness and the Reference class
dissappears. Instead comes the Binding class and the methods
(Binding.get-binding variable), (Binding.get-identifier binding) and
(Binding.get-value binding) which are also defined in the Global module. The ^
syntax now refers to bindings as it previously did to references. I'm also
introducing quick dereference. The syntax obj^ means (get-value obj).

Some examples:
^foo -> (get-binding foo)
^foo.bar -> (get-field (get-binding foo) 'bar)
^foo.^bar -> (get-binding (get-field (get-binding foo) 'bar))
(define foo 5)
(define b (get-binding foo))
(get-identifier b) => Global.foo
(get-value b) => 5
(define foo '(2 4))
(define b ^foo)
(get-identifier b) => Global.foo
(get-value b) => '(2 4)
(b^.size) => 2
(b^.size) -> ((get-field (get-value b) 'size))
(define b.foo (lambda () 5))
(b.foo) => 5  ;;Binding method
(define ^foo.get (lambda () 6)) ;;Accessor definition
b^ => 6
foo => 6

Finally some new definitions:
binding field - A field of the binding
binding method - A method of the binding

Syntax expansions:
^foo -> (get-binding foo)
foo^ -> (get-value foo)
^foo^ -> (get-value (get-binding foo)) => foo

--

How do you easily define a variable a to point to the same storage location as
b? Simple, b has a field called 'this' which returns b. Due to the fact that the
pass-by-value is only one level deep the following definition will do the trick
(define a b.this). 

How do you do deep copies? Easy, every object has a method called deep-copy.
Deep-copy constructs a complete deep copy using recursion.

--

Time to define vectors and stuff. The basic class is Array. Every Array can have
multiple dimensions. A Vector is a one dimensional array. A Matrix is a two
dimensional array. A NumberVector is a Vector that only contains numbers. A
NumberMatrix is a Matrix that only contains numbers. 

--

The WebScheme XML support is Node based. The most basic parse method simply
returns a tree of Nodes.

--

WebScheme will support one file libraries. Libraries must contain source code or
an intermediate form (I know LISP is often compiled to some intermediate form,
so I'll allow that too) and a documentation RDF file called INFO.RDF. Libraries
must be in tar.gz format (can you get it easier). WebScheme will use a system
catalogue (an RDF file) to allow easy searching for stuff.

Greetings,

Peter




reply via email to

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