An effort at creating a free ebook for learning D

Jose Armando Garcia jsancio at gmail.com
Mon Jun 20 15:25:42 PDT 2011


On Mon, Jun 20, 2011 at 7:13 PM, Kai Meyer <kai at unixlords.com> wrote:
> On 06/20/2011 03:46 PM, Jose Armando Garcia wrote:
>>
>> On Mon, Jun 20, 2011 at 6:30 PM, Jimmy Cao<jcao219 at gmail.com>  wrote:
>>>
>>> I helped with something last summer: an attempt at creating a wikibook
>>> for
>>> D.  At that time, my D skills were very bad, so I had to concentrate on
>>> learning D first before contributing to more lessons.
>>> One thing that has always bothered me is, there aren't many good *free*
>>> ebooks for learning D.
>>> Well, I'll try to continue what I had started less than a year ago.  I'll
>>> probably make many mistakes while writing, so can you guys check on my
>>> progress once in a while?
>>>
>>> http://en.wikibooks.org/wiki/D_(The_Programming_Language)/d2/Lesson_1/Phobos
>>> What do you think?
>>> Thanks.
>>
>> Good idea. Small notes:
>>
>> *) In the tip section 'write("Hello\n") and writeln("Hello")' are not
>> the same. writeln and writefln flush. write doesn't.
>> *) Not sure if you want to also encourage portable code. "\n" should
>> be replace with newline which I think it is define in std.string.
>
> I wrote some code a while back that was intended to be portable (between
> windows and linux anyway). I used 'writef("Hello\n");' a lot, and those
> always printed correctly on windows. Does writef do something different than
> write with the '\n' character?
>
> -Kai Meyer
>

The command line console may deal with it okay but here are many
Windows programs that assume that newline is '\r\n'. That is the same
problem with '\\' and '/' for path separator. Some tools handle both
while others only handle '\\'.

-Jose


More information about the Digitalmars-d-learn mailing list