www.digitalmars.com         C & C++   DMDScript  

D - Reference?

reply terry_t <terry_t_member pathlink.com> writes:
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
next sibling parent J Anderson <REMOVEanderson badmama.com.au> writes:
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.

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
prev sibling next sibling parent reply J C Calvarese <jcc7 cox.net> writes:
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
parent J Anderson <REMOVEanderson badmama.com.au> writes:
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
prev sibling next sibling parent "Matthew" <matthew stlsoft.org> writes:
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 I

 question... where can I find a reference guide of functions? Maybe I

 hard enough, but I looked under "D links" and found nothing. There are

 things I want to know, like how to time a certain piece of code in

 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 17 2004
prev sibling parent Manfred Nowak <svv1999 hotmail.com> writes:
terry_t wrote:

[...]
 how to time a certain piece of code in milliseconds

Look into the samples at dhry.d. So long!
Mar 17 2004