----boundary-LibPST-iamunique-1919479961_-_-
Content-type: text/plain
OK. That answers my question. I see your points about the impact
of complexity on your code. I periodically request "named integers"
for CP, which would give 90% of the benefits of enumerated types
with 10% of the implementation cost. But the complexity of using
integer CONST without "named integers" is not nearly the complexity
you would have to endure without procedure variables.
Thanks,
Stan
On Nov 18, 2004, at 10:10 AM, Campbell, Robert D (UK Edinburgh) wrote:
>>> Robert,
>>> Thanks for your note. But someone please help me understand this.
>>> I proposed ...
>
>>> Stan
>
> I didn't quite understand your question: are you asking me to explain
> the
> advantages of Procedure types, or of objects? I think you are asking
> the
> former.
>
> My position is that I think they both have advantages, and so should
> both be available. If only one was allowed I would definately go the
> o-o way; it is much more powerful.
>
> So, some advantages of procedure types, an unbalanced assessment:
>
> 1 - Many existing functions (eg Math.Cos) are procedures. If I want to
> numerically integrate it in an o-o integrator (like mine is in fact!)
> I would need to create a wrapper object.
>
> 2 - People with a scientific background grew up with FORTRAN, and
> are familiar with this type of declaration.
>
> 3 - The extra capabilities of objects seem unnecessary for Cos, the
> above design does all that is wanted of a Cos function.
>
> 4 - Consider the following example (taken from LibReals):
>
> PROCEDURE Cube* (x : REAL) : REAL;
> BEGIN
> RETURN x * x * x
> END Cube;
>
> Which can be called by R.Cube (x) - I use IMPORT R := LibReals;
>
>
> The o-o approach requires:
>
> TYPE
> MonadicFn* = POINTER TO ABSTRACT RECORD END;
>
> Cube* = POINTER TO RECORD (MonadicFn) END;
>
> PROCEDURE (fn : MonadicFn) Eval* (x : REAL) : REAL, NEW, ABSTRACT;
>
> PROCEDURE (fn : Cube) Eval* (x : REAL) : REAL;
> BEGIN
> RETURN x * x * x
> END Eval;
>
>
> Which can be called by
>
> VAR
> cube : R.Cube;
> BEGIN
> NEW (cube); cube.Eval (x).
>
> That's why I say the former is simpler.
>
> (The Module interface is also shorter and simpler.)
>
> 5 - Efficiency. Methods require an extra level of indirection. Inside
> a big engineering sum this just seems like unnecessary overhead.
>
> 6 - Brevity. Generally procedure names are shorter. I use M for Math,
> R for
> LibReals, C for LibComplex, I for LibIntegers. Because there are only
> a few
> much used modules that provide 99% of the functions (by use, if not by
> number)
> this brevity is not confusing (to me).
> Complicated expressions with 4 or 5 or more functions on 1 line are
> common. Short names for common functions are a significant advantage to
> readability and comprehensibility. The .Eval in cube.Eval
> just seems to visually clutter maths expressions.
>
> 7 - If I select R.Cube, right click, I get immediate access to the
> interface,
> source, and Docu. This is very nice. It does not work if I select
> cube.Eval.
> I can't easily work out where cube.Eval is defined. Who on Earth needs
> polymorphism for a Cube function?
>
>
> I could probably go on ...
>
> Given that procedures are useful how can I pass them to other things
> with having procedure valued variables, and thus procedure types?
>
>
> This does not seek to be a balanced email; I could also write a pro-
> objects list. But one advantage I can't resist mentioning is that
> I can't save procedure variables to disc, whereas if MonadicFn had
> been declared as a Store I could Externalise cube. Question: does
> creating a Store extension have a significant overhead inside a
> big loop?
>
> Good night
> Robert
>
> ********************************************************************
> This email and any attachments are confidential to the intended
> recipient and may also be privileged. If you are not the intended
> recipient please delete it from your system and notify the sender.
> You should not copy it or use it for any purpose nor disclose or
> distribute its contents to any other person.
> ********************************************************************
--------------------------------------------
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-1919479961_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XG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