D - more power than (really) needed !

Hasan Aljudy hasan.aljudy at gmail.com
Thu Mar 9 07:52:57 PST 2006


Oskar Linde wrote:
> Deewiant wrote:
> 
>> Walter Bright wrote:
>>
>>> The trouble with OOP is, well, not everything is an object. For 
>>> example, take the trig function sin(x). It's not an object. Of 
>>> course, we could bash it into being an object, but that doesn't 
>>> accomplish anything but obfuscation.
>>>
>>
>> sin(x) isn't an object, but x is, and sin can be made a property of 
>> that object.
> 
> 
> How would you define a binary mathematical function then? atan2(y,x) and 
> binominal(n,k) for instance.
> 
> /Oskar

Sure .. (y,x) is an object, (n,k) is also an object.
not that I know what binominal(n,k) means, but since (n,k) is the data 
you're working with, this data can be the object.

If you're referring to this 
http://mathworld.wolfram.com/BinomialCoefficient.html
then binominal(n,k) means "n choose k" which reads like a the messege 
"choose k" to the object "n" ;)

n.choose(k);

I think, for atan2, x,y are coordinates, no? hence x,y is a point.



More information about the Digitalmars-d mailing list