D - Reference?
- terry_t (7/7) Mar 16 2004 I just started looking into D. I compiled and ran my first program, but ...
- J Anderson (11/19) Mar 16 2004 You could use:
- J C Calvarese (17/24) Mar 16 2004 The standard library ("Phobos"):
- J Anderson (22/27) Mar 16 2004 Actually it was in dig however I disabled the high-performace part (as
- Matthew (10/17) Mar 17 2004 There are a whole suite of timing classes in the synsoft.win32.perf modu...
- Manfred Nowak (4/5) Mar 17 2004 Look into the samples at dhry.d.
I just started looking into D. I compiled and ran my first program, but I have a question... where can I find a reference guide of functions? Maybe I didn't look hard enough, but I looked under "D links" and found nothing. There are many things I want to know, like how to time a certain piece of code in milliseconds with D, or what the string manipulation functions are. Or maybe I just misunderstood D and it doesn't have an extensive library built into the language. Please enlighten me :) Thanks.
Mar 16 2004
terry_t wrote:I just started looking into D. I compiled and ran my first program, but I have a question... where can I find a reference guide of functions? Maybe I didn't look hard enough, but I looked under "D links" and found nothing. There are many things I want to know, like how to time a certain piece of code in milliseconds with D,You could use: GetTickCount(); From std.c.windows.windows.or what the string manipulation functions are. Or maybe I just misunderstood D and it doesn't have an extensive library built into the language. Please enlighten me :) Thanks.You probably want to look at phobos: http://www.digitalmars.com/d/phobos.html An *extensive* stl library is in the works however in my opinion much (not all) of the stuff in C++'s stl is already available as part of the language in D. -- -Anderson: http://badmama.com.au/~anderson/
Mar 16 2004
terry_t wrote:I just started looking into D. I compiled and ran my first program, but I have a question... where can I find a reference guide of functions? Maybe I didn't look hard enough, but I looked under "D links" and found nothing. There are many things I want to know, like how to time a certain piece of code in milliseconds with D, or what the string manipulation functions are. Or maybe I just misunderstood D and it doesn't have an extensive library built into the language. Please enlighten me :) Thanks.The standard library ("Phobos"): http://www.digitalmars.com/d/phobos.html The library has room to grow. If you're looking for a particular string trick that doesn't seem to be in the library, ask for a hint here. Somebody's probably figured out how to do it. I've got some primitive examples on my website: http://jcc_7.tripod.com/d/tutor/. You're probably already too advanced for them. :) Timing in milliseconds sounds like something that would be done through the OS. In D, you can directly access C functions (http://www.digitalmars.com/d/interface.html). I'm pretty sure someone has mentioned doing high performance timing in D, and surely they figured out how to do it, but I don't remember any details. -- Justin http://jcc_7.tripod.com/d/
Mar 16 2004
J C Calvarese wrote:Timing in milliseconds sounds like something that would be done through the OS. In D, you can directly access C functions (http://www.digitalmars.com/d/interface.html). I'm pretty sure someone has mentioned doing high performance timing in D, and surely they figured out how to do it, but I don't remember any details.Actually it was in dig however I disabled the high-performace part (as it was causing problems) :( You can go there to see the code I've commented out ). In control.d /** Get the number of milliseconds the program has been running. */ static ulong elapsedTime () { ulong value; LARGE_INTEGER freq; return GetTickCount (); //Added by Joel Anderson /+if (!net.BurtonRadons.dig.platform.base.QueryPerformanceFrequency (&freq) || freq == 0 || !std.random.QueryPerformanceCounter (&value)) return GetTickCount (); if (!digPlatformElapsedTimeCounter) digPlatformElapsedTimeCounter = value; return (value - digPlatformElapsedTimeCounter) * 1000 / freq;+/ //Causes access volition -> fix yourself if you really want such accuracy } -- -Anderson: http://badmama.com.au/~anderson/
Mar 16 2004
There are a whole suite of timing classes in the synsoft.win32.perf module, available from http://synsoft.org/d.html. These are likely to find themselves in Phobos pretty soon, just need a little "std."-ing. :) "terry_t" <terry_t_member pathlink.com> wrote in message news:c38d0d$2qtp$1 digitaldaemon.com...I just started looking into D. I compiled and ran my first program, but Ihave aquestion... where can I find a reference guide of functions? Maybe Ididn't lookhard enough, but I looked under "D links" and found nothing. There aremanythings I want to know, like how to time a certain piece of code inmillisecondswith D, or what the string manipulation functions are. Or maybe I just misunderstood D and it doesn't have an extensive library built into the language. Please enlighten me :) Thanks.
Mar 17 2004
terry_t wrote: [...]how to time a certain piece of code in millisecondsLook into the samples at dhry.d. So long!
Mar 17 2004