Check to see if the Class of the Object has changed and if it has, then copy
the data from the old structure into the new one and delete the old.

 

You only lose what you don't now need. You can copy based on matching names
and variable type. If you want the ability to undo the change, then log the
old Object before you change it.

 

David Clark

 

From: Piaget Modeler [mailto:[email protected]] 
Sent: September-06-13 12:31 PM
To: AGI
Subject: [agi] Module re-definitions

 

Hi All, 

 

Just wanted to get a survey.  I'm thinking about what modularity means in 

an interpreted language.  I'm working on a new language  for my research

and came upon a question in modularity and interpreter design.

 

If you have existing objects defined in memory and you load a new module

which redefines the type hierarchy, what should happen? 

 

In most dialects of SQL,  when adding a module (i.e. a script), say to build


a database, there is code to delete an existing object before defining the 

new object.  For example, when defining a new table, often there is code 

to drop the table beforehand:

 

If ( exists(table(A))) then drop table A ;

Create table A as blah blah blah...

 

Redefinitions can obliterate existing database objects.  The scripting can 

be controlled by the developer so that redefinitions do not destroy existing


objects but rather just signal errors. 

 

In 3 GL languages like C++, Java, etc. when a code module is accidentally 

included twice in a source file, what exactly happens? Does the compiler

redefine or ignore the functions or objects in the duplicate module? What 

about interpreted languages like python? 

 

Your thoughts? 

 

Michael.


AGI |  <https://www.listbox.com/member/archive/303/=now> Archives
<https://www.listbox.com/member/archive/rss/303/1652298-7c98969f> Image
removed by sender.|
<https://www.listbox.com/member/?&;
c> Modify Your Subscription

 <http://www.listbox.com> Image removed by sender.

 




-------------------------------------------
AGI
Archives: https://www.listbox.com/member/archive/303/=now
RSS Feed: https://www.listbox.com/member/archive/rss/303/21088071-f452e424
Modify Your Subscription: 
https://www.listbox.com/member/?member_id=21088071&id_secret=21088071-58d57657
Powered by Listbox: http://www.listbox.com

<<~WRD000.jpg>>

Reply via email to