RE: Procedure types

From: [at]} <skulski{>
Date: Thu, 18 Nov 2004 17:42:14 -0500 (EST)

----boundary-LibPST-iamunique-1919950701_-_-
Content-type: text/plain

Fyodor:

> BlackBox, F1, What's New:

>
> . Procedure types can pose considerable implementation difficulties
> concerning the safe unloading of code. ..
>
> That is, a procedure variable may contain a dynamically created reference
> to a procedure in the module being unloaded, even if the latter is not
> related by import with the variable's module.

Is the same not true with objects as well?

MODULE TestLower;
TYPE hookType* = POINTER TO EXTENSIBLE RECORD END;
VAR hook* : hookType;
END TestLower.

MODULE TestUpper;
IMPORT TestLower;
TYPE myHook = POINTER TO RECORD (TestLower.hookType) END;
VAR hook: myHook;
BEGIN
  NEW (hook);
  TestLower.hook := hook;
END TestUpper.

As you see, I have installed a "hook object" in a module Lower.
I can now unload module Upper because it does not have clients.
What happens if TestUpper.hook uses resources from module Upper?

Naturally, one should take care of this in the CLOSE section of module
TestUpper, but what if there is no CLOSE section? Can you guarantee there
are no safety problems if one unloads such a sloppy module, even though I
have not used procedure variables?

What I am driving at is that possibly procedure variables are no more
dangerous than the O-O solution would have been, in the hands of a sloppy
programmer of course.

Comments?

W.


--------------------------------------------

To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
   blackbox-request{([at]})nowhere.xy

To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.

Send any problem reports or questions related to this email list to the list owner at
   owner-blackbox{([at]})nowhere.xy

Current posting policy:

a) To post you should use the same address by which you are subscribed to the mailing list. That way, the list server will recognize you as subscriber and forward your posting immediately, without creating any overhead.

b) If, for some reason, you cannot post from the address, by which you are subscribed, your message will be moderated to avoid spam. Please understand that moderation will often cause some delay, in particular over weekends or holydays.


----boundary-LibPST-iamunique-1919950701_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"

e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBB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