Re: D 2.066 is out. Enjoy!

2014-08-22 Thread Daniel Murphy via Digitalmars-d-announce
Jonathan M Davis wrote in message news:fxdqpmfcbskvtcafz...@forum.dlang.org... LOL. Yeah, well, it would be ni going to support C+ce if we could get an actual list of the C++ features that D currently supports somewhere (and how to use them if it's not obvious). You've been doing so much

Re: D 2.066 is out. Enjoy!

2014-08-22 Thread Daniel Murphy via Digitalmars-d-announce
Walter Bright wrote in message news:lt5l3k$2s5t$1...@digitalmars.com... The thing is, while the code was there, there wasn't a single test case for it in the test suite. Furthermore, at least for Elf, there was no support for the special mangling done for ::std:: stuff. Yeah, I don't know

Re: D 2.066 is out. Enjoy!

2014-08-22 Thread via Digitalmars-d-announce
On Thursday, 21 August 2014 at 20:49:48 UTC, bachmeier wrote: It would be nice to have a page to link to when questions come up on Reddit about compatibility with C++. We have this: http://dlang.org/cpp_interface.html From what I understand, it's not complete. For example it says that

Re: D 2.066 is out. Enjoy!

2014-08-22 Thread Dejan Lekic via Digitalmars-d-announce
On Monday, 18 August 2014 at 19:00:23 UTC, Andrei Alexandrescu wrote: Congratulations to everyone involved! http://www.reddit.com/r/programming/comments/2dwqvy/d_2066_nogc_c_namespaces_multidimensional_slices/ https://www.facebook.com/dlang.org/posts/905593426121006

Re: D 2.066 is out. Enjoy!

2014-08-22 Thread bachmeier via Digitalmars-d-announce
On Friday, 22 August 2014 at 08:23:16 UTC, Marc Schütz wrote: On Thursday, 21 August 2014 at 20:49:48 UTC, bachmeier wrote: It would be nice to have a page to link to when questions come up on Reddit about compatibility with C++. We have this: http://dlang.org/cpp_interface.html From what I

Re: D 2.066 is out. Enjoy!

2014-08-22 Thread Andrei Alexandrescu via Digitalmars-d-announce
On 8/22/14, 2:06 AM, Dejan Lekic wrote: On Monday, 18 August 2014 at 19:00:23 UTC, Andrei Alexandrescu wrote: Congratulations to everyone involved! http://www.reddit.com/r/programming/comments/2dwqvy/d_2066_nogc_c_namespaces_multidimensional_slices/

Re: Fix #2529: explicit protection package #3651

2014-08-22 Thread Dmitry Olshansky via Digitalmars-d-announce
On Tuesday, 19 August 2014 at 17:08:25 UTC, Walter Bright wrote: On 8/19/2014 7:01 AM, Dicebot wrote: Walter, now that release is out can you please state your opinion about https://github.com/D-Programming-Language/dmd/pull/3651 ? It is blocking Phobos module split and decoupling. I keep

Re: D 2.066 is out. Enjoy!

2014-08-22 Thread Walter Bright via Digitalmars-d-announce
On 8/22/2014 1:23 AM, Daniel Murphy wrote: Walter Bright wrote in message news:lt5l3k$2s5t$1...@digitalmars.com... The thing is, while the code was there, there wasn't a single test case for it in the test suite. Furthermore, at least for Elf, there was no support for the special mangling done

Re: D 2.066 is out. Enjoy!

2014-08-22 Thread John Colvin via Digitalmars-d-announce
On Friday, 22 August 2014 at 14:36:13 UTC, Andrei Alexandrescu wrote: On 8/22/14, 2:06 AM, Dejan Lekic wrote: On Monday, 18 August 2014 at 19:00:23 UTC, Andrei Alexandrescu wrote: Congratulations to everyone involved!

Re: D 2.066 is out. Enjoy!

2014-08-22 Thread Walter Bright via Digitalmars-d-announce
On 8/22/2014 1:18 AM, Daniel Murphy wrote: There are two reason it's not better documented: 1. I hate writing documentation. I really really hate it. Join the club :-) 2. These features are rather difficult to use, and I don't want people to think they can just plug-and-play. I've spent a

Re: D 2.066 is out. Enjoy!

2014-08-22 Thread Andrei Alexandrescu via Digitalmars-d-announce
On 8/22/14, 10:04 AM, Walter Bright wrote: On 8/22/2014 1:23 AM, Daniel Murphy wrote: I assume you're aiming for something like a 'core.stdcpp.vector' with an implementation to match each stl implementation? Yes. While it'll be a significant effort to do this, it could be a big win for us.

Re: D 2.066 is out. Enjoy!

2014-08-22 Thread Andrei Alexandrescu via Digitalmars-d-announce
On 8/22/14, 10:05 AM, John Colvin wrote: As I'm sure has been mentioned elsewhere, the website changes should be part of the release process, not an afterthought. Agreed. Who would like to volunteer being our webmaster? We'll discuss with our admin to give push rights. -- Andrei

Re: D 2.066 is out. Enjoy!

2014-08-22 Thread John via Digitalmars-d-announce
On Friday, 22 August 2014 at 17:06:31 UTC, Walter Bright wrote: On 8/22/2014 1:18 AM, Daniel Murphy wrote: There are two reason it's not better documented: 1. I hate writing documentation. I really really hate it. Join the club :-) 2. These features are rather difficult to use, and I don't

Re: D 2.066 is out. Enjoy!

2014-08-22 Thread Brad Roberts via Digitalmars-d-announce
On 8/22/2014 11:33 AM, Andrei Alexandrescu via Digitalmars-d-announce wrote: On 8/22/14, 10:05 AM, John Colvin wrote: As I'm sure has been mentioned elsewhere, the website changes should be part of the release process, not an afterthought. Agreed. Who would like to volunteer being our

Re: Classes to build a Windows service.

2014-08-22 Thread Tyler Jensen via Digitalmars-d-announce
On Friday, 26 October 2007 at 18:47:43 UTC, Steve Teale wrote: Christoph Singewald Wrote: Hi! Did you put your classes somewhere, I'm interested how you build the service. At the moment I had no luck. tnx christoph Steve Teale Wrote: BCS Wrote: Reply to Steve, I've built a set

Re: Fix #2529: explicit protection package #3651

2014-08-22 Thread Dicebot via Digitalmars-d-announce
All I want is that whatever decision Walter makes to happen sooner than in few years from now.

Re: D 2.066 is out. Enjoy!

2014-08-22 Thread Kagamin via Digitalmars-d-announce
On Friday, 22 August 2014 at 08:18:18 UTC, Daniel Murphy wrote: 2. These features are rather difficult to use, and I don't want people to think they can just plug-and-play. I've spent a lot of time fighting compiler alignment bugs, which are their own special kind of hell. Many of those

Re: Fix #2529: explicit protection package #3651

2014-08-22 Thread bearophile via Digitalmars-d-announce
Dicebot: All I want is that whatever decision Walter makes to happen sooner than in few years from now. There are other pending patches, like the support for the nice [$] syntax by Kenji. I keep thinking there's gotta be a way to do this without language changes. or I keep thinking there

Re: D 2.066 is out. Enjoy!

2014-08-22 Thread Andrew Edwards via Digitalmars-d-announce
On 8/23/14, 3:33 AM, Andrei Alexandrescu wrote: On 8/22/14, 10:05 AM, John Colvin wrote: As I'm sure has been mentioned elsewhere, the website changes should be part of the release process, not an afterthought. Agreed. Who would like to volunteer being our webmaster? We'll discuss with our

Re: D 2.066 new behavior

2014-08-22 Thread Paul D Anderson via Digitalmars-d-announce
On Friday, 22 August 2014 at 02:26:38 UTC, safety0ff wrote: On Friday, 22 August 2014 at 01:54:55 UTC, Paul D Anderson wrote: Is this expected behavior that has never been enforced before, or is it something new? And is anyone else having the same problem? Paul Looks like a regression,

Re: Fix #2529: explicit protection package #3651

2014-08-22 Thread ketmar via Digitalmars-d-announce
On Fri, 22 Aug 2014 20:48:22 + bearophile via Digitalmars-d-announce digitalmars-d-announce@puremagic.com wrote: or (smart plan!) just apply the necessary PRs, build dmd from sources and start using the features. if authors of popular libraries will do this, there will be no choice and

Re: Fix #2529: explicit protection package #3651

2014-08-22 Thread ketmar via Digitalmars-d-announce
On Sat, 23 Aug 2014 04:50:36 +0300 ketmar via Digitalmars-d-announce digitalmars-d-announce@puremagic.com wrote: to be honest, i myself is a happy user of Kenji's $ patch and package(...) patch. yes, it costs some efforts to keep 'em up-to-date, but hey, i have no life anyway. signature.asc

Cheap Kitchens

2014-08-22 Thread ParkHyunAh12A via Digitalmars-d
Cheap Kitchens. Thirty Ex Display Kitchens To Clear. http://www.exdisplaykitchens1.co.uk £ 595 Each with appliances. Tel 01616-694785 _ [url=http://www.kitchensuber.co.uk]Cheap Kitchens[/url]

Cheap Kitchens

2014-08-22 Thread ParkHyunAh12A via Digitalmars-d
Cheap Kitchens. Thirty Ex Display Kitchens To Clear. http://www.exdisplaykitchens1.co.uk £ 595 Each with appliances. Tel 01616-694785 _ http://www.kitchensuber.co.uk

Re: RFC: std.json sucessor

2014-08-22 Thread Sönke Ludwig via Digitalmars-d
Am 22.08.2014 02:42, schrieb Ary Borenszweig: Say I have a class Person with name (string) and age (int) with a constructor that receives both. How would I create an instance of a Person from a json with the json stream? Suppose the json is this: {age: 10, name: John} And the class is this:

Re: RFC: std.json sucessor

2014-08-22 Thread Sönke Ludwig via Digitalmars-d
Am 22.08.2014 04:35, schrieb Colden Cullen: I notice in the docs there are several references to a `parseJSON` and `parseJson`, but I can't seem to find where either of these are defined. Is this just a typo? Hope this helps: https://github.com/s-ludwig/std_data_json/search?q=parseJsontype=Code

Re: RFC: std.json sucessor

2014-08-22 Thread Sönke Ludwig via Digitalmars-d
Am 22.08.2014 00:48, schrieb Brian Schott: On Thursday, 21 August 2014 at 22:35:18 UTC, Sönke Ludwig wrote: Destroy away! ;) source/stdx/data/json/lexer.d(263:8)[warn]: 'JSONToken' has method 'opEquals', but not 'toHash'. source/stdx/data/json/lexer.d(499:65)[warn]: Use parenthesis to clarify

Re: Automated source translation of C++ to D

2014-08-22 Thread Daniel Murphy via Digitalmars-d
Joakim wrote in message news:ynfwlptfuzfutksbn...@forum.dlang.org... Yes, I'm aware of ddmd. You've mentioned many times that it only works because dmd is written using a very unC++-like style, to the point where github's source analyzer claims that dmd is written in 66.7% C, 28.4% D

Re: scope classes mentioned in tutorials, but deprecated

2014-08-22 Thread Jacob Carlborg via Digitalmars-d
On 21/08/14 20:07, Brad Anderson wrote: On Thursday, 21 August 2014 at 17:55:19 UTC, Timothee Cour via Digitalmars-d wrote: http://dlang.org/cpptod.html#raii mentions scope class and scope variables, which seem deprecated (http://dlang.org/deprecate.html)

Re: scope classes mentioned in tutorials, but deprecated

2014-08-22 Thread bearophile via Digitalmars-d
Jacob Carlborg: How about we undeprecate it instead. If I recall correctly then DDMD depends on it. I think the idea is to discourage their usage as much as possible in user code, until (someday, perhaps) some memory area tracking system is implemented. Bye, bearophile

Re: Automated source translation of C++ to D

2014-08-22 Thread David Nadlinger via Digitalmars-d
On Friday, 22 August 2014 at 07:48:30 UTC, Daniel Murphy wrote: So no, you can't magically upgrade a project from C++ to D. Hence the name magicport? Sorry, could not resist. David

Re: scope classes mentioned in tutorials, but deprecated

2014-08-22 Thread Daniel Murphy via Digitalmars-d
Jacob Carlborg wrote in message news:lt6u0n$18mj$1...@digitalmars.com... How about we undeprecate it instead. If I recall correctly then DDMD depends on it. It's listed as 'future', so it's not actually deprecated. While DDMD does currently use it extensively, it can be replaced if

Re: Automated source translation of C++ to D

2014-08-22 Thread Daniel Murphy via Digitalmars-d
David Nadlinger wrote in message news:jumhdppapovcvfnwn...@forum.dlang.org... On Friday, 22 August 2014 at 07:48:30 UTC, Daniel Murphy wrote: So no, you can't magically upgrade a project from C++ to D. Hence the name magicport? Sorry, could not resist. David It's only the illusion of

Re: Automated source translation of C++ to D

2014-08-22 Thread ketmar via Digitalmars-d
On Fri, 22 Aug 2014 08:29:52 + David Nadlinger via Digitalmars-d digitalmars-d@puremagic.com wrote: Hence the name magicport? magic is not easy, contrary to widespread beliefs. ;-) signature.asc Description: PGP signature

Some template code that worked in 2.065 is not working in 2.066

2014-08-22 Thread Uranuz via Digitalmars-d
In my project I have sort of complicated logic to implement data structure that is somehow similar to std.typecons.Tuple. I can't reproduce it, because I can't locate the source of bug. My code is like this but have more nested template calls. import std.stdio, std.typetuple; struct

Re: Shouldn't have IsAlpha() from std.uni has a different name to avoid confusing from std.ascii?

2014-08-22 Thread Uranuz via Digitalmars-d
On Thursday, 21 August 2014 at 15:36:41 UTC, ketmar via Digitalmars-d wrote: On Thu, 21 Aug 2014 15:27:46 + MacAsm via Digitalmars-d digitalmars-d@puremagic.com wrote: Any thoughts? I don't know if I'm missing something but two functions (and not methods) with same name is very bad. they

Re: $100 bounty for help with Windows Service code

2014-08-22 Thread Kagamin via Digitalmars-d
https://github.com/duovia/WindowsServiceInD/blob/master/src/onedge/mysvc.d#L20 these are not necessarily static: it makes sense to have instance fields of shared types too.

Re: RFC: std.json sucessor

2014-08-22 Thread Sönke Ludwig via Digitalmars-d
Am 22.08.2014 00:35, schrieb Sönke Ludwig: The DOM style JSONValue type is based on std.variant.Algebraic. This currently has a few usability issues that can be solved by upgrading/fixing Algebraic: - Operator overloading only works sporadically - (...) - Operations and conversions

Re: RFC: std.json sucessor

2014-08-22 Thread matovitch via Digitalmars-d
Very nice ! I had started (and dropped) a json module based on Algebraic too. So without opDispatch you plan to use a syntax like jPerson[age] = 10 ? You didn't use stdx.d.lexer. Any reason why ? (I am asking even if I never used this module.(never coded much in D in fact))

Re: RFC: std.json sucessor

2014-08-22 Thread Sönke Ludwig via Digitalmars-d
Am 22.08.2014 14:17, schrieb matovitch: Very nice ! I had started (and dropped) a json module based on Algebraic too. So without opDispatch you plan to use a syntax like jPerson[age] = 10 ? You didn't use stdx.d.lexer. Any reason why ? (I am asking even if I never used this module.(never coded

Re: RFC: std.json sucessor

2014-08-22 Thread matovitch via Digitalmars-d
On Friday, 22 August 2014 at 12:39:08 UTC, Sönke Ludwig wrote: Am 22.08.2014 14:17, schrieb matovitch: Very nice ! I had started (and dropped) a json module based on Algebraic too. So without opDispatch you plan to use a syntax like jPerson[age] = 10 ? You didn't use stdx.d.lexer. Any reason

Re: RFC: std.json sucessor

2014-08-22 Thread Sönke Ludwig via Digitalmars-d
Am 22.08.2014 14:47, schrieb matovitch: Ok. I think I remember there was a stdx.d.lexer's Json parser provided as sample. I see, so you just have to write your own number/string parsing routines: https://github.com/Hackerpilot/lexer-demo/blob/master/jsonlexer.d

Is there any preprocessor scripting language?

2014-08-22 Thread MarisaLovesUsAll via Digitalmars-d
I just want to write something like this: #ololo script foreach(child; findAllChildrens()) { child.insert( static void doABarrelRoll() { } ); } #end Templates/mixins is not enough for me... maybe because of hands.dll error :)

Re: RFC: std.json sucessor

2014-08-22 Thread matovitch via Digitalmars-d
On Friday, 22 August 2014 at 13:00:19 UTC, Sönke Ludwig wrote: Am 22.08.2014 14:47, schrieb matovitch: Ok. I think I remember there was a stdx.d.lexer's Json parser provided as sample. I see, so you just have to write your own number/string parsing routines:

Re: Is there any preprocessor scripting language?

2014-08-22 Thread Kagamin via Digitalmars-d
You can try D parsing libraries: http://forum.dlang.org/thread/jqwvudiwgiuprqcua...@forum.dlang.org they're believed to enable writing refactoring scripts.

Re: Is there any preprocessor scripting language?

2014-08-22 Thread Kagamin via Digitalmars-d
Example: import std.lexer; import std.d.lexer; import std.array; import std.stdio; void main(string[] args) { File input = File(args[1]); File output = args.length 2 ? File(args[2]) : stdout; ubyte[] inputBytes = uninitializedArray!(ubyte[])(input.size);

Is there a native function to detect if file is UTF encoding?

2014-08-22 Thread MacAsm via Digitalmars-d
To call decode() from std.encoding I need to make sure it is an UTF (may ne ASCII too) otherwise is will skyp over ASCII values. Is there any D native for it or I need to check byte order mark and write one myself?

Re: Some template code that worked in 2.065 is not working in 2.066

2014-08-22 Thread Dicebot via Digitalmars-d
I believe it should work (it is no different from foreach(elem; myLib.Symbols) which works), but there are better experts on such topics hanging around.

Re: Is there a native function to detect if file is UTF encoding?

2014-08-22 Thread Dejan Lekic via Digitalmars-d
On Friday, 22 August 2014 at 13:53:04 UTC, MacAsm wrote: To call decode() from std.encoding I need to make sure it is an UTF (may ne ASCII too) otherwise is will skyp over ASCII values. Is there any D native for it or I need to check byte order mark and write one myself? You may want to take

Re: Automated source translation of C++ to D

2014-08-22 Thread David Gileadi via Digitalmars-d
On 8/22/14 1:29 AM, David Nadlinger wrote: On Friday, 22 August 2014 at 07:48:30 UTC, Daniel Murphy wrote: So no, you can't magically upgrade a project from C++ to D. Hence the name magicport? Sorry, could not resist. David It's pronounced sufficiently advanced technology port :)

Re: RFC: std.json sucessor

2014-08-22 Thread Ary Borenszweig via Digitalmars-d
On 8/22/14, 3:33 AM, Sönke Ludwig wrote: Am 22.08.2014 02:42, schrieb Ary Borenszweig: Say I have a class Person with name (string) and age (int) with a constructor that receives both. How would I create an instance of a Person from a json with the json stream? Suppose the json is this: {age:

Re: Is there a native function to detect if file is UTF encoding?

2014-08-22 Thread Kiith-Sa via Digitalmars-d
On Friday, 22 August 2014 at 13:53:04 UTC, MacAsm wrote: To call decode() from std.encoding I need to make sure it is an UTF (may ne ASCII too) otherwise is will skyp over ASCII values. Is there any D native for it or I need to check byte order mark and write one myself? This may be simpler

Re: Is there any preprocessor scripting language?

2014-08-22 Thread MarisaLovesUsAll via Digitalmars-d
On Friday, 22 August 2014 at 13:33:12 UTC, Kagamin wrote: You can try D parsing libraries: http://forum.dlang.org/thread/jqwvudiwgiuprqcua...@forum.dlang.org they're believed to enable writing refactoring scripts. Thanks a lot! It will be useful.

Re: scope classes mentioned in tutorials, but deprecated

2014-08-22 Thread Jacob Carlborg via Digitalmars-d
On 2014-08-22 10:37, Daniel Murphy wrote: It's listed as 'future', so it's not actually deprecated. Everyone is treating it as deprecated. While DDMD does currently use it extensively, it can be replaced if necessary. I'd much rather see it reinstated along with proper escape checking.

Re: RFC: std.json sucessor

2014-08-22 Thread Jacob Carlborg via Digitalmars-d
On 2014-08-22 00:35, Sönke Ludwig wrote: Following up on the recent std.jgrandson thread [1], I've picked up the work (a lot earlier than anticipated) and finished a first version of a loose blend of said std.jgrandson, vibe.data.json and some changes that I had planned for vibe.data.json for a

Re: scope classes mentioned in tutorials, but deprecated

2014-08-22 Thread Gary Willoughby via Digitalmars-d
On Thursday, 21 August 2014 at 18:07:31 UTC, Brad Anderson wrote: On Thursday, 21 August 2014 at 17:55:19 UTC, Timothee Cour via Digitalmars-d wrote: http://dlang.org/cpptod.html#raii mentions scope class and scope variables, which seem deprecated (http://dlang.org/deprecate.html)

Re: RFC: std.json sucessor

2014-08-22 Thread via Digitalmars-d
On Friday, 22 August 2014 at 15:47:51 UTC, Jacob Carlborg wrote: * I think we have talked about this before, when reviewing D lexers. I'm thinking of how to handle invalid data. Is it the best solution to throw an exception? Would it be possible to return an error token and have the client

Re: RFC: std.json sucessor

2014-08-22 Thread Sönke Ludwig via Digitalmars-d
Am 22.08.2014 17:47, schrieb Jacob Carlborg: On 2014-08-22 00:35, Sönke Ludwig wrote: Following up on the recent std.jgrandson thread [1], I've picked up the work (a lot earlier than anticipated) and finished a first version of a loose blend of said std.jgrandson, vibe.data.json and some

Re: RFC: std.json sucessor

2014-08-22 Thread Sönke Ludwig via Digitalmars-d
Am 22.08.2014 16:53, schrieb Ary Borenszweig: On 8/22/14, 3:33 AM, Sönke Ludwig wrote: Without a serialization framework it would in theory work like this: JSONValue v = parseJSON(`{age: 10, name: John}`); auto p = new Person(v[name].get!string, v[age].get!int); unfortunately the

Re: RFC: std.json sucessor

2014-08-22 Thread via Digitalmars-d
Some thoughts about the API: 1) Instead of `parseJSONValue` and `lexJSON`, how about static methods `JSON.parse` and `JSON.lex`, or even a module level functions `std.data.json.parse` etc.? The JSON part of the name is redundant. 2) Also, `parseJSONValue` and `parseJSONStream` probably

Re: C++'s std::rotate

2014-08-22 Thread monarch_dodra via Digitalmars-d
On Monday, 11 August 2014 at 14:45:09 UTC, Andrei Alexandrescu wrote: On 8/11/14, 2:11 AM, Nordlöw wrote: On Monday, 11 August 2014 at 06:56:52 UTC, Dragos Carp wrote: bool sliceOf(T)(in T[] whole, in T[] slice) { return whole.ptr = slice.ptr whole.ptr + slice.length = whole.ptr +

Re: RFC: std.json sucessor

2014-08-22 Thread Christian Manning via Digitalmars-d
It would be nice to have integers treated separately to doubles. I know it makes the number parsing simpler to just treat everything as double, but still, it could be annoying when you expect an integer type. I'd also like to see some benchmarks, particularly against some of the high

Re: RFC: std.json sucessor

2014-08-22 Thread Sönke Ludwig via Digitalmars-d
Am 22.08.2014 18:15, schrieb Marc Schütz schue...@gmx.net: Some thoughts about the API: 1) Instead of `parseJSONValue` and `lexJSON`, how about static methods `JSON.parse` and `JSON.lex`, or even a module level functions `std.data.json.parse` etc.? The JSON part of the name is redundant. For

Re: RFC: std.json sucessor

2014-08-22 Thread Sönke Ludwig via Digitalmars-d
Am 22.08.2014 18:31, schrieb Christian Manning: It would be nice to have integers treated separately to doubles. I know it makes the number parsing simpler to just treat everything as double, but still, it could be annoying when you expect an integer type. That's how I've done it for

Re: Some template code that worked in 2.065 is not working in 2.066

2014-08-22 Thread Vladimir Panteleev via Digitalmars-d
On Friday, 22 August 2014 at 08:47:23 UTC, Uranuz wrote: In my project I have sort of complicated logic to implement data structure that is somehow similar to std.typecons.Tuple. I can't reproduce it, because I can't locate the source of bug. You could try using DustMite:

Re: RFC: std.json sucessor

2014-08-22 Thread Ary Borenszweig via Digitalmars-d
On 8/22/14, 1:24 PM, Sönke Ludwig wrote: Am 22.08.2014 16:53, schrieb Ary Borenszweig: On 8/22/14, 3:33 AM, Sönke Ludwig wrote: Without a serialization framework it would in theory work like this: JSONValue v = parseJSON(`{age: 10, name: John}`); auto p = new

Re: RFC: std.json sucessor

2014-08-22 Thread via Digitalmars-d
On Friday, 22 August 2014 at 16:48:44 UTC, Sönke Ludwig wrote: Am 22.08.2014 18:15, schrieb Marc Schütz schue...@gmx.net: Some thoughts about the API: 1) Instead of `parseJSONValue` and `lexJSON`, how about static methods `JSON.parse` and `JSON.lex`, or even a module level functions

Re: RFC: std.json sucessor

2014-08-22 Thread via Digitalmars-d
On Friday, 22 August 2014 at 16:56:26 UTC, Sönke Ludwig wrote: Am 22.08.2014 18:31, schrieb Christian Manning: It would be nice to have integers treated separately to doubles. I know it makes the number parsing simpler to just treat everything as double, but still, it could be annoying when

Re: RFC: std.json sucessor

2014-08-22 Thread Sönke Ludwig via Digitalmars-d
Am 22.08.2014 19:24, schrieb Marc Schütz schue...@gmx.net: On Friday, 22 August 2014 at 16:48:44 UTC, Sönke Ludwig wrote: Actually they take exactly the same parameters and just differ in their return value. It would be more descriptive to name them parseAsJSONValue and parseAsJSONStream - or

Re: RFC: std.json sucessor

2014-08-22 Thread Sönke Ludwig via Digitalmars-d
Am 22.08.2014 19:27, schrieb Marc Schütz schue...@gmx.net: On Friday, 22 August 2014 at 16:56:26 UTC, Sönke Ludwig wrote: Am 22.08.2014 18:31, schrieb Christian Manning: It would be nice to have integers treated separately to doubles. I know it makes the number parsing simpler to just treat

Yet another victory for D

2014-08-22 Thread H. S. Teoh via Digitalmars-d
A friend of mine stumbled across this today: http://tomerfiliba.com/blog/dlang/ Rejoice! :-) T -- Why waste time reinventing the wheel, when you could be reinventing the engine? -- Damian Conway

Re: Yet another victory for D

2014-08-22 Thread Brad Anderson via Digitalmars-d
On Friday, 22 August 2014 at 17:54:36 UTC, H. S. Teoh via Digitalmars-d wrote: A friend of mine stumbled across this today: http://tomerfiliba.com/blog/dlang/ Rejoice! :-) T There's a fairly active conversation going on about this article on Hacker News currently.

Re: RFC: std.json sucessor

2014-08-22 Thread via Digitalmars-d
On Friday, 22 August 2014 at 17:35:20 UTC, Sönke Ludwig wrote: ... why not use exactly the same convention then? = `parse!JSONValue` Would be nice to have a pluggable API where you just need to specify the type in a factory method to choose the input format. Then there could be

Re: Yet another victory for D

2014-08-22 Thread Dicebot via Digitalmars-d
On Friday, 22 August 2014 at 17:54:36 UTC, H. S. Teoh via Digitalmars-d wrote: A friend of mine stumbled across this today: http://tomerfiliba.com/blog/dlang/ Rejoice! :-) T http://forum.dlang.org/post/qycdbardacyhvabyq...@forum.dlang.org

Re: RFC: std.json sucessor

2014-08-22 Thread via Digitalmars-d
On Friday, 22 August 2014 at 17:45:03 UTC, Sönke Ludwig wrote: Am 22.08.2014 19:27, schrieb Marc Schütz schue...@gmx.net: On Friday, 22 August 2014 at 16:56:26 UTC, Sönke Ludwig wrote: Am 22.08.2014 18:31, schrieb Christian Manning: It would be nice to have integers treated separately to

Re: Yet another victory for D

2014-08-22 Thread Adam D. Ruppe via Digitalmars-d
I got this FB chatted to me from an old programmer friend too yesterday who has never used D himself but knows I do. It seems to be getting somewhat broad exposure.

Re: RFC: std.json sucessor

2014-08-22 Thread Walter Bright via Digitalmars-d
On 8/21/2014 3:35 PM, Sönke Ludwig wrote: Destroy away! ;) Thanks for taking this on! This is valuable work. On to destruction! I'm looking at: http://s-ludwig.github.io/std_data_json/stdx/data/json/lexer/lexJSON.html I anticipate this will be used a LOT and in very high speed demanding

Re: RFC: std.json sucessor

2014-08-22 Thread Sönke Ludwig via Digitalmars-d
Am 22.08.2014 19:57, schrieb Marc Schütz schue...@gmx.net: On Friday, 22 August 2014 at 17:35:20 UTC, Sönke Ludwig wrote: ... why not use exactly the same convention then? = `parse!JSONValue` Would be nice to have a pluggable API where you just need to specify the type in a factory method to

Re: Yet another victory for D

2014-08-22 Thread H. S. Teoh via Digitalmars-d
On Fri, Aug 22, 2014 at 05:55:03PM +, Dicebot via Digitalmars-d wrote: [...] http://forum.dlang.org/post/qycdbardacyhvabyq...@forum.dlang.org On Fri, Aug 22, 2014 at 05:56:12PM +, Brad Anderson via Digitalmars-d wrote: [...] There's a fairly active conversation going on about this

Re: Yet another victory for D

2014-08-22 Thread H. S. Teoh via Digitalmars-d
On Fri, Aug 22, 2014 at 06:05:03PM +, Adam D. Ruppe via Digitalmars-d wrote: I got this FB chatted to me from an old programmer friend too yesterday who has never used D himself but knows I do. It seems to be getting somewhat broad exposure. Ah, that would explain why this particular

Re: RFC: std.json sucessor

2014-08-22 Thread Sönke Ludwig via Digitalmars-d
Am 22.08.2014 20:01, schrieb Marc Schütz schue...@gmx.net: On Friday, 22 August 2014 at 17:45:03 UTC, Sönke Ludwig wrote: Am 22.08.2014 19:27, schrieb Marc Schütz schue...@gmx.net: On Friday, 22 August 2014 at 16:56:26 UTC, Sönke Ludwig wrote: Am 22.08.2014 18:31, schrieb Christian Manning:

Re: const after initialization / pointers, references and values

2014-08-22 Thread Vicente via Digitalmars-d
First of all thanks for your replies, they are useful. @Philippe: A pure function is ok for initializing default_nodes but not for nodes because a pure function can't read a file. The static this has the problem it needs know the initializer at compile time but I wanted to choose the

Re: RFC: std.json sucessor

2014-08-22 Thread via Digitalmars-d
On Friday, 22 August 2014 at 18:08:34 UTC, Sönke Ludwig wrote: Am 22.08.2014 19:57, schrieb Marc Schütz schue...@gmx.net: The easiest and cleanest way would be to add a function in std.data.json: auto parse(Target, Source)(Source input) if(is(Target == JSONValue)) {

Unused variables and bugs

2014-08-22 Thread bearophile via Digitalmars-d
Apparently there is evidence that unused variables in C-like languages correlate with bugs: https://kev.inburke.com/slides/errors/#error-correlations One problem with ruling out some classes of unused variables (like unused function arguments, unused private module-level variables, unused

Re: RFC: std.json sucessor

2014-08-22 Thread Andrej Mitrovic via Digitalmars-d
On 8/22/14, Sönke Ludwig digitalmars-d@puremagic.com wrote: Docs: http://s-ludwig.github.io/std_data_json/ This confused me for a solid minute: // Lex a JSON string into a lazy range of tokens auto tokens = lexJSON(`{name: Peter, age: 42}`); with (JSONToken.Kind) { assert(tokens.map!(t =

Re: Windows service in D

2014-08-22 Thread Tyler Jensen via Digitalmars-d
Ten years is a long time but perhaps this can help anyone running into this forum thread. https://github.com/duovia/WindowsServiceInD I'm using the Windows API library (source actually) on dsource.org. See link on the github page. I found it difficult to find a complete solution to the

Re: RFC: std.json sucessor

2014-08-22 Thread Sönke Ludwig via Digitalmars-d
Am 22.08.2014 21:15, schrieb Andrej Mitrovic via Digitalmars-d: On 8/22/14, Sönke Ludwig digitalmars-d@puremagic.com wrote: Docs: http://s-ludwig.github.io/std_data_json/ This confused me for a solid minute: // Lex a JSON string into a lazy range of tokens auto tokens = lexJSON(`{name:

Re: $100 bounty for help with Windows Service code

2014-08-22 Thread Tyler Jensen via Digitalmars-d
On Friday, 22 August 2014 at 09:09:22 UTC, Kagamin wrote: https://github.com/duovia/WindowsServiceInD/blob/master/src/onedge/mysvc.d#L20 these are not necessarily static: it makes sense to have instance fields of shared types too. Yes, Kagamin, you're right. I'll pull those out of shared as

Re: RFC: std.json sucessor

2014-08-22 Thread Christian Manning via Digitalmars-d
On Friday, 22 August 2014 at 17:45:03 UTC, Sönke Ludwig wrote: Am 22.08.2014 19:27, schrieb Marc Schütz schue...@gmx.net: On Friday, 22 August 2014 at 16:56:26 UTC, Sönke Ludwig wrote: Am 22.08.2014 18:31, schrieb Christian Manning: It would be nice to have integers treated separately to

Re: RFC: std.json sucessor

2014-08-22 Thread Sönke Ludwig via Digitalmars-d
Am 22.08.2014 21:48, schrieb Christian Manning: On Friday, 22 August 2014 at 17:45:03 UTC, Sönke Ludwig wrote: Am 22.08.2014 19:27, schrieb Marc Schütz schue...@gmx.net: On Friday, 22 August 2014 at 16:56:26 UTC, Sönke Ludwig wrote: Am 22.08.2014 18:31, schrieb Christian Manning: It would be

Re: const after initialization / pointers, references and values

2014-08-22 Thread Vicente via Digitalmars-d
Indeed the ref can be applied to the return type: http://dlang.org/function.html#ref-functions So, does the following code copy any data from nodes? If that is the case this solution avoids the class storage, avoids pointers and nodes is encapsulated as read-only, that's great. The program I'm

Re: const after initialization / pointers, references and values

2014-08-22 Thread Wyatt via Digitalmars-d
On Friday, 22 August 2014 at 18:21:06 UTC, Vicente wrote: @Wyatt: Certainly ref parameters help a lot, but I'm trying to get a Node by returning (a reference to) it. Does the ref keyword apply to the return type? I poked it a bit and came out with this. I _think_ it's working as expected:

Re: RFC: std.json sucessor

2014-08-22 Thread John Colvin via Digitalmars-d
On Friday, 22 August 2014 at 20:02:41 UTC, Sönke Ludwig wrote: Am 22.08.2014 21:48, schrieb Christian Manning: On Friday, 22 August 2014 at 17:45:03 UTC, Sönke Ludwig wrote: Am 22.08.2014 19:27, schrieb Marc Schütz schue...@gmx.net: On Friday, 22 August 2014 at 16:56:26 UTC, Sönke Ludwig

Re: Unused variables and bugs

2014-08-22 Thread Brian Schott via Digitalmars-d
On Friday, 22 August 2014 at 19:07:24 UTC, bearophile wrote: Another solution is to leave such tests out of the core compiler, and put them in a lint tool that you run when you think your code is in good shape. https://github.com/Hackerpilot/Dscanner The unused variable and unused parameter

Re: RFC: std.json sucessor

2014-08-22 Thread Christian Manning via Digitalmars-d
Yes, no decimal point + no exponent would work without overhead to detect integers, but that wouldn't solve the proposed automatic long-double overflow, which is what I meant. My current idea is to default to double and optionally support any of long, BigInt and Decimal (BigInt+exponent),

Re: const after initialization / pointers, references and values

2014-08-22 Thread Vicente via Digitalmars-d
On Friday, 22 August 2014 at 20:12:39 UTC, Wyatt wrote: I poked it a bit and came out with this. I _think_ it's working as expected: ... auto ref opSlice(){return nodes[];}; ... -Wyatt Assuming it's working as expected, that is exactly what I was looking for! But the following

Re: Unused variables and bugs

2014-08-22 Thread bearophile via Digitalmars-d
Brian Schott: The unused variable and unused parameter checks have existed since May. As far as I know it only gives false positives if mixin statements are present. Another interesting feature is similar to -Wsuggest-final-types and -Wsuggest-final-methods. They give warnings when there is

Re: RFC: std.json sucessor

2014-08-22 Thread Sönke Ludwig via Digitalmars-d
Am 22.08.2014 20:08, schrieb Walter Bright: On 8/21/2014 3:35 PM, Sönke Ludwig wrote: Destroy away! ;) Thanks for taking this on! This is valuable work. On to destruction! I'm looking at: http://s-ludwig.github.io/std_data_json/stdx/data/json/lexer/lexJSON.html I anticipate this will be

Re: RFC: std.json sucessor

2014-08-22 Thread Sönke Ludwig via Digitalmars-d
Am 22.08.2014 18:13, schrieb Sönke Ludwig: Am 22.08.2014 17:47, schrieb Jacob Carlborg: * Opening braces should be put on their own line to follow Phobos style guides Will do. * I'm wondering about the assert in lexer.d, line 160. What happens if two invalid tokens after each other occur?

Re: Unused variables and bugs

2014-08-22 Thread Timon Gehr via Digitalmars-d
On 08/22/2014 09:07 PM, bearophile wrote: Apparently there is evidence that unused variables in C-like languages correlate with bugs: https://kev.inburke.com/slides/errors/#error-correlations ... http://xkcd.com/552/

  1   2   3   >