www.digitalmars.com         C & C++   DMDScript  

D - RE: D's documentation

reply Matthias Becker <Matthias_member pathlink.com> writes:
(quote)
 About Phobos' instrinsic 
 why aren't the math functions instrinsic if possible and are removed in this >
part ot Phobos. 

Intrinsic functions aren't functions at all, as I understand it. They translate directly to assembly instructions. If there's no assembly instruction to do some math operation, then you won't find an intrinsic for it. :) (/quote) Of course, instrinsic functions are converted to asm directly. I ment that the functions from math should if possible on this platform be instrinsic and if not be normal functions. So you would be portable, but could still take adventage of instrinsic functions if possible. (quote)
 Look at boost::format. It's typesafe, can be used with userdefined types, but 
 uses a printf-like formatstring. OK, you can't do this in D, because of the 
 limited templates, but if templates might be reviewed it might be an
interesting 
 option. 

I've done this in D without templates. It works pretty nicely. (/quote) Could you show me your code?
Nov 04 2003
parent Andy Friesen <andy ikagames.com> writes:
Matthias Becker wrote:
 (quote)
 
About Phobos' instrinsic 
why aren't the math functions instrinsic if possible and are removed in this >
part ot Phobos. 

Intrinsic functions aren't functions at all, as I understand it. They translate directly to assembly instructions. If there's no assembly instruction to do some math operation, then you won't find an intrinsic for it. :) (/quote) Of course, instrinsic functions are converted to asm directly. I ment that the functions from math should if possible on this platform be instrinsic and if not be normal functions. So you would be portable, but could still take adventage of instrinsic functions if possible.

I hadn't thought of that. Good point.
 (quote)
 
Look at boost::format. It's typesafe, can be used with userdefined types, but 
uses a printf-like formatstring. OK, you can't do this in D, because of the 
limited templates, but if templates might be reviewed it might be an
interesting 
option. 

I've done this in D without templates. It works pretty nicely. (/quote) Could you show me your code?

http://ikagames.com/andy/d/console-19-sep-2003.zip -- andy
Nov 04 2003