Re: Porting to Java using Garden Point Compiler - Procedure types

From: [at]} <Stan>
Date: Thu, 18 Nov 2004 08:23:04 -0800

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

Robert,
Thanks for your note. But someone please help me understand this.
I proposed to define the function

        TYPE
                Function* = POINTER TO ABSTRACT RECORD END;

        PROCEDURE (f: Function) ValueOf* (x: REAL): REAL, NEW, ABSTRACT;

and use it as

        TYPE
                MyFunction = POINTER TO RECORD (NumericalProcessor.Function) END;

I am trying to understand why this is so different from procedure
types. The above literally defines a procedure type and allows
you to pass a procedure as a parameter.

(1) Is the problem one of requiring all the math functions in the
library
to be this type if you are going to be able to pass them as parameters?
Would it be a major complication to have to wrap the functions this way?

(2) Is it a convenience problem of having to write

  f.ValueOf (min)

instead of

f (min)

I can understand your point if the answer is yes to either of these
questions, although it seems that (1) would be the most problematic.
Are these two points why you say that procedure types are simple
and direct? Or are there some other complications?

Thanks for everybody's feedback.
Cheers,
Stan

>>> Stan:
>>>
>
>>>> With object-orientation, procedure types are redundant and should
>>>> be eliminated, IMHO. You should design your numerical processing ...
>
>>> I do not disagree with your example, but who would ever use this
>>> approach?
>>> Your book on OOP is not among those that define numerical analysis.
>>> "Numerical Recipes" are the foundation. It goes back to Fortran-IV.
>>> If

>>> anyone wants to calculate some integral or a special function, they
>>> will
>>> read Press & Teukolsky, not S.Warford.
>
>>> Along the lines of realism: one of our treasures is the
>
>>> huge collection of
>>> numerical software published and maintained by R.Campbell.

>
>>> Please keep the
>>> compiler compatible with his collection, not the other way around.
>>>
>
>>> Wojtek
>
> By one of those ironies that make life interesting
> Wojtek has chosen a bad example. In my Subsystem Lib
> almost all the numerical stuff is procedural EXCEPT
> the integrators and root finders.
>
> In contrast ALL the mathematical stuff in Subsystem Algebra
> is o-o.
>
> However I firmly believe that procedure type are sometimes the
> simple and direct solution to a problem and should be kept.
> Just ignore people who call them obsolete, they are not.
>
> This reminds me of discussions about the merits of recursion
> verses iteration. Some problems require recursion, most in my
> area of work are simpler with iteration. I would not want
> to work in an environment (FORTRAN IV or Lisp) that mandated one
> or the other.
>
> Robert

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

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-982725176_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"

e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIFJvYmVydCxccGFyDQpUaGFua3MgZm9yIHlvdXIg
bm90ZS4gQnV0IHNvbWVvbmUgcGxlYXNlIGhlbHAgbWUgdW5kZXJzdGFuZCB0aGlzLlxwYXINCkkg
cHJvcG9zZWQgdG8gZGVmaW5lIHRoZSBmdW5jdGlvblxwYXINClxwYXINClx0YWIgVFlQRVxwYXIN
Clx0YWIgXHRhYiBGdW5jdGlvbiogPSBQT0lOVEVSIFRPIEFCU1RSQUNUIFJFQ09SRCBFTkQ7XHBh
cg0KXHBhcg0KXHRhYi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lvbnMgb24gdGhlaXIgdXNhZ2UsIHNlbmQgYSBtZXNzYWdlIGNvbnRhaW5p
bmcgdGhlIHdvcmQgImhlbHAiIHRvIHRoZSBhYm92ZSBhZGRyZXNzLlxwYXINClxwYXINClNlbmQg
YW55IHByb2JsZW0gcmVwb3J0cyBvciBxdWVzdGlvbnMgcmVsYXRlZCB0byB0aGlzIGVtYWlsIGxp
c3QgdG8gdGhlIGxpc3Qgb3duZXIgYXRccGFyDQogICBvd25lci1ibGFja2JveEBvYmVyb24uY2hc
cGFyDQpccGFyDQpDdXJyZW50IHBvc3RpbmcgcG9saWN5OlxwYXINClxwYXINCmEpIFRvIHBvc3Qg
eW91IHNob3VsZCB1c2UgdGhlIHNhbWUgYWRkcmVzcyBieSB3aGljaCB5b3UgYXJlIHN1YnNjcmli
ZWQgdG8gdGhlIG1haWxpbmcgbGlzdC4gVGhhdCB3YXksIHRoZSBsaXN0IHNlcnZlciB3aWxsIHJl
Y29nbml6ZSB5b3UgYXMgc3Vic2NyaWJlciBhbmQgZm9yd2FyZCB5b3VyIHBvc3RpbmcgaW1tZWRp
YXRlbHksIHdpdGhvdXQgY3JlYXRpbmcgYW55IG92ZXJoZWFkLlxwYXINClxwYXINCmIpIElmLCBm
b3Igc29tZSByZWFzb24sIHlvdSBjYW5ub3QgcG9zdCBmcm9tIHRoZSBhZGRyZXNzLCBieSB3aGlj
aCB5b3UgYXJlIHN1YnNjcmliZWQsIHlvdXIgbWVzc2FnZSB3aWxsIGJlIG1vZGVyYXRlZCB0byBh
dm9pZCBzcGFtLiBQbGVhc2UgdW5kZXJzdGFuZCB0aGF0IG1vZGVyYXRpb24gd2lsbCBvZnRlbiBj
YXVzZSBzb21lIGRlbGF5LCBpbiBwYXJ0aWN1bGFyIG92ZXIgd2Vla2VuZHMgb3IgaG9seWRheXN9
fQBlbSBhcw==


----boundary-LibPST-iamunique-982725176_-_---
Received on Thu Nov 18 2004 - 17:23:04 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:28:31 UTC