Re: D's Auto Decoding and You

2016-06-02 Thread jmh530 via Digitalmars-d-announce
On Thursday, 2 June 2016 at 21:33:02 UTC, Andrei Alexandrescu 
wrote:


Should I assume some normalization occurred on the way?



I'm just looking over std.uni's section on normalization and 
realizing that I had basically no idea what it is or what's going 
on. The wikipedia page on unicode equivalence is a bit clearer.


I'm definitely nowhere near qualified to have an opinion on these 
issues.


Re: D's Auto Decoding and You

2016-06-02 Thread jmh530 via Digitalmars-d-announce

On Thursday, 2 June 2016 at 21:31:39 UTC, Jack Stouffer wrote:

On Thursday, 2 June 2016 at 21:21:50 UTC, jmh530 wrote:
I was a little confused by something in the main autodecoding 
thread, so I read your article again. Unfortunately, I don't 
think my confusion is resolved. I was trying one of your 
examples (full code I used below). You claim it works, but I 
keep getting assertion failures. I'm just running it with rdmd 
on Windows 7.



import std.algorithm : canFind;

void main()
{
string s = "cassé";

assert(s.canFind!(x => x == 'é'));
}


Your browser is turning the é in the string into two code 
points via normalization whereas it should be one. Try using 
\u00E9 instead.


That doesn't cause an assert to fail, but when I do  
writeln('\u00E9') I get é. So there might still be something 
wonky going on. I looked up \u00E9 online and I don't think 
there's an error with that.


Re: D's Auto Decoding and You

2016-06-02 Thread Andrei Alexandrescu via Digitalmars-d-announce

On 6/2/16 5:27 PM, Steven Schveighoffer wrote:

On 6/2/16 5:21 PM, jmh530 wrote:

On Tuesday, 17 May 2016 at 14:06:37 UTC, Jack Stouffer wrote:


If you think there should be any more information included in the
article, please let me know so I can add it.


I was a little confused by something in the main autodecoding thread, so
I read your article again. Unfortunately, I don't think my confusion is
resolved. I was trying one of your examples (full code I used below).
You claim it works, but I keep getting assertion failures. I'm just
running it with rdmd on Windows 7.


import std.algorithm : canFind;

void main()
{
string s = "cassé";

assert(s.canFind!(x => x == 'é'));
}


If that é above is an e followed by a combining character, then you will
get the error. This is because autodecoding does not auto normalize as
well -- the code points have to match exactly.

-Steve


Indeed. FWIW I just copied OP's code from Thunderbird into Chrome (on 
OSX) and it worked: https://dpaste.dzfl.pl/09b9188d87a5


Should I assume some normalization occurred on the way?


Andrei



Re: D's Auto Decoding and You

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

On 6/2/16 5:21 PM, jmh530 wrote:

On Tuesday, 17 May 2016 at 14:06:37 UTC, Jack Stouffer wrote:


If you think there should be any more information included in the
article, please let me know so I can add it.


I was a little confused by something in the main autodecoding thread, so
I read your article again. Unfortunately, I don't think my confusion is
resolved. I was trying one of your examples (full code I used below).
You claim it works, but I keep getting assertion failures. I'm just
running it with rdmd on Windows 7.


import std.algorithm : canFind;

void main()
{
string s = "cassé";

assert(s.canFind!(x => x == 'é'));
}


If that é above is an e followed by a combining character, then you 
will get the error. This is because autodecoding does not auto normalize 
as well -- the code points have to match exactly.


-Steve


Re: D's Auto Decoding and You

2016-06-02 Thread Jack Stouffer via Digitalmars-d-announce

On Thursday, 2 June 2016 at 21:21:50 UTC, jmh530 wrote:
I was a little confused by something in the main autodecoding 
thread, so I read your article again. Unfortunately, I don't 
think my confusion is resolved. I was trying one of your 
examples (full code I used below). You claim it works, but I 
keep getting assertion failures. I'm just running it with rdmd 
on Windows 7.



import std.algorithm : canFind;

void main()
{
string s = "cassé";

assert(s.canFind!(x => x == 'é'));
}


Your browser is turning the é in the string into two code points 
via normalization whereas it should be one. Try using \u00E9 
instead.


Re: D's Auto Decoding and You

2016-06-02 Thread jmh530 via Digitalmars-d-announce

On Tuesday, 17 May 2016 at 14:06:37 UTC, Jack Stouffer wrote:


If you think there should be any more information included in 
the article, please let me know so I can add it.


I was a little confused by something in the main autodecoding 
thread, so I read your article again. Unfortunately, I don't 
think my confusion is resolved. I was trying one of your examples 
(full code I used below). You claim it works, but I keep getting 
assertion failures. I'm just running it with rdmd on Windows 7.



import std.algorithm : canFind;

void main()
{
string s = "cassé";

assert(s.canFind!(x => x == 'é'));
}


Re: [Blog post] Operator overloading for structs in D

2016-06-02 Thread Walter Bright via Digitalmars-d-announce

On 6/2/2016 11:34 AM, Minas Mina wrote:

I have written a blog post about operator overloading for structs.

You can find it here:
https://www.reddit.com/r/programming/comments/4m8mgr/operator_overloading_for_structs_in_d/


Comments and suggestions are appreciated.


Things usually go better on Reddit if you post as the first comment a summary of 
what the article is about.


Also, if you post your own articles, Reddit is likely to put you on their 
auto-ban list :-(


Re: Beta release vibe.d 0.7.29-beta.2

2016-06-02 Thread Jacob Carlborg via Digitalmars-d-announce

On 2016-06-02 15:13, Sönke Ludwig wrote:


There is something in
https://github.com/dlang/dub/wiki/Version-management#basic-dependency-specification


Maybe I'll have the time to write a more formal
documentation/specification at some point. But currently I'm still
struggling with getting the most pressing things done. This is certainly
a great contribution opportunity for anyone familiar with the concept.


Is anyone actually familiar with the concept? :)

--
/Jacob Carlborg


Re: [Blog post] Operator overloading for structs in D

2016-06-02 Thread Minas Mina via Digitalmars-d-announce
On Thursday, 2 June 2016 at 18:55:36 UTC, Steven Schveighoffer 
wrote:

On 6/2/16 2:34 PM, Minas Mina wrote:

[...]


Cool. You missed one very significant thing. That is using 
mixins to take advantage of the operator string.


For example, opOpAssign can be done in one step:

ref Rational opOpAssign(string op)(auto ref Rational r)
if(op == "+" || op == "-" || op == "/" || op == "*")
{
mixin("auto tmp = this " ~ op ~ " r;");
_n = tmp.n;
_d = tmp.d;
return this;
}

This is the whole reason, BTW, that operator overloads were 
changed from the original D1 style versions.


Some more examples of your Rational type in action would be 
good too.


-Steve


Thanks for the feedback! I will update the post tomorrow or on 
Saturday.


Re: [Blog post] Operator overloading for structs in D

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

On 6/2/16 2:34 PM, Minas Mina wrote:

I have written a blog post about operator overloading for structs.

You can find it here:
https://www.reddit.com/r/programming/comments/4m8mgr/operator_overloading_for_structs_in_d/


Comments and suggestions are appreciated.


Cool. You missed one very significant thing. That is using mixins to 
take advantage of the operator string.


For example, opOpAssign can be done in one step:

ref Rational opOpAssign(string op)(auto ref Rational r)
if(op == "+" || op == "-" || op == "/" || op == "*")
{
mixin("auto tmp = this " ~ op ~ " r;");
_n = tmp.n;
_d = tmp.d;
return this;
}

This is the whole reason, BTW, that operator overloads were changed from 
the original D1 style versions.


Some more examples of your Rational type in action would be good too.

-Steve


[Blog post] Operator overloading for structs in D

2016-06-02 Thread Minas Mina via Digitalmars-d-announce

I have written a blog post about operator overloading for structs.

You can find it here: 
https://www.reddit.com/r/programming/comments/4m8mgr/operator_overloading_for_structs_in_d/


Comments and suggestions are appreciated.


Re: First Boston D language meetup

2016-06-02 Thread Andrei Alexandrescu via Digitalmars-d-announce

On 06/02/2016 12:47 PM, Steven Schveighoffer wrote:

On Thursday, 2 June 2016 at 15:37:27 UTC, Andrei Alexandrescu wrote:


Due to an emergency at my wife's work I'd rather move this to
tomorrow, same time. Sameer if you see this please let us know if
you're okay with the change. -- Andrei


Moved to Friday, same time/place. See you then!


Many thanks. Beer's on me tomorrow! -- Andrei



Re: First Boston D language meetup

2016-06-02 Thread Steven Schveighoffer via Digitalmars-d-announce
On Thursday, 2 June 2016 at 15:37:27 UTC, Andrei Alexandrescu 
wrote:


Due to an emergency at my wife's work I'd rather move this to 
tomorrow, same time. Sameer if you see this please let us know 
if you're okay with the change. -- Andrei


Moved to Friday, same time/place. See you then!

-Steve



Re: First Boston D language meetup

2016-06-02 Thread Andrei Alexandrescu via Digitalmars-d-announce

On 06/02/2016 09:30 AM, Steven Schveighoffer wrote:

On 5/27/16 1:35 PM, Steven Schveighoffer wrote:

I added a meetup date for next Thursday. If any one is interested:

http://www.meetup.com/Boston-area-D-Programming-Language-Meetup/events/231443603/



Just a reminder, for those Bostonians (and surrounding areas) that may
have missed this, the meeting is tonight! 3 coming so far.

Also, if anyone in the area has ideas about a more suitable meeting
location for future meetings, please let me know! I'd love to achieve a
similar situation as the Bay Area meetup group, so we can have guest
speakers.

See you there!

-Steve


Due to an emergency at my wife's work I'd rather move this to tomorrow, 
same time. Sameer if you see this please let us know if you're okay with 
the change. -- Andrei


Re: First Boston D language meetup

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

On 5/27/16 1:35 PM, Steven Schveighoffer wrote:

I added a meetup date for next Thursday. If any one is interested:

http://www.meetup.com/Boston-area-D-Programming-Language-Meetup/events/231443603/


Just a reminder, for those Bostonians (and surrounding areas) that may 
have missed this, the meeting is tonight! 3 coming so far.


Also, if anyone in the area has ideas about a more suitable meeting 
location for future meetings, please let me know! I'd love to achieve a 
similar situation as the Bay Area meetup group, so we can have guest 
speakers.


See you there!

-Steve


Re: Beta release vibe.d 0.7.29-beta.2

2016-06-02 Thread Seb via Digitalmars-d-announce

On Thursday, 2 June 2016 at 12:22:51 UTC, Jacob Carlborg wrote:

On 2016-06-02 10:27, Sönke Ludwig wrote:
The release candidate is planned for the 6th, so please take a 
moment to

test this release. Instead of `dub upgrade --prerelease`, edit
dub.selections.json directly and put 0.7.29-beta.2 as the 
vibe-d version
(there is already an alpha version of 0.7.30 out, so the 
upgrade would

pick that instead).


Could you please, at one point, write documentation, or somehow 
otherwise describe the purpose of dub.selections.json?


I guess we should move this discussion to the regarding issue?

https://github.com/dlang/dub/issues/829


Re: Beta release vibe.d 0.7.29-beta.2

2016-06-02 Thread Sönke Ludwig via Digitalmars-d-announce

Am 02.06.2016 um 14:22 schrieb Jacob Carlborg:

On 2016-06-02 10:27, Sönke Ludwig wrote:

The release candidate is planned for the 6th, so please take a moment to
test this release. Instead of `dub upgrade --prerelease`, edit
dub.selections.json directly and put 0.7.29-beta.2 as the vibe-d version
(there is already an alpha version of 0.7.30 out, so the upgrade would
pick that instead).


Could you please, at one point, write documentation, or somehow
otherwise describe the purpose of dub.selections.json?



There is something in 
https://github.com/dlang/dub/wiki/Version-management#basic-dependency-specification


Maybe I'll have the time to write a more formal 
documentation/specification at some point. But currently I'm still 
struggling with getting the most pressing things done. This is certainly 
a great contribution opportunity for anyone familiar with the concept.


Re: C++ to D converter based on clang

2016-06-02 Thread Jacob Carlborg via Digitalmars-d-announce

On 2016-06-01 14:50, Daniel Murphy wrote:


Haha that really depends on your goals.


Yeah, I know magicport can translate DMD. The goal there is to translate 
arbitrary C++ code to D.


--
/Jacob Carlborg


Re: Beta release vibe.d 0.7.29-beta.2

2016-06-02 Thread Jacob Carlborg via Digitalmars-d-announce

On 2016-06-02 10:27, Sönke Ludwig wrote:

The release candidate is planned for the 6th, so please take a moment to
test this release. Instead of `dub upgrade --prerelease`, edit
dub.selections.json directly and put 0.7.29-beta.2 as the vibe-d version
(there is already an alpha version of 0.7.30 out, so the upgrade would
pick that instead).


Could you please, at one point, write documentation, or somehow 
otherwise describe the purpose of dub.selections.json?


--
/Jacob Carlborg


Beta release vibe.d 0.7.29-beta.2

2016-06-02 Thread Sönke Ludwig via Digitalmars-d-announce
The release candidate is planned for the 6th, so please take a moment to 
test this release. Instead of `dub upgrade --prerelease`, edit 
dub.selections.json directly and put 0.7.29-beta.2 as the vibe-d version 
(there is already an alpha version of 0.7.30 out, so the upgrade would 
pick that instead).


Main changes over 0.7.28:

 - Drops support for DMD frontend 2.066.x and below and adds support up
   to 2.071.0
 - Removes all deprecated functionality, as well as the libev driver
 - Contains considerable performance improvement for URLRouter
 - Contains a critical fix for the Json struct, which was prone to
   dangling pointers due to wrong alignment on x64
 - Hopefully removes all instances of "Manually resuming taks that is
   already scheduled" assertion failures

All changes:
https://github.com/rejectedsoftware/vibe.d/blob/master/CHANGELOG.md

DUB package:
http://code.dlang.org/packages/vibe-d/0.7.29-beta.2


Re: D Profile Viewer

2016-06-02 Thread Nordlöw via Digitalmars-d-announce

On Thursday, 24 March 2016 at 20:34:07 UTC, Andrew wrote:

Its here: https://bitbucket.org/andrewtrotman/d-profile-viewer
Please let me know if you find any bugs.


It's better to use backticks to produce raw string literals for 
all the quoted code. Then you don't have to backslash all the 
double-quotes in the HTML and JS here:


https://bitbucket.org/andrewtrotman/d-profile-viewer/src/b8292aad50dab5ceca6a9067f0d867f89d9c0d20/source/app.d?at=default=file-view-default

The for instance

"
	src=\"https://www.google.com/jsapi\";>

"

becomes

`
	src="https://www.google.com/jsapi";>

`

Thanks!