Re: "Programming in D" book, "User Defined Attributes (UDA)" chapter

2014-09-11 Thread ketmar via Digitalmars-d-announce
On Thu, 11 Sep 2014 11:48:26 -0700
Ali Çehreli via Digitalmars-d-announce
 wrote:

> Would you like to send me your name so that I add it to the 
> Acknowledgments section. (Otherwise ketmar is it. :)
Ketmar, or Ketmar Dark if you want "full name". ;-)


signature.asc
Description: PGP signature


Re: "Programming in D" book, "User Defined Attributes (UDA)" chapter

2014-09-11 Thread Ali Çehreli via Digitalmars-d-announce

On 09/11/2014 11:30 AM, ketmar via Digitalmars-d-announce wrote:

On Thu, 11 Sep 2014 10:47:40 -0700
Ali Çehreli via Digitalmars-d-announce
 wrote:


http://ddili.org/ders/d.en/templates_more.html

there is a little bug: opSlice(size_t, size_t) description is:
`collection[i, j]`

shouldn't it be: `collection[i..j]`?



Thank you. There are others in the other table as well. Fix is coming soon.

I have already fixed the template constaint bugs: Two of them should be 
if (dimension <= 1) (not 2).


Would you like to send me your name so that I add it to the 
Acknowledgments section. (Otherwise ketmar is it. :)


Ali



Re: "Programming in D" book, "User Defined Attributes (UDA)" chapter

2014-09-11 Thread ketmar via Digitalmars-d-announce
On Thu, 11 Sep 2014 10:47:40 -0700
Ali Çehreli via Digitalmars-d-announce
 wrote:

>http://ddili.org/ders/d.en/templates_more.html
there is a little bug: opSlice(size_t, size_t) description is:
`collection[i, j]`

shouldn't it be: `collection[i..j]`?


signature.asc
Description: PGP signature


Re: "Programming in D" book, "User Defined Attributes (UDA)" chapter

2014-09-11 Thread Ali Çehreli via Digitalmars-d-announce

On 09/10/2014 01:41 AM, Andrej Mitrovic via Digitalmars-d-announce wrote:

> If you do consider publishing the book, do let us know before it
> happens so those of us who want to can go through a thorough review
> and let you know of any typo's or mistakes before it's set in stone
> (or on paper :P). I'd be glad to review it in-depth.

That is very kind of you. Everybody is always welcome to do so. :)

I guess putting the sources on a git repo would help the reviewers. 
There was such a request at some point but I did not follow up on that.


Ali



Re: "Programming in D" book, "User Defined Attributes (UDA)" chapter

2014-09-11 Thread Ali Çehreli via Digitalmars-d-announce

On 09/09/2014 05:04 PM, Ali Çehreli wrote:

> I have already tied many loose ends. I am currently
> changing the operator overloading chapter to include the more proper
> multi-dimensional indexing and slicing that came with 2.066.

Done.

I divided array operator overloading (indexing and slicing) into two 
categories:


1) I updated the existing Operator Overloading chapter to cover only 
single-dimensional uses by


- opIndex
- opIndexAssign
- opIndexUnary
- opIndexOpAssign
- opDollar
- opSlice

(I specifically took out the now-discouraged opSliceUnary, 
opSliceAssign, and opSliceOpAssign.)


  http://ddili.org/ders/d.en/operator_overloading.html

(Chuck Allison will be mad at me because I used one of his programming 
assignments as an example there: Double-ended queue implemented in terms 
of two D slices. :) )


2) I added the multi-dimensional operator overloading to the More 
Templates chapter under the section "Using templates in 
multi-dimensional operator overloading".


(That is admittedly a curious place for it but multi-dimensional 
operator overloading uses tuple template parameters, which are 
introduced in that chapter.)


There, I especially noted that the responsibility of opSlice is reduced 
to returning simply a Tuple!(size_t, size_t) or an equivalent type.


(In case others have missed it, returning a slice representing all of 
the elements of a container is now the responsibility of opIndex that 
takes no parameters.)


  http://ddili.org/ders/d.en/templates_more.html

Ali



Re: "Programming in D" book, "User Defined Attributes (UDA)" chapter

2014-09-10 Thread Andrej Mitrovic via Digitalmars-d-announce
On 8/29/14, Andrei Alexandrescu via Digitalmars-d-announce
 wrote:
> Awesome!! Put it on Amazon too! -- Andrei

Yeah, I'd be the first in line to buy it as well!

If you do consider publishing the book, do let us know before it
happens so those of us who want to can go through a thorough review
and let you know of any typo's or mistakes before it's set in stone
(or on paper :P). I'd be glad to review it in-depth.


Re: "Programming in D" book, "User Defined Attributes (UDA)" chapter

2014-09-09 Thread Ali Çehreli via Digitalmars-d-announce

On 09/09/2014 04:38 PM, Olivier Henley wrote:

> Blurb has a number of pages limitation that would require a two volumes
> release of your book. :/ Lulu can make it to 740 pages. CreateSpace
> offers packages up to 828 pages.

Page count can change simply by changing the font size. ;)

> I found this post interesting:
> 
http://www.cnet.com/news/self-publishing-a-book-25-things-you-need-to-know/


Thank you. I had read that before and I have it bookmarked to be read again.

> Otherwise did you contact any publisher?

My only contact was in 2011 with Addison Wesley through Andrei. He had 
relayed my interest to his editor and had learned that "the field of 
general programming introduction is very crowded."


They and other publishers may think differently as the book has become a 
little more like a language reference as well.


As an update, I have already tied many loose ends. I am currently 
changing the operator overloading chapter to include the more proper 
multi-dimensional indexing and slicing that came with 2.066.


Ali



Re: "Programming in D" book, "User Defined Attributes (UDA)" chapter

2014-09-09 Thread Olivier Henley via Digitalmars-d-announce

On Friday, 29 August 2014 at 05:35:12 UTC, Ali Çehreli wrote:

Would you recommend considering at least some of Blurb.com's 
competitors as well? Who?


Right.

Blurb has a number of pages limitation that would require a two 
volumes release of your book. :/ Lulu can make it to 740 pages. 
CreateSpace offers packages up to 828 pages. Both can distribute 
through Amazon. Prices are somewhat similar...


I found this post interesting: 
http://www.cnet.com/news/self-publishing-a-book-25-things-you-need-to-know/


Otherwise did you contact any publisher?

olivier




Re: "Programming in D" book, "User Defined Attributes (UDA)" chapter

2014-08-29 Thread Andrei Alexandrescu via Digitalmars-d-announce

On 8/29/14, 6:30 AM, Ali Çehreli wrote:

On 08/29/2014 03:45 AM, Dejan Lekic wrote:


 Do you by any chance plan to release ePub version of it?


Yes. It will happen. :)

Ali


Awesome!! Put it on Amazon too! -- Andrei




Re: "Programming in D" book, "User Defined Attributes (UDA)" chapter

2014-08-29 Thread Ali Çehreli via Digitalmars-d-announce

On 08/29/2014 03:45 AM, Dejan Lekic wrote:


 Do you by any chance plan to release ePub version of it?


Yes. It will happen. :)

Ali



Re: "Programming in D" book, "User Defined Attributes (UDA)" chapter

2014-08-29 Thread Dejan Lekic via Digitalmars-d-announce

On Wednesday, 27 August 2014 at 06:16:14 UTC, Ali Çehreli wrote:
I made some additions and corrections. The following are the 
major ones:


* The 'User Defined Attributes (UDA)' chapter

* @nogc

* foreach_reverse

* Formatted element output with %( and %)

* static this, static ~this, shared static this, and shared 
static ~this


As a reminder, the book is available as PDF, downloadable from 
the header of each chapter:


  http://ddili.org/ders/d.en/index.html

Ali


Good work Ali! Do you by any chance plan to release ePub version 
of it?


Re: "Programming in D" book, "User Defined Attributes (UDA)" chapter

2014-08-28 Thread Ali Çehreli via Digitalmars-d-announce

On 08/28/2014 02:06 PM, Olivier Henley wrote:

> Huge thx for all the nice work btw.

I thank everyone for the nice words and the motivation. :)

> 1. Does the book have been entirely translated then..?

Technically yes, but UDAs had to be added before I could call it 
complete and there are still missing pieces:


- opDollar and the very recent multi-index opSlice

- @disable

- Importing multiple modules of a package

- This is an interesting one, which I think not many people know about: 
aliases for operator overloading. See the following push for an example:


  https://github.com/D-Programming-Language/dmd/pull/989/files

- Table of contents for the pdf version

- Book index

- A number of other things

> 2. Would you agree to configure a print version through Blurb.com? This
> way we could get a copy through amazon like ... tomorrow ;)

I think I am finally very close to doing that, but not today. :)

Would you recommend considering at least some of Blurb.com's competitors 
as well? Who?


Thank you,
Ali



Re: "Programming in D" book, "User Defined Attributes (UDA)" chapter

2014-08-28 Thread Ali Çehreli via Digitalmars-d-announce

On 08/26/2014 11:42 PM, ketmar via Digitalmars-d-announce wrote:

On Tue, 26 Aug 2014 23:16:14 -0700
Ali Çehreli via Digitalmars-d-announce
 wrote:


* Formatted element output with %( and %)

by the way, i never knows about this feature. maybe i should RTFM
someday...



They appear under formattedWrite:

  http://dlang.org/phobos/std_format.html#.formattedWrite

My brief explanation is under "Formatted element output" here:

  http://ddili.org/ders/d.en/formatted_output.html

Ali



Re: "Programming in D" book, "User Defined Attributes (UDA)" chapter

2014-08-28 Thread eles via Digitalmars-d-announce

On Thursday, 28 August 2014 at 21:07:00 UTC, Olivier Henley wrote:

Super!

Huge thx for all the nice work btw.

Questions:

1. Does the book have been entirely translated then..?


Here, the answer is "Yes"

Ali's work is impressive.



Re: "Programming in D" book, "User Defined Attributes (UDA)" chapter

2014-08-28 Thread Olivier Henley via Digitalmars-d-announce

Super!

Huge thx for all the nice work btw.

Questions:

1. Does the book have been entirely translated then..?

2. Would you agree to configure a print version through 
Blurb.com? This way we could get a copy through amazon like ... 
tomorrow ;)






Re: "Programming in D" book, "User Defined Attributes (UDA)" chapter

2014-08-27 Thread eles via Digitalmars-d-announce

On Wednesday, 27 August 2014 at 06:16:14 UTC, Ali Çehreli wrote:
I made some additions and corrections. The following are the 
major ones:


* The 'User Defined Attributes (UDA)' chapter

* @nogc

* foreach_reverse

* Formatted element output with %( and %)

* static this, static ~this, shared static this, and shared 
static ~this





Wonderful work. Many thanks.


Re: "Programming in D" book, "User Defined Attributes (UDA)" chapter

2014-08-26 Thread ketmar via Digitalmars-d-announce
On Tue, 26 Aug 2014 23:16:14 -0700
Ali Çehreli via Digitalmars-d-announce
 wrote:

> * Formatted element output with %( and %)
by the way, i never knows about this feature. maybe i should RTFM
someday...


signature.asc
Description: PGP signature


Re: "Programming in D" book, "User Defined Attributes (UDA)" chapter

2014-08-26 Thread ketmar via Digitalmars-d-announce
On Tue, 26 Aug 2014 23:16:14 -0700
Ali Çehreli via Digitalmars-d-announce
 wrote:

> * The 'User Defined Attributes (UDA)' chapter
great!

> * static this, static ~this, shared static this, and shared static
> ~this
and this too.


signature.asc
Description: PGP signature