Execute Procedures in any environment
Hello, everybody!
I'm trying to build something like a dynamic object.
The object should have it's own data and it's own
procedures accessing the data. The problem is:
How do I make an object, that can be extended
with new data and new procedures?
It should look like this:
Object: Should be equivalent to a non-dynamic definition:
Data1 Value1 (let ( (Data1 Value1)
Data2 Value2 (Data2 Value2))
Procedure1 (define Procedure1 (lambda ...))
Procedure2 (define Procedure2 (lambda ...))
MsgHandler (define MsgHandler (lambda ...))
; MsgHandler)
Then there should be some calls:
(Object 'add-data 'Data3 Value3)
(Object 'add-procedure 'Procedure3 '(lambda ...)
so that the Object after that looks like this:
Object:
Data1 Value1 (let ( (Data1 Value1)
Data2 Value2 (Data2 Value2)
Data3 Value3 (Data3 Value3))
Procedure1 (define Procedure1 (lambda ...))
Procedure2 (define Procedure2 (lambda ...))
Procedure3 (define Procedure3 (lambda ...))
MsgHandler (define MsgHandler (lambda ...))
; MsgHandler)
A call like ((Object 'exec-proc) 'Procedure1 Argument1 Argument2 ...)
should execute the Procedure Procedure1. And this Procedure1 should
"know" all the data of the object (Data1, ...), so that the Procedure
can be a "normal" procedure using just the names of the data to access
it (the environment of the procedure should contain the data).
The problems are:
- How do I integrate new data into the object (not using a list
of pairs (symbol . value), but really binding it in the environment)?
- How can I integrate new procedures into the object in a way, that
they get the environment of the object (as if they were defined
in the object)?
There should be an easy way to execute a procedure in a given
environment...
Any suggestions?
_ - __o
----- And away... ----- _- _`\<,_
- (_)/ (_)
-------------------------------------------------------------------------------
Due to circumstances beyond your control | Olaf Gellert
you are master of your fate | gellert_at_informatik.uni-hamburg.de
& captain of your soul. | Universitaet Hamburg, FB Informatik
| www.geocities.com/TheTropics/1263
-------------------------------------------------------------------------------
Received on Sat Apr 19 1997 - 11:38:43 CEST
This archive was generated by hypermail 2.3.0
: Mon Jul 21 2014 - 19:38:59 CEST