First Impressions

Derek Parnell derek at nomail.afraid.org
Thu Sep 28 23:57:54 PDT 2006


On Fri, 29 Sep 2006 10:23:32 +1000, Geoff Carlton wrote:

> Hi,
> I'm a C++ user who's just tried D

> I was a bit underwhelmed by the syntax of char[].

Yes. It isn't very 'nice' for a modern language. Though as you note below a
simple alias can help a lot. 

   alias char[] string;


> I believe single functions get pulled in as member functions?  e.g.
> find(string) can be used as string.find()? 

This syntax sugar works for all arrays.

   func(T[] x, a)

   x.func(a)

are equivalent.

> 2.)
> I liked the more powerful for loop.  I'm curious is there any ability to 
> use delegates in the same way as lua does?

Yes it can use anonymous delegates. You can also overload it in classes.

> 
> 3.)
>  From the newsgroups, it seems like 'auto' as local raii and 'auto' as
> automatic type deduction are still linked to the one keyword.

There are lots of D users hoping that this wart will be repaired before too
long. 

> 4.)
> The D version of Scintilla and d-build was nice, very easy to use.
> Personally I would have preferred the default behaviour of dbuild to put 
> object files in an /obj subdirectory and the final exe in the original 
> directory dbuild is run from.
> 
> This way, it could be run from a root directory, operate on a /src 
> subdirectory, and not clutter up the source with object files.  There is 
> a switch for that, of course, but I can't imagine when you would want 
> object files sitting in the same directory as the source.

Thanks for the Build comments. One unfortunate thing I find is that one
person's defaults are another's exceptions. That is why you can tailor
Build to your 'default' behaviour requirements. In this case, create a text
file in the same directory that Build.exe is installed in, called
'build.cfg' and place in it the line ...

CMDLINE=-od./obj

Then when you run the tool, the command line switch is applied every time
you run it.


-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
"Down with mediocrity!"
29/09/2006 4:44:52 PM



More information about the Digitalmars-d mailing list