[Top][All Lists]
[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
- Dogus (was: Re: [Visionaries] DG-Scheme), Peter Minten, 2003/05/05
- Re: Dogus (was: Re: [Visionaries] DG-Scheme), Norbert Bollow, 2003/05/05
- WebScheme (was: Re: Dogus (was: Re: [Visionaries] DG-Scheme)), Peter Minten, 2003/05/06
- [Visionaries] Re: WebScheme, Peter Minten, 2003/05/07
- Re: [Visionaries] Re: WebScheme, Peter Minten, 2003/05/08
- Re: [Visionaries] WebScheme,
Peter Minten <=
- Re: [Visionaries] WebScheme, Peter Minten, 2003/05/11
- Re: [Visionaries] WebScheme, Peter Minten, 2003/05/11
- Re: [Visionaries] WebScheme, Peter Minten, 2003/05/13
- Re: [Visionaries] WebScheme, Peter Minten, 2003/05/15
- Re: [Visionaries] WebScheme, James Michael DuPont, 2003/05/15
- Re: [Visionaries] WebScheme, Peter Minten, 2003/05/17
- Re: [Visionaries] WebScheme, James Michael DuPont, 2003/05/18
- Re: [Visionaries] WebScheme, James Michael DuPont, 2003/05/18
- Re: [Visionaries] WebScheme, Peter Minten, 2003/05/16