Re: Feedback for compiler project

iddekingej@lycos.com (J.van Iddekinge)
10 Oct 2001 15:51:14 -0400

          From comp.compilers

Related articles
Feedback for compiler project iddekingej@lycos.com (2001-09-20)
Re: Feedback for compiler project joachim_d@gmx.de (Joachim Durchholz) (2001-10-06)
Re: Feedback for compiler project iddekingej@lycos.com (2001-10-10)
Re: Feedback for compiler project joachim_d@gmx.de (Joachim Durchholz) (2001-10-12)
Re: Feedback for compiler project vbdis@aol.com (2001-10-12)
Re: Feedback for compiler project dmitry@elros.cbb-automation.de (2001-10-13)
Re: Feedback for compiler project iddekingej@lycos.com (2001-10-13)
| List of all articles for this month |

From: iddekingej@lycos.com (J.van Iddekinge)
Newsgroups: comp.compilers
Date: 10 Oct 2001 15:51:14 -0400
Organization: http://groups.google.com/
References: 01-09-083 01-10-017
Keywords: OOP
Posted-Date: 10 Oct 2001 15:51:13 EDT

Joachim,


    Thanks for responding.


First of all the java-script problem: I thought i removed the
java-script. I Had some script in www.elaya.org/index.html. (Which
was accidental) But 5 Oct (Cet) I added a redirection in .HtAccess
file, so this page should be skipped. I tested this morning with Lynx
and netscape with javascript turned off, in both cases it works
Ok. Could you look it again? When you access www.elaya.org you should
get www.elaya.org/main/showitem.php3?id=1 and not the gray page with
the Elaya image and a link '[enter]'. There is no further javascript
at the side.


I suppose you are a OOP programmer. The problem is that dynamic
routine has some similaties with OOP, and that can cause some mixup.
When I started testing dynamic routines I had the same reaction. Later
I discovered that it is not true.


The only argument you give that dynamic routine they are not useful
because it is not possible override several function. First this is
not true, it is possible and second this is irrelevant.


What is relevant are the follow facts:


Dynamic routines and oop are based on the following facts:


1) Grouping different identifiers or other parts together.
2) Inheritance for similarities
3) Virtual/Override for adding flexibility because of differences.


this has several advantages/application:


1) Abstraction
2) Hiding/Shielding.
3) Code Reus.
4) Automation
5) Association data and ...
etc etc..


Dynamic routine and Oop have both the same kind of advantages but the
first is related to process and the second to objects. But when
dynamic routines and oop are combined, the properties of both are
combined and strengthened, and weaknesses of both systems can be
compensated.


An example:


If you have a linked list (what hap-ends often in compiler) It can
have different routine which scan the list:


TLinkList=class
PrintContents
FindInfoByName
ValidateInformation
end.


All 3 methods have in common that they scan the linkslist:
1) Set Scanning Variable at beginning
2) Check if end of list is reached
3) Check if scanning must be stopped.
4) Do Something.


Dynamic routines can use these similarities:
TLinkList=class
ScanLinkList
PrintContents inherit ScanLinkLIst
FindInfoByName inherit ScanLinkList
ValidateInformation inherit ScanLinkList
end


Another example is usage of object:


vlQUery=TQuery.Create
vlQuery.Sql="select * from SomeTable where name="+vlCond;
vlQuery.Execute;
vlId1=vlQuery.FieldByName('id');
vlQuery.Execute;
vlId1:=vlQuery.FieldByName('id');
vlQuery.Destroy.


The TQuery object can be wrapped in a dynamic routine :


function ExecMyQuery(ParCOnd:string);
inherit ExecQuery('select * from SomeTable where name='+ParCond)
inherited
procedure DoQuery;
begin
Execute;
vlId1 := FieldByName('id');
Execute;
vlId2 := FieldByName('id);
.
.
end;
end;




or short notation:
var
vlId1 : long;
vlId2 : long;
begin
ExecMyQuery('select * from SomeTable where name'+ParCond) with
DoQuery:begin
Execute;
vlId1 := FieldByName('id');
Execute;
vlID2 := FieldByName('id');
end;
end;
end;


This has an advantage that you don't need to bother about creating and
destroying the objects (or exceptions).


(There are more situation where dynamic routines can be use but I
think
this is enough).


Keep in mind that there are several points:
* Elaya doesn't contain OOP yet!!!
* The current implementation of Dynamic routine is a first step for
    a better representation of processes. Many features are still
missing.
* There are far more thinks to consider when judging dynamic routines.
But because I am still investigating the relation between object and
dynamic routine and because lack of time, I can only give this limit
amount of information.


Jer.
www.elaya.org


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.