Re: Walter's Guide to Translating Code From One Language to Another

2018-09-21 Thread Peter Alexander via Digitalmars-d
On Friday, 21 September 2018 at 06:00:33 UTC, Walter Bright wrote: I've learned this the hard way, and I've had to learn it several times because I am a slow learner. I've posted this before, and repeat it because bears repeating. I find this is a great procedure for any sort of large

Re: Jai compiles 80,000 lines of code in under a second

2018-09-21 Thread mate via Digitalmars-d
On Friday, 21 September 2018 at 06:34:47 UTC, Vladimir Panteleev wrote: The problem with putting it in the compiler is that it invalidates many contracts (and, thus, use cases) about what invoking the compiler can do. This means you can't bisect or reduce (as with Dustmite) the source code

Re: Mobile is the new PC and AArch64 is the new x64

2018-09-21 Thread Laurent Tréguier via Digitalmars-d
On Friday, 21 September 2018 at 00:55:25 UTC, RhyS wrote: The PC market will change but dying is a big word. So I'm stuck between "smartphones overtaking PC's" which I've been told has already happened, and "PC's dying" which apparently has too strong of a meaning... PC sales have dropped

Re: phobo's std.file is completely broke!

2018-09-21 Thread Ecstatic Coder via Digitalmars-d
On Thursday, 20 September 2018 at 19:49:01 UTC, Nick Sabalausky (Abscissa) wrote: On 09/19/2018 11:45 PM, Vladimir Panteleev wrote: On Thursday, 20 September 2018 at 03:23:36 UTC, Nick Sabalausky (Abscissa) wrote: (Not on a Win box at the moment.) I added the output of my test program to the

Re: Jai compiles 80,000 lines of code in under a second

2018-09-21 Thread mate via Digitalmars-d
On Friday, 21 September 2018 at 07:37:14 UTC, Walter Bright wrote: On 9/21/2018 12:19 AM, mate wrote: It depends on the developer not doing anything stupid Aye, there's the rub! ;-) Different sensibilities on where to put restrictions clearly lead to different designs. I am not sure myself

Re: Jai compiles 80,000 lines of code in under a second

2018-09-21 Thread mate via Digitalmars-d
On Friday, 21 September 2018 at 07:19:41 UTC, mate wrote: Reproducible builds are out too, as the produced object file is no longer purely a function of the source code and compiler version. It depends on the developer not doing anything stupid in the build instructions, be it

Re: Jai compiles 80,000 lines of code in under a second

2018-09-21 Thread mate via Digitalmars-d
On Friday, 21 September 2018 at 05:39:35 UTC, Vladimir Panteleev wrote: On Friday, 21 September 2018 at 05:11:32 UTC, mate wrote: Note that the build can be done at compile time because the metaprogramming capabilities of the language are not limited in terms of system calls. Good luck

Walter's Guide to Translating Code From One Language to Another

2018-09-21 Thread Walter Bright via Digitalmars-d
I've learned this the hard way, and I've had to learn it several times because I am a slow learner. I've posted this before, and repeat it because bears repeating. The procedure is: 1. pass the test suite 2. prep the file for conversion, i.e. try to minimize the use of idioms that won't

Re: Jai compiles 80,000 lines of code in under a second

2018-09-21 Thread Vladimir Panteleev via Digitalmars-d
On Friday, 21 September 2018 at 06:30:40 UTC, Walter Bright wrote: On 9/20/2018 10:11 PM, mate wrote: Note that the build can be done at compile time because the metaprogramming capabilities of the language are not limited in terms of system calls. Back in the naive olden days, Microsoft

Re: Jai compiles 80,000 lines of code in under a second

2018-09-21 Thread Walter Bright via Digitalmars-d
On 9/20/2018 10:11 PM, mate wrote: Note that the build can be done at compile time because the metaprogramming capabilities of the language are not limited in terms of system calls. Back in the naive olden days, Microsoft released ActiveX, where a web page could load executable objects (!)

Re: Jai compiles 80,000 lines of code in under a second

2018-09-21 Thread Guillaume Piolat via Digitalmars-d
On Friday, 21 September 2018 at 06:02:26 UTC, mate wrote: I am actually not sure if there really are no limitations to Jai’s CTFE, in its current state. What I like with unrestricted CTFE is that it makes something that was completely safe a security problem.

Re: Jai compiles 80,000 lines of code in under a second

2018-09-21 Thread Walter Bright via Digitalmars-d
On 9/21/2018 12:19 AM, mate wrote: It depends on the developer not doing anything stupid Aye, there's the rub!

Re: Jai compiles 80,000 lines of code in under a second

2018-09-21 Thread Guillaume Piolat via Digitalmars-d
On Thursday, 20 September 2018 at 23:13:38 UTC, aliak wrote: you can create your build recipe inside the program But this is not a particularly good idea and is even against the times. Everyone is moving from powerful languages like makefiles to _less_ powerful languages (like dub.json) to

Re: std.process.execute without capturing stderr?

2018-09-21 Thread berni via Digitalmars-d-learn
On Thursday, 20 September 2018 at 14:10:44 UTC, Steven Schveighoffer wrote: Hm... 2.079.0 had it: Sorry, I made a mistake while testing and after I found out, that it was not available in the documentation at dpldocs.info I concluded, that it must be a really new feature. But now it seems

Re: Simple parallel foreach and summation/reduction

2018-09-21 Thread Chris Katko via Digitalmars-d-learn
On Thursday, 20 September 2018 at 05:51:17 UTC, Neia Neutuladh wrote: On Thursday, 20 September 2018 at 05:34:42 UTC, Chris Katko wrote: All I want to do is loop from 0 to [constant] with a for or foreach, and have it split up across however many cores I have. You're looking at

Re: Copy Constructor DIP and implementation

2018-09-21 Thread rmc via Digitalmars-d-announce
On Wednesday, 19 September 2018 at 00:05:15 UTC, Jonathan M Davis wrote: On Tuesday, September 18, 2018 10:58:39 AM MDT aliak via Digitalmars-d- announce wrote: This will break compilation of current code that has an explicit copy constructor, and the fix is simply to add the attribute

Re: Simple parallel foreach and summation/reduction

2018-09-21 Thread Dennis via Digitalmars-d-learn
On Friday, 21 September 2018 at 07:25:17 UTC, Chris Katko wrote: I get "Error: template instance `reduce!((a, b) => a + b)` cannot use local __lambda1 as parameter to non-global template reduce(functions...)" when trying to compile that using the online D editor with DMD and LDC. Any ideas?

[Issue 19255] ldmd2.exe not found - must be in PATH?

2018-09-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19255 Rainer Schuetze changed: What|Removed |Added CC||r.sagita...@gmx.de --- Comment #1 from

Re: Truly @nogc Exceptions?

2018-09-21 Thread Nemanja Boric via Digitalmars-d
On Friday, 21 September 2018 at 09:10:06 UTC, Jonathan M Davis wrote: [...] I think that the message member was added by Dicebot as an attempt to fix this issue, because Sociomantic needed it, but I don't know exactly what's going on with that or @__future. - Jonathan M Davis The @__future

[Issue 11044] Escaping references to lazy argument are allowed and compile to wrong code

2018-09-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11044 Vladimir Panteleev changed: What|Removed |Added Keywords||wrong-code Summary|Escaping

Re: Truly @nogc Exceptions?

2018-09-21 Thread Jonathan M Davis via Digitalmars-d
On Wednesday, September 19, 2018 3:16:00 PM MDT Steven Schveighoffer via Digitalmars-d wrote: > Given dip1008, we now can throw exceptions inside @nogc code! This is > really cool, and helps make code that uses exceptions or errors @nogc. > Except... I pointed out this problem when the DIP was

[Issue 19256] std.json: JSONValue allows violating constness

2018-09-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19256 --- Comment #1 from FeepingCreature --- See also bug 12885. https://issues.dlang.org/show_bug.cgi?id=12885 This bug is still relevant, as it happens in @safe code, not just @system - std.json violates @trusted by allowing bad things to happen. --

Re: Jai compiles 80,000 lines of code in under a second

2018-09-21 Thread Petar via Digitalmars-d
On Thursday, 20 September 2018 at 23:13:38 UTC, aliak wrote: Alo! I have been watching Jonathan Blow's Jai for a while myself. There are many interesting ideas there, and many of them are what made me like D so much in the first place. It's very important to note that the speed claims he

Re: Walter's Guide to Translating Code From One Language to Another

2018-09-21 Thread rjframe via Digitalmars-d
On Thu, 20 Sep 2018 23:00:33 -0700, Walter Bright wrote: > The procedure is: > ... > 4. translate the code with as few edits as practical. Do not > reformat the code. Do not refactor it. Do not fix anything, no matter > how tempting. Reproduce the behavior of the original as much as > possible.

[Issue 19256] New: std.json: JSONValue allows violating constness

2018-09-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19256 Issue ID: 19256 Summary: std.json: JSONValue allows violating constness Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: enhancement

[Issue 19257] New: std.array.join does not handle const fields that cannot be converted to mutable

2018-09-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19257 Issue ID: 19257 Summary: std.array.join does not handle const fields that cannot be converted to mutable Product: D Version: D2 Hardware: x86_64 OS: Linux

[Issue 19257] std.array.join does not handle const fields that cannot be converted to mutable

2018-09-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19257 --- Comment #1 from FeepingCreature --- See https://github.com/dlang/phobos/pull/6711 --

Re: Jai compiles 80,000 lines of code in under a second

2018-09-21 Thread Vladimir Panteleev via Digitalmars-d
On Friday, 21 September 2018 at 07:58:16 UTC, mate wrote: Different sensibilities on where to put restrictions clearly lead to different designs. I am not sure myself what is best. The more people you have on your team, the more you appreciate the restrictions. If you are working on a

Re: Truly @nogc Exceptions?

2018-09-21 Thread Petar via Digitalmars-d
On Friday, 21 September 2018 at 11:48:50 UTC, Nemanja Boric wrote: On Friday, 21 September 2018 at 10:06:06 UTC, Nemanja Boric wrote: On Friday, 21 September 2018 at 09:10:06 UTC, Jonathan M Davis wrote: [...] The @__future is fully (to a reasonable degree) implemented - and the

Re: Simple parallel foreach and summation/reduction

2018-09-21 Thread Ali Çehreli via Digitalmars-d-learn
On 09/21/2018 12:25 AM, Chris Katko wrote: On Thursday, 20 September 2018 at 05:51:17 UTC, Neia Neutuladh wrote: On Thursday, 20 September 2018 at 05:34:42 UTC, Chris Katko wrote: All I want to do is loop from 0 to [constant] with a for or foreach, and have it split up across however many

Re: Truly @nogc Exceptions?

2018-09-21 Thread Nemanja Boric via Digitalmars-d
On Friday, 21 September 2018 at 10:06:06 UTC, Nemanja Boric wrote: On Friday, 21 September 2018 at 09:10:06 UTC, Jonathan M Davis wrote: [...] The @__future is fully (to a reasonable degree) implemented - and the `Throwable.message` was marked with this attribute to prevent breaking the

Converting a character to upper case in string

2018-09-21 Thread NX via Digitalmars-d-learn
How can I properly convert a character, say, first one to upper case in a unicode correct manner? In which code level I should be working on? Grapheme? Or maybe code point is sufficient? There are few phobos functions like asCapitalized() none of which are what I want.

Re: Converting a character to upper case in string

2018-09-21 Thread Laurent Tréguier via Digitalmars-d-learn
On Friday, 21 September 2018 at 12:15:52 UTC, NX wrote: How can I properly convert a character, say, first one to upper case in a unicode correct manner? In which code level I should be working on? Grapheme? Or maybe code point is sufficient? There are few phobos functions like

Re: Converting a character to upper case in string

2018-09-21 Thread Laurent Tréguier via Digitalmars-d-learn
On Friday, 21 September 2018 at 12:15:52 UTC, NX wrote: How can I properly convert a character, say, first one to upper case in a unicode correct manner? In which code level I should be working on? Grapheme? Or maybe code point is sufficient? There are few phobos functions like

[Issue 19256] std.json: JSONValue allows violating constness

2018-09-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19256 FeepingCreature changed: What|Removed |Added Severity|enhancement |normal --

[Issue 12885] const union wrongly converts implicitly to mutable

2018-09-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12885 FeepingCreature changed: What|Removed |Added CC||default_357-l...@yahoo.de

Re: Jai compiles 80,000 lines of code in under a second

2018-09-21 Thread Steven Schveighoffer via Digitalmars-d
On 9/21/18 10:19 AM, Nicholas Wilson wrote: On Friday, 21 September 2018 at 09:21:34 UTC, Petar Kirov [ZombineDev] wrote: I have been watching Jonathan Blow's Jai for a while myself. There are many interesting ideas there, and many of them are what made me like D so much in the first place.

Re: Converting a character to upper case in string

2018-09-21 Thread Laurent Tréguier via Digitalmars-d-learn
On Friday, 21 September 2018 at 13:32:54 UTC, NX wrote: On Friday, 21 September 2018 at 12:34:12 UTC, Laurent Tréguier wrote: I would probably go for std.utf.decode [1] to get the character and its length in code units, capitalize it, and concatenate the result with the rest of the string.

Re: Jai compiles 80,000 lines of code in under a second

2018-09-21 Thread H. S. Teoh via Digitalmars-d
On Fri, Sep 21, 2018 at 10:53:39AM +, Vladimir Panteleev via Digitalmars-d wrote: > On Friday, 21 September 2018 at 07:58:16 UTC, mate wrote: > > Different sensibilities on where to put restrictions clearly lead to > > different designs. I am not sure myself what is best. > > The more people

Re: Jai compiles 80,000 lines of code in under a second

2018-09-21 Thread Neia Neutuladh via Digitalmars-d
On Friday, 21 September 2018 at 13:28:47 UTC, aliak wrote: Sure, all true, but from what I've seen of Jai, it's not a simple language, and it does a decent amount of compile time stuff, but who knows, maybe the code is simple indeed. I remember a demo where he ran a game at compile time and

Re: Jai compiles 80,000 lines of code in under a second

2018-09-21 Thread H. S. Teoh via Digitalmars-d
On Fri, Sep 21, 2018 at 07:58:56AM +, mate via Digitalmars-d wrote: [...] > I realize that with build instructions written in unrestricted > language it is easier to create a dependency on something else than > the compiler, such as the OS. Maybe they plan to solve this problem > with

Re: Jai compiles 80,000 lines of code in under a second

2018-09-21 Thread aliak via Digitalmars-d
On Friday, 21 September 2018 at 01:04:51 UTC, Joakim wrote: On Friday, 21 September 2018 at 00:47:27 UTC, Adam D. Ruppe wrote: Of course, D can also take ages to compile one line of code. It all depends on that that line is doing... ctfe and templates are slow. C or Java style code compiling

Re: Jai compiles 80,000 lines of code in under a second

2018-09-21 Thread aliak via Digitalmars-d
On Friday, 21 September 2018 at 05:39:35 UTC, Vladimir Panteleev wrote: On Friday, 21 September 2018 at 05:11:32 UTC, mate wrote: Note that the build can be done at compile time because the metaprogramming capabilities of the language are not limited in terms of system calls. Good luck

Re: Converting a character to upper case in string

2018-09-21 Thread NX via Digitalmars-d-learn
On Friday, 21 September 2018 at 12:34:12 UTC, Laurent Tréguier wrote: I would probably go for std.utf.decode [1] to get the character and its length in code units, capitalize it, and concatenate the result with the rest of the string. [1] https://dlang.org/phobos/std_utf.html#.decode So by

Re: Jai compiles 80,000 lines of code in under a second

2018-09-21 Thread aliak via Digitalmars-d
On Friday, 21 September 2018 at 09:21:34 UTC, Petar Kirov [ZombineDev] wrote: On Thursday, 20 September 2018 at 23:13:38 UTC, aliak wrote: Alo! I have been watching Jonathan Blow's Jai for a while myself. There are many interesting ideas there, and many of them are what made me like D so

Re: Jai compiles 80,000 lines of code in under a second

2018-09-21 Thread Nicholas Wilson via Digitalmars-d
On Friday, 21 September 2018 at 09:21:34 UTC, Petar Kirov [ZombineDev] wrote: I have been watching Jonathan Blow's Jai for a while myself. There are many interesting ideas there, and many of them are what made me like D so much in the first place. It's very important to note that the speed

Re: Jai compiles 80,000 lines of code in under a second

2018-09-21 Thread bachmeier via Digitalmars-d
On Friday, 21 September 2018 at 07:37:14 UTC, Walter Bright wrote: On 9/21/2018 12:19 AM, mate wrote: It depends on the developer not doing anything stupid Aye, there's the rub! The evolution of programming language discussions from "sufficiently smart compiler" to "sufficiently smart

Re: Converting a character to upper case in string

2018-09-21 Thread Laurent Tréguier via Digitalmars-d-learn
On Friday, 21 September 2018 at 13:32:54 UTC, NX wrote: On Friday, 21 September 2018 at 12:34:12 UTC, Laurent Tréguier wrote: I would probably go for std.utf.decode [1] to get the character and its length in code units, capitalize it, and concatenate the result with the rest of the string.

Re: std.process.execute without capturing stderr?

2018-09-21 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 21 September 2018 at 06:08:39 UTC, berni wrote: Sorry, I made a mistake while testing and after I found out, that it was not available in the documentation at dpldocs.info I concluded, that it must be a really new feature. But now it seems to me, that dpldocs is outdated a little

Webassembly TodoMVC

2018-09-21 Thread Sebastiaan Koppe via Digitalmars-d-announce
Hey guys, Following the D->emscripten->wasm toolchain from CyberShadow and Ace17 I created a proof of concept framework for creating single page webassembly applications using D's compile time features. This is a proof of concept to find out what is possible. At

Re: Jai compiles 80,000 lines of code in under a second

2018-09-21 Thread Adam D. Ruppe via Digitalmars-d
On Friday, 21 September 2018 at 13:37:58 UTC, aliak wrote: Si si, but i believe the loadExecutableIcon actually calls windows APIs to set an icon on an executable, and they'd probably @system which means I don't think that could be done in D. You don't need an API call to do that. You just

Re: Jai compiles 80,000 lines of code in under a second

2018-09-21 Thread Walter Bright via Digitalmars-d
On 9/21/2018 9:29 AM, welkam wrote: Jai compiler perform parsing and lexing in different thread so its kinda multi threaded. Its possible to do the same with D front end. We can start here but there are plenty of low hanging fruits in compiler you just need to run profiler to find them D was

Re: Rather D1 then D2

2018-09-21 Thread Jonathan M Davis via Digitalmars-d
On Friday, September 21, 2018 2:33:01 PM MDT new via Digitalmars-d wrote: > hi, > is it possible to get a bug fixed x64 compiling D1? > I don't want to start some rant, but i don't like D2. D1 is > compact and not so overloaded with funny attributes. Official support of D1 was dropped nearly 6

[Issue 18851] std.net.curl.post cannot be used with !ubyte

2018-09-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18851 wolframw changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

Re: Updating D beyond Unicode 2.0

2018-09-21 Thread Adam D. Ruppe via Digitalmars-d
On Friday, 21 September 2018 at 20:25:54 UTC, Walter Bright wrote: But identifiers? I haven't seen hardly any use of non-ascii identifiers in C, C++, or D. In fact, I've seen zero use of it outside of test cases. Do you look at Japanese D code much? Or Turkish? Or Chinese? I know there are

Re: Updating D beyond Unicode 2.0

2018-09-21 Thread Seb via Digitalmars-d
On Friday, 21 September 2018 at 23:00:45 UTC, Erik van Velzen wrote: Agreed with Walter. I'm all on board with i18n but I see no need for non-ascii identifiers. Even identifiers with a non-latin origin are usually written in the latin script. As for real-world usage I've seen Cyrillic

Re: Rather D1 then D2

2018-09-21 Thread new via Digitalmars-d
On Friday, 21 September 2018 at 20:44:12 UTC, 0xEAB wrote: On Friday, 21 September 2018 at 20:33:01 UTC, new wrote: D1 is compact and not so overloaded with funny attributes. just don't use all those funky attributes and you're fine :) bs - be serious. i don't wand to use D2, but D1.

Get variables with call stack

2018-09-21 Thread ANtlord via Digitalmars-d-learn
Hello! I need to make a some sort of error report system for an application. I want to catch base Exception class instance and report call stack and with the call stack I want to report all variables with their values. There are a couple of services that make report using call stack and

Re: Updating D beyond Unicode 2.0

2018-09-21 Thread Walter Bright via Digitalmars-d
When I originally started with D, I thought non-ASCII identifiers with Unicode was a good idea. I've since slowly become less and less enthusiastic about it. First off, D source text simply must (and does) fully support Unicode in comments, characters, and string literals. That's not an issue.

Re: Rather D1 then D2

2018-09-21 Thread 0xEAB via Digitalmars-d
On Friday, 21 September 2018 at 20:33:01 UTC, new wrote: D1 is compact and not so overloaded with funny attributes. just don't use all those funky attributes and you're fine :)

Re: This is why I don't use D.

2018-09-21 Thread Neia Neutuladh via Digitalmars-d
On Friday, 21 September 2018 at 20:49:54 UTC, 0xEAB wrote: On Thursday, 20 September 2018 at 17:06:43 UTC, Neia Neutuladh wrote: The tester is now submodule-aware and I removed builds for packages with a `.gitmodules` file. I'm not sure whether this is actually a good idea. There are some

Re: This is why I don't use D.

2018-09-21 Thread 0xEAB via Digitalmars-d
On Thursday, 20 September 2018 at 17:06:43 UTC, Neia Neutuladh wrote: The tester is now submodule-aware and I removed builds for packages with a `.gitmodules` file. I'm not sure whether this is actually a good idea. There are some projects that support both, DUB and submodules+makefile. Those

Re: Jai compiles 80,000 lines of code in under a second

2018-09-21 Thread SashaGreat via Digitalmars-d
On Friday, 21 September 2018 at 18:20:21 UTC, Adam D. Ruppe wrote: You don't need an API call to do that. You just provide the icon in a resource to the linker or a separate resource thing. Some C++ environments do it via pragmas, or you can do it traditionally in a makefile/build command line

Rather D1 then D2

2018-09-21 Thread new via Digitalmars-d
hi, is it possible to get a bug fixed x64 compiling D1? I don't want to start some rant, but i don't like D2. D1 is compact and not so overloaded with funny attributes. thanks

Re: Jai compiles 80,000 lines of code in under a second

2018-09-21 Thread Walter Bright via Digitalmars-d
On 9/21/2018 7:46 AM, Steven Schveighoffer wrote: I can see the marketing now, "D finds infinite loops in compile-time code way faster than Jai!". We need you over in marketing!

Re: Rather D1 then D2

2018-09-21 Thread new via Digitalmars-d
On Friday, 21 September 2018 at 21:07:57 UTC, Jonathan M Davis wrote: On Friday, September 21, 2018 2:33:01 PM MDT new via Digitalmars-d wrote: [...] Official support of D1 was dropped nearly 6 years ago: [...] Thank you for your answer. too bad - have to think about it.

Re: Updating D beyond Unicode 2.0

2018-09-21 Thread Erik van Velzen via Digitalmars-d
Agreed with Walter. I'm all on board with i18n but I see no need for non-ascii identifiers. Even identifiers with a non-latin origin are usually written in the latin script. As for real-world usage I've seen Cyrillic identifiers a few times in PHP.

Re: Updating D beyond Unicode 2.0

2018-09-21 Thread Neia Neutuladh via Digitalmars-d
On Friday, 21 September 2018 at 23:17:42 UTC, Seb wrote: A: Wait. Using emojis as identifiers is not a good idea? B: Yes. A: But the cool kids are doing it: The C11 spec says that emoji should be allowed in identifiers (ISO publication N1570 page 504/522), so it's not just the cool kids.

Re: "Error: function expected before (), not module *module* of type void

2018-09-21 Thread Samir via Digitalmars-d-learn
On Monday, 24 March 2008 at 17:41:11 UTC, Steven Schveighoffer wrote: I know you fixed the problem, but just an FYI, the reason is because when you import rollDice, you bring both rollDice the module and rollDice the function into the global namespace (which confuses the compiler 'cause it

Re: Updating D beyond Unicode 2.0

2018-09-21 Thread rikki cattermole via Digitalmars-d
On 22/09/2018 11:17 AM, Seb wrote: In all seriousness I hate it when someone thought its funny to use the lambda symbol as an identifier and I have to copy that symbol whenever I want to use it because there's no convenient way to type it. (This is already supported in D.) This can be

Re: Updating D beyond Unicode 2.0

2018-09-21 Thread Neia Neutuladh via Digitalmars-d
On Friday, 21 September 2018 at 20:25:54 UTC, Walter Bright wrote: But identifiers? I haven't seen hardly any use of non-ascii identifiers in C, C++, or D. In fact, I've seen zero use of it outside of test cases. I don't see much point in expanding the support of it. If people use such

Re: "Error: function expected before (), not module *module* of type void

2018-09-21 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 22 September 2018 at 01:51:33 UTC, Samir wrote: main.d: import isPrime; void main() { isPrime(x); } You probably shouldn't name a module the same as a member anyway, and it should also have two names, like "module myproject.isprime;" But the fix here is to just use the

Re: "Error: function expected before (), not module *module* of type void

2018-09-21 Thread Samir via Digitalmars-d-learn
On Saturday, 22 September 2018 at 01:58:57 UTC, Adam D. Ruppe wrote: You probably shouldn't name a module the same as a member anyway, and it should also have two names, like "module myproject.isprime;" But the fix here is to just use the full name. import isPrime; void main() {

Re: Updating D beyond Unicode 2.0

2018-09-21 Thread Joakim via Digitalmars-d
On Friday, 21 September 2018 at 20:25:54 UTC, Walter Bright wrote: When I originally started with D, I thought non-ASCII identifiers with Unicode was a good idea. I've since slowly become less and less enthusiastic about it. First off, D source text simply must (and does) fully support

Re: Get variables with call stack

2018-09-21 Thread Vladimir Panteleev via Digitalmars-d-learn
On Friday, 21 September 2018 at 19:08:36 UTC, ANtlord wrote: Hello! I need to make a some sort of error report system for an application. I want to catch base Exception class instance and report call stack and with the call stack I want to report all variables with their values. There are a

Re: Simple parallel foreach and summation/reduction

2018-09-21 Thread Chris Katko via Digitalmars-d-learn
On Saturday, 22 September 2018 at 02:13:58 UTC, Chris Katko wrote: On Friday, 21 September 2018 at 12:15:59 UTC, Ali Çehreli wrote: On 09/21/2018 12:25 AM, Chris Katko wrote: [...] You can use a free-standing function as a workaround, which is included in the following chapter that explains

Re: Rather D1 then D2

2018-09-21 Thread Vladimir Panteleev via Digitalmars-d
On Friday, 21 September 2018 at 21:17:52 UTC, new wrote: Thank you for your answer. too bad - have to think about it. You might be interested in the Volt language, which follows in D1's footsteps: https://github.com/VoltLang/Volta I believe it was created by some D users with the same

Re: Get variables with call stack

2018-09-21 Thread Vladimir Panteleev via Digitalmars-d-learn
On Saturday, 22 September 2018 at 05:43:53 UTC, Vladimir Panteleev wrote: The only way to do that would be using a debugger. The specifics of the solution would thus depend on the platform. On POSIX, it would probably mean getting gdb to print a detailed backtrace for your project. On

Re: Tuple DIP

2018-09-21 Thread 12345swordy via Digitalmars-d
On Wednesday, 19 September 2018 at 21:48:40 UTC, Timon Gehr wrote: On 19.09.2018 23:14, 12345swordy wrote: On Tuesday, 3 July 2018 at 16:11:05 UTC, 12345swordy wrote: On Thursday, 28 June 2018 at 13:24:11 UTC, Timon Gehr wrote: [...] Is there any way we can help on this? *Bump* I want

Re: Get variables with call stack

2018-09-21 Thread Vladimir Panteleev via Digitalmars-d-learn
On Saturday, 22 September 2018 at 05:49:05 UTC, Vladimir Panteleev wrote: In short: there is no easy way, in the general sense. If you can find something that achieves what you need in C++, there's a good chance that it would work to some extent (or could be adapted with reasonable effort)

Re: Simple parallel foreach and summation/reduction

2018-09-21 Thread Chris Katko via Digitalmars-d-learn
On Friday, 21 September 2018 at 12:15:59 UTC, Ali Çehreli wrote: On 09/21/2018 12:25 AM, Chris Katko wrote: On Thursday, 20 September 2018 at 05:51:17 UTC, Neia Neutuladh wrote: On Thursday, 20 September 2018 at 05:34:42 UTC, Chris Katko wrote: All I want to do is loop from 0 to [constant]

[Issue 19258] Cannot @disable ~this()

2018-09-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19258 Илья Ярошенко changed: What|Removed |Added Keywords||C++, rejects-valid --- Comment #1 from Илья

[Issue 19258] New: Cannot @disable ~this()

2018-09-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19258 Issue ID: 19258 Summary: Cannot @disable ~this() Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1

[Issue 19258] Cannot @disable ~this()

2018-09-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19258 --- Comment #2 from Илья Ярошенко --- btw, extern(C++) can be skipped, the issue is valid for extern(D) as well --

Re: Converting a character to upper case in string

2018-09-21 Thread Gary Willoughby via Digitalmars-d-learn
On Friday, 21 September 2018 at 12:15:52 UTC, NX wrote: How can I properly convert a character, say, first one to upper case in a unicode correct manner? In which code level I should be working on? Grapheme? Or maybe code point is sufficient? There are few phobos functions like

Re: Jai compiles 80,000 lines of code in under a second

2018-09-21 Thread welkam via Digitalmars-d
On Thursday, 20 September 2018 at 23:13:38 UTC, aliak wrote: And is there anyway to get even near the performance of Jai when it comes to compilations I watched the same video today. What a coincidence. In Jai example 80 000 lines of "code" include comments and empty lines. Since we know

Updating D beyond Unicode 2.0

2018-09-21 Thread Neia Neutuladh via Digitalmars-d
D's currently accepted identifier characters are based on Unicode 2.0: * ASCII range values are handled specially. * Letters and combining marks from Unicode 2.0 are accepted. * Numbers outside the ASCII range are accepted. * Eight random punctuation marks are accepted. This follows the C99