Re: static class inheritance, generalized



"Frans Bouma [C# MVP]" <perseus.usenetNOSPAM@xxxxxxxxx> schrieb

Furthermore, the necessity which makes you want what you're suggesting
is the friction between procedural programming and OO programming: math
methods and calculation methods are typical procedural
methods/routines, which don't really fit into the OO paradigm, unless
you'd add Sin() as a method of an int or double for example.


I'm not sure, what you want to say by this. Do you mean OO-languages
shouldn't have static methods at all?

BTW What you suggest would reduce the use of the method. I would have to
explicitly cast an int to double to call the sinus of it, or there had to be
a special version of Sin() in the int class, wich internally would only cast
int to double and call Sin(double).

Christof


.



Relevant Pages

  • Re: [ANNOUNCE] System Inactivity Monitor v1.0
    ... this options lets you to specify how much frequently SIN should be ... static struct timer_list timer; ... static int shutdown; ...
    (Linux-Kernel)
  • Re: [PATCH 2/8] Fragmentation Avoidance V17: 002_usemap
    ... > You don't need to explicitly cast between int and unsigned long. ... > There needs to be a reason for the casts. ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Combining Functions
    ... enters his radians i was to link to a sin x function to calculate the ... sin of the number also there will be a factorial function and a cos ... int factorial() ... cin>> item; ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Simple and safe evaluator
    ... a few more funcs like int() and sin(). ... # expose selected math constants and functions ... I'm assuming that the _ast definitions are buried in the C part of python, but that is just a silly guess. ...
    (comp.lang.python)
  • Re: Simple and safe evaluator
    ... a few more funcs like int() and sin(). ... just populate the globals dict with the names ... # expose selected math constants and functions ...
    (comp.lang.python)

Loading