Re: GSoC 2016 - std.experimental.xml progress

2016-05-02 Thread Steven Schveighoffer via Digitalmars-d-announce

On 5/2/16 8:25 AM, 9il wrote:

On Monday, 2 May 2016 at 08:45:59 UTC, Lodovico Giaretta wrote:

Hi,

Just a little update about my project...
After days of bugfixes, the first almost-high-level API (XMLCursor) is
now quite usable.
Now I can start working on other APIs (e.g. DOM) based on it.

If you're interested you can find some usage examples in files
benchmark.d and test.d .
Any comment is highly appreciated.

(If you missed it, the repo is
https://github.com/lodo1995/experimental.xml ).

Thank you in advance.

Lodovico Giaretta


Hello Lodovico,

Thank you for working on new xml. Please use size_t and sizediff_t
instead of uint and int in your loops:

for (auto i = 0; i < t.length; i++)

should be replaced with

foreach (size_t i; 0 .. t.length)


It's not obvious, but you identified 2 different things here.

auto i = 0 -> typeof(i) == int

size_t i = 0 -> typeof(i) == size_t

AND

use foreach instead of for loops for simple index traversal.

Note: foreach(i; 0 .. t.length) should correctly type i as size_t, there 
is no need to force it.


-Steve


Re: GSoC 2016 - std.experimental.xml progress

2016-05-02 Thread Lodovico Giaretta via Digitalmars-d-announce

On Monday, 2 May 2016 at 12:25:03 UTC, 9il wrote:

Hello Lodovico,

Thank you for working on new xml. Please use size_t and 
sizediff_t instead of uint and int in your loops:


for (auto i = 0; i < t.length; i++)

should be replaced with

foreach (size_t i; 0 .. t.length)

Best regards,
Ilya


I'll fix this. Thank you very much.


Re: GSoC 2016 - std.experimental.xml progress

2016-05-02 Thread 9il via Digitalmars-d-announce

On Monday, 2 May 2016 at 08:45:59 UTC, Lodovico Giaretta wrote:

Hi,

Just a little update about my project...
After days of bugfixes, the first almost-high-level API 
(XMLCursor) is now quite usable.

Now I can start working on other APIs (e.g. DOM) based on it.

If you're interested you can find some usage examples in files 
benchmark.d and test.d .

Any comment is highly appreciated.

(If you missed it, the repo is 
https://github.com/lodo1995/experimental.xml ).


Thank you in advance.

Lodovico Giaretta


Hello Lodovico,

Thank you for working on new xml. Please use size_t and 
sizediff_t instead of uint and int in your loops:


for (auto i = 0; i < t.length; i++)

should be replaced with

foreach (size_t i; 0 .. t.length)

Best regards,
Ilya