www.digitalmars.com         C & C++   DMDScript  

D - expression overloading vs operator overloading

reply Bob <bob.efrei laposte.net> writes:
Would it be possible/usefull/fast to implement expression overloading 
instead of operator overloading?

What I call "expression overloading" is like:

float add_mul_func(float a, float b, float c)
written 'a * b + c' or 'c + a * b'
{
version d
	{
	return a * b + c;
	}
version x86
	{
	asm
		{
		FMULADD c,a,b
		...
		}
	}
}
Jun 14 2004
parent "Matthew" <admin stlsoft.dot.dot.dot.dot.org> writes:
This group is obsolete. You need to post on the
news://news.digitalmars.com/digitalmars.D group

"Bob" <bob.efrei laposte.net> wrote in message
news:cajkj1$30nq$1 digitaldaemon.com...
 Would it be possible/usefull/fast to implement expression overloading
 instead of operator overloading?

 What I call "expression overloading" is like:

 float add_mul_func(float a, float b, float c)
 written 'a * b + c' or 'c + a * b'
 {
 version d
 {
 return a * b + c;
 }
 version x86
 {
 asm
 {
 FMULADD c,a,b
 ...
 }
 }
 }

Jun 22 2004