[Issue 16095] a delegate can mutate immutable data and break shared / non-shared enforcements

2016-08-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16095 Walter Bright changed: What|Removed |Added Keywords||pull

Re: yet another event loop

2016-08-26 Thread Bill Hicks via Digitalmars-d-announce
On Friday, 26 August 2016 at 14:19:55 UTC, Eugene Wissner wrote: On Friday, 26 August 2016 at 10:54:17 UTC, bachmeier wrote: The person you responded to is a troll that has been cluttering the forum. No need to even read what they are posting. Didn't know it, thanks Don't listen to him,

Re: On the future of DIP1000

2016-08-26 Thread Bill Hicks via Digitalmars-d-announce
On Wednesday, 24 August 2016 at 15:30:34 UTC, Martin Nowak wrote: we want memory safe code w/o the GC. -Martin Rust has had that since day one. Funny how not too long ago D core was mocking Rust, but now they're trying to be more like it. I bet in a few years we'll see hygienic macro

How to call a method of class D from function of C++ in DLL?

2016-08-26 Thread MGW via Digitalmars-d-learn
Method which I use now: source D: - extern (C) { int on_metFromD(CEditWin* uk, int aa, int bb) { return (*uk).metFromD(int aa, int bb); } } class CEditWin { . . . // Method for to call int metFromD(int a, int b) { return a + b; } } main() {

Re: Silicon Valley D Meetup August 25, 2016 - Fireside Chat with Andrei Alexandrescu

2016-08-26 Thread Bill Hicks via Digitalmars-d-announce
On Wednesday, 24 August 2016 at 19:17:19 UTC, Ali Çehreli wrote: We will post a Google Hangouts link here at the start at 19:00 (7pm) Pacific time: http://www.meetup.com/D-Lang-Silicon-Valley/events/232970396/ Please try to come in person for free food and maybe a free copy of the book

Re: yet another event loop

2016-08-26 Thread Eugene Wissner via Digitalmars-d-announce
On Friday, 26 August 2016 at 15:02:42 UTC, Jack Stouffer wrote: On Wednesday, 24 August 2016 at 18:03:39 UTC, Eugene Wissner wrote: https://github.com/caraus-ecms/tanya Please make documentation easily available for your library. I wish to use event loops in D, but I have no desire to wade

[Issue 15996] @safe allows escaping of ptrs to variables going out of scope

2016-08-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15996 Walter Bright changed: What|Removed |Added Keywords||pull --

Re: DerelictSDL2 crashes

2016-08-26 Thread lobo via Digitalmars-d
On Friday, 26 August 2016 at 21:26:13 UTC, unDEFER wrote: Hello! I'm trying compile SDL "Hello, World" --- import std.stdio; import derelict.sdl2.sdl; //Screen dimension constants const int SCREEN_WIDTH = 640; const int SCREEN_HEIGHT = 480; int main() { DerelictSDL2.load();

Re: DerelictSDL2 crashes

2016-08-26 Thread Mike Parker via Digitalmars-d
On Friday, 26 August 2016 at 21:26:13 UTC, unDEFER wrote: BUT in gdb it runs successfully and I see red window. What I'm doing wrong? How gdb can make not working code working? I can tell you that your code compiles and runs fine for me on Windows using dub. It's also not so unusual for a

Re: Optimisation possibilities: current, future and enhancements

2016-08-26 Thread Meta via Digitalmars-d
On Friday, 26 August 2016 at 19:51:02 UTC, Patrick Schluter wrote: On Friday, 26 August 2016 at 14:03:13 UTC, Meta wrote: On Friday, 26 August 2016 at 10:51:15 UTC, Johan Engelen wrote: On Thursday, 25 August 2016 at 14:42:28 UTC, Basile B. wrote: I'll add * create temporaries based on the

Re: if-expressions

2016-08-26 Thread Bill Hicks via Digitalmars-d
On Friday, 26 August 2016 at 18:25:00 UTC, Cauterite wrote: Also it doesn't conflict with if-statement syntax, as far as I'm aware. Just a little experiment to learn my way around the parser. Please stop trolling. D syntax is already sterile and verbose enough, we don't need to make it

Re: Judy Arrays

2016-08-26 Thread Alex via Digitalmars-d-learn
On Thursday, 25 August 2016 at 20:43:19 UTC, Illuminati wrote: On Thursday, 25 August 2016 at 20:42:42 UTC, Illuminati wrote: http://judy.sourceforge.net/downloads/10minutes.htm Would be nice to have such an implementation. Supposedly one of the best all around data structures in existence?

Re: Does D have any construct like Python's with keyword?

2016-08-26 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 27 August 2016 at 00:04:47 UTC, pineapple wrote: context(auto file = File("some_file.txt")){ file.write(); } You don't need to do anything special for that in D, structs are destructed automatically. Plain auto file = File("some_file.txt"); file.write(); will

Re: Proper concurrent nearly lock free efficient nogc storage structures?

2016-08-26 Thread Illuminati via Digitalmars-d-learn
On Friday, 26 August 2016 at 23:44:53 UTC, Cauterite wrote: On Friday, 26 August 2016 at 23:38:02 UTC, Illuminati wrote: Does D have any such thing? I'm having to recreate the wheel here and it isn't fun ;/ Getting in the way of real work ;/ @nogc is such a new language feature that you

Re: Entity Component Architecture

2016-08-26 Thread Chris Wright via Digitalmars-d
On Fri, 26 Aug 2016 23:59:05 +, Lurker wrote: > On Friday, 26 August 2016 at 19:55:30 UTC, vladdeSV wrote: >> What I can conclude so far is my approach uses a lot of processing >> power. I did a test where I generated 1 entities and it drained my >> CPU to 50%. >> >> All feedback is

Re: Entity Component Architecture

2016-08-26 Thread Chris Wright via Digitalmars-d
On Fri, 26 Aug 2016 19:30:43 +, vladdeSV wrote: > On Wednesday, 24 August 2016 at 22:26:00 UTC, Chris Wright wrote: >> It's like thirty lines of code and does almost nothing that I need. > I've never done anything similar to this. I do not know what others > might need. > >> Why no

Re: Does D have any construct like Python's with keyword?

2016-08-26 Thread pineapple via Digitalmars-d-learn
I would just love if I could express this as something more like context(auto file = File("some_file.txt")){ file.write(); }

Re: Does D have any construct like Python's with keyword?

2016-08-26 Thread pineapple via Digitalmars-d-learn
On Friday, 26 August 2016 at 23:30:15 UTC, Cauterite wrote: On Friday, 26 August 2016 at 23:28:27 UTC, pineapple wrote: I've grown to very much appreciate how context initialization and teardown can be very conveniently handled using `with` in Python. Is there any clean way to imitate this

Re: Entity Component Architecture

2016-08-26 Thread Lurker via Digitalmars-d
On Friday, 26 August 2016 at 19:55:30 UTC, vladdeSV wrote: What I can conclude so far is my approach uses a lot of processing power. I did a test where I generated 1 entities and it drained my CPU to 50%. All feedback is appreciated. Thank you for your input :)

Re: Allows the use of part of the language keywords?

2016-08-26 Thread Ali Çehreli via Digitalmars-d
On 08/26/2016 11:58 AM, Jonathan M Davis via Digitalmars-d wrote: On Friday, August 26, 2016 17:59:39 Cauterite via Digitalmars-d wrote: On Friday, 26 August 2016 at 14:16:27 UTC, Brian wrote: package application.module.user.model; I get "Error: identifier expected following '.' instead of

Re: D Github contributors - enable 2 factor authentification

2016-08-26 Thread ketmar via Digitalmars-d
employees, lol.

Re: D Github contributors - enable 2 factor authentification

2016-08-26 Thread ketmar via Digitalmars-d
On Friday, 26 August 2016 at 16:54:14 UTC, Jacob Carlborg wrote: How is GitLab any different? at least it's engine is opensourced, and it's employers doesn't make public racists and chauvinist statements.

Re: Proper concurrent nearly lock free efficient nogc storage structures?

2016-08-26 Thread Cauterite via Digitalmars-d-learn
On Friday, 26 August 2016 at 23:38:02 UTC, Illuminati wrote: Does D have any such thing? I'm having to recreate the wheel here and it isn't fun ;/ Getting in the way of real work ;/ @nogc is such a new language feature that you can't expect a lot of support yet from e.g. the standard

Proper concurrent nearly lock free efficient nogc storage structures?

2016-08-26 Thread Illuminati via Digitalmars-d-learn
Does D have any such thing? I'm having to recreate the wheel here and it isn't fun ;/ Getting in the way of real work ;/ Surely you would think that with the power D has such things would exist by now?

Re: Does D have any construct like Python's with keyword?

2016-08-26 Thread Cauterite via Digitalmars-d-learn
On Friday, 26 August 2016 at 23:28:27 UTC, pineapple wrote: I've grown to very much appreciate how context initialization and teardown can be very conveniently handled using `with` in Python. Is there any clean way to imitate this syntax in D? Yep, scope guards. auto p = OpenProcess(...);

Does D have any construct like Python's with keyword?

2016-08-26 Thread pineapple via Digitalmars-d-learn
I've grown to very much appreciate how context initialization and teardown can be very conveniently handled using `with` in Python. Is there any clean way to imitate this syntax in D?

Realtime monitoring of GC

2016-08-26 Thread wobbles via Digitalmars-d
In the Java world, the JVM offers hooks to allow tools to monitor in real time what is happening under the hood of your application. I think this sort of tooling would be very useful in D. Especially in my current Game Dev project (it'd be really nice to see in real time where you're

Re: GC Inspiration

2016-08-26 Thread Cauterite via Digitalmars-d
On Friday, 26 August 2016 at 21:41:04 UTC, Robert M. Münch wrote: I'm just digging into LuaJIT and found this interesting GC concept page: http://wiki.luajit.org/New-Garbage-Collector Not sure if this is widly known but I like it, it shows a lot of different approaches with rational etc.

GC Inspiration

2016-08-26 Thread Robert M. Münch via Digitalmars-d
I'm just digging into LuaJIT and found this interesting GC concept page: http://wiki.luajit.org/New-Garbage-Collector Not sure if this is widly known but I like it, it shows a lot of different approaches with rational etc. Maybe it's of use to some of you thinking about the GC. -- Robert M.

DerelictSDL2 crashes

2016-08-26 Thread unDEFER via Digitalmars-d
Hello! I'm trying compile SDL "Hello, World" --- import std.stdio; import derelict.sdl2.sdl; //Screen dimension constants const int SCREEN_WIDTH = 640; const int SCREEN_HEIGHT = 480; int main() { DerelictSDL2.load(); //The window we'll be rendering to SDL_Window* window =

[Issue 15703] @safe code should not allow certain types of array casts

2016-08-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15703 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/2dcdc9563c286de39bf4eba3083bef77c49f7a5e fix Issue 15703 - @safe code should not allow certain types

Re: Optimisation possibilities: current, future and enhancements

2016-08-26 Thread ag0aep6g via Digitalmars-d
On 08/26/2016 10:48 PM, Patrick Schluter wrote: the function getN() is pure (but not const). How is it not const? It doesn't alter the object. setN is the non-const one.

Re: Optimisation possibilities: current, future and enhancements

2016-08-26 Thread Patrick Schluter via Digitalmars-d
On Friday, 26 August 2016 at 20:35:13 UTC, ag0aep6g wrote: On 08/26/2016 10:09 PM, Patrick Schluter wrote: Yes. The optimisation of removing the second call is only possible if there is no access using the this pointer. The call to setN() (or any member function using the mutable this

Re: Optimisation possibilities: current, future and enhancements

2016-08-26 Thread ag0aep6g via Digitalmars-d
On 08/26/2016 10:09 PM, Patrick Schluter wrote: Yes. The optimisation of removing the second call is only possible if there is no access using the this pointer. The call to setN() (or any member function using the mutable this pointer), will mandate the compiler to call getN() again. If setN

Re: yet another event loop

2016-08-26 Thread Robert M. Münch via Digitalmars-d-announce
On 2016-08-26 19:37:19 +, Eugene Wissner said: Do you mean that the library can have different modules but they should be independent of each other as much as possible (like phobos) or that every part that can be separated belongs to its own repository? I don't see both related. The 1st

Re: Optimisation possibilities: current, future and enhancements

2016-08-26 Thread Patrick Schluter via Digitalmars-d
On Friday, 26 August 2016 at 19:58:47 UTC, ag0aep6g wrote: On 08/26/2016 09:51 PM, Patrick Schluter wrote: On Friday, 26 August 2016 at 14:03:13 UTC, Meta wrote: [...] class Test { int n; void setN(int val) pure { n = val; } int getN() const pure {

Re: Optimisation possibilities: current, future and enhancements

2016-08-26 Thread ag0aep6g via Digitalmars-d
On 08/26/2016 09:51 PM, Patrick Schluter wrote: On Friday, 26 August 2016 at 14:03:13 UTC, Meta wrote: [...] class Test { int n; void setN(int val) pure { n = val; } int getN() const pure { return n; } } getN() is not pure, simple as that (and an

Re: Optimisation possibilities: current, future and enhancements

2016-08-26 Thread Patrick Schluter via Digitalmars-d
On Friday, 26 August 2016 at 17:52:36 UTC, Meta wrote: On Friday, 26 August 2016 at 14:12:24 UTC, Basile B. wrote: That's another story. Of course the optimization pass for this should check that **ALL** the calls to Test in a sub program (or in this scope if you want) are const... Which is

Re: Entity Component Architecture

2016-08-26 Thread vladdeSV via Digitalmars-d
On Friday, 26 August 2016 at 16:34:26 UTC, MrSmith wrote: Your solution is basically OOP with composition used. It is enough for convenience, but not enough for speed. Also memory allocation for each component looks scary. Systems simply iterate over a all entities that have given set of

Re: Optimisation possibilities: current, future and enhancements

2016-08-26 Thread Patrick Schluter via Digitalmars-d
On Friday, 26 August 2016 at 14:03:13 UTC, Meta wrote: On Friday, 26 August 2016 at 10:51:15 UTC, Johan Engelen wrote: On Thursday, 25 August 2016 at 14:42:28 UTC, Basile B. wrote: I'll add * create temporaries based on the const function attribute. Struct method constness (as in your

[Issue 16179] [REG2.072] git HEAD: multiSort no longer callable with delegate with context

2016-08-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16179 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 16179] [REG2.072] git HEAD: multiSort no longer callable with delegate with context

2016-08-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16179 --- Comment #4 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/7f88a93227b5bf417cf57a540db0b004d4788174 Fixed issue 16179 (multiSort no longer callable with

Re: yet another event loop

2016-08-26 Thread Eugene Wissner via Digitalmars-d-announce
On Friday, 26 August 2016 at 10:03:22 UTC, Robert M. Münch wrote: On 2016-08-24 18:03:39 +, Eugene Wissner said: I want it to become not an event loop only but a general purpose library that has an event loop. Hi, well, I would re-think this since the danger is, that everything is so

Re: Entity Component Architecture

2016-08-26 Thread vladdeSV via Digitalmars-d
On Wednesday, 24 August 2016 at 22:26:00 UTC, Chris Wright wrote: It's like thirty lines of code and does almost nothing that I need. I've never done anything similar to this. I do not know what others might need. Why no `getOrAdd`? Entity has getComponent and addComponent which do different

Re: if-expressions

2016-08-26 Thread Cauterite via Digitalmars-d
On Friday, 26 August 2016 at 18:25:00 UTC, Cauterite wrote: // any number of condition/predicate pairs ehem... "any number of predicate:consequent pairs"

Re: Allows the use of part of the language keywords?

2016-08-26 Thread Jonathan M Davis via Digitalmars-d
On Friday, August 26, 2016 17:59:39 Cauterite via Digitalmars-d wrote: > On Friday, 26 August 2016 at 14:16:27 UTC, Brian wrote: > > package application.module.user.model; > > I get "Error: identifier expected following '.' instead of > 'module'" > So I'm not sure how that compiles for you. I

Re: Autotesting dub packages with dmd nightly

2016-08-26 Thread Seb via Digitalmars-d-announce
On Monday, 22 August 2016 at 20:44:05 UTC, Sebastiaan Koppe wrote: On Wednesday, 10 August 2016 at 18:35:03 UTC, Sebastiaan Koppe wrote: So true. Then I will do PR's first. I finally got around implementing running dmd/druntime/phobos pull requests against all dub packages. Thank you digger,

if-expressions

2016-08-26 Thread Cauterite via Digitalmars-d
Here's a little patch you guys might enjoy: https://github.com/dlang/dmd/compare/master...Cauterite:ifExpr0 It enables this syntax: int foo = if(asdf: 5 else 6); equivalent to int foo = asdf ? 5 : 6; Here's some other examples which work: // any number of condition/predicate pairs foo = if(

Re: Allows the use of part of the language keywords?

2016-08-26 Thread Cauterite via Digitalmars-d
On Friday, 26 August 2016 at 14:16:27 UTC, Brian wrote: package application.module.user.model; I get "Error: identifier expected following '.' instead of 'module'" So I'm not sure how that compiles for you.

Re: Optimisation possibilities: current, future and enhancements

2016-08-26 Thread Basile B. via Digitalmars-d
On Friday, 26 August 2016 at 14:12:24 UTC, Basile B. wrote: On Friday, 26 August 2016 at 14:03:13 UTC, Meta wrote: On Friday, 26 August 2016 at 10:51:15 UTC, Johan Engelen wrote: On Thursday, 25 August 2016 at 14:42:28 UTC, Basile B. wrote: I'll add * create temporaries based on the const

Re: Optimisation possibilities: current, future and enhancements

2016-08-26 Thread Meta via Digitalmars-d
On Friday, 26 August 2016 at 14:12:24 UTC, Basile B. wrote: That's another story. Of course the optimization pass for this should check that **ALL** the calls to Test in a sub program (or in this scope if you want) are const... Which is not the case here. My point is that getN is strongly

Re: Minor updates: gen-package-version v1.0.4 and sdlang-d v0.9.6

2016-08-26 Thread MrSmith via Digitalmars-d-announce
On Tuesday, 23 August 2016 at 16:19:12 UTC, Nick Sabalausky wrote: I'm hoping to finally get around to taking care of some of the open enhancement requests for sdlang-d soon. Can you, please, take care of this issue: https://github.com/Abscissa/libInputVisitor/issues/1 ?

Re: C# 7 Features - Tuples

2016-08-26 Thread Cauterite via Digitalmars-d
On Thursday, 25 August 2016 at 14:43:35 UTC, Dominikus Dittes Scherkl wrote: But I dislike the named tuple members. Why not declare them at the calling site? (int, int, int, string) fn() { return (3, 2, 1, "meins"); } Because how are you supposed to know what each member of the tuple

Low level unit test library in druntime

2016-08-26 Thread Jacob Carlborg via Digitalmars-d
I've been thinking lately about unit tests in D. The built-in support is a bit lacking. There's been many threads with this topic, even an attempt to get unit-threaded (or parts of it) into druntime/Phobos. I was thinking, instead of trying to come up with a unit test framework that will

Re: D Github contributors - enable 2 factor authentification

2016-08-26 Thread Jacob Carlborg via Digitalmars-d
On 2016-08-26 17:11, Nick Sabalausky wrote: That right there is why gitlab is better. I realize it's too late now, but I kinda wish we had standardized on that instead of github. Unlike gitlab, github takes all the philosophy, purpose, goals and values of git (the very tool it's built for) and

Re: Entity Component Architecture

2016-08-26 Thread MrSmith via Digitalmars-d
On Wednesday, 24 August 2016 at 17:57:33 UTC, vladdeSV wrote: I am searching for feedback. What do you think it's pros and cons are? Preformance, memory usage, scaleability, etc? Your solution is basically OOP with composition used. It is enough for convenience, but not enough for speed. Also

Re: using .init reliably

2016-08-26 Thread Cauterite via Digitalmars-d-learn
On Friday, 26 August 2016 at 15:14:42 UTC, Steven Schveighoffer wrote: FYI, you cannot make this patch until we fully deprecate the use of TypeInfo.init: https://github.com/dlang/druntime/blob/master/src/object.d#L294 So at least until 2.075. -Steve Ah yes, good thinking. I'll keep that in

Re: Optimisation possibilities: current, future and enhancements

2016-08-26 Thread Chris Wright via Digitalmars-d
On Fri, 26 Aug 2016 10:32:55 +, kink wrote: > Inlining and subsequent constant folding are only available if the > callee isn't an external. The optimizations being discussed are a result of purity guarantees that have nothing to do with inlining. The example showed constant folding as a

Re: using .init reliably

2016-08-26 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/26/16 6:52 AM, Cauterite wrote: On Friday, 26 August 2016 at 09:48:00 UTC, Jonathan M Davis wrote: And I expect that it will become an error at some point in the future to define an init member for a user-defined type, at which point, there won't be any choice about fixing it. I might

Re: D Github contributors - enable 2 factor authentification

2016-08-26 Thread Nick Sabalausky via Digitalmars-d
On 08/11/2016 05:25 PM, Walter Bright wrote: On 8/11/2016 7:34 AM, H. S. Teoh via Digitalmars-d wrote: so no actual code would be lost. Github dlang is our critical infrastructure, we should treat it accordingly. I agree we wouldn't lose the code history, but would lose just about everything

Re: D Github contributors - enable 2 factor authentification

2016-08-26 Thread Nick Sabalausky via Digitalmars-d
On 08/11/2016 10:56 AM, Kagamin wrote: On Thursday, 11 August 2016 at 13:35:08 UTC, qznc wrote: The code is pretty safe thanks to git. The comments get lost. Irony. Is git still a DVCS? If you lose the central repo, you just lose. The one big thing that always annoyed me about github is

Re: yet another event loop

2016-08-26 Thread Jack Stouffer via Digitalmars-d-announce
On Wednesday, 24 August 2016 at 18:03:39 UTC, Eugene Wissner wrote: https://github.com/caraus-ecms/tanya Please make documentation easily available for your library. I wish to use event loops in D, but I have no desire to wade though someone else's code in order to figure out how use the

Re: rdmd configuration files

2016-08-26 Thread Nick Sabalausky via Digitalmars-d
On 08/11/2016 06:04 PM, Jonathan Marler wrote: On Thursday, 11 August 2016 at 21:58:35 UTC, Chris Wright wrote: On Thu, 11 Aug 2016 20:44:12 +, Lodovico Giaretta wrote: In file rdmd_wrapper.sh: rdmd -my-special -command-line -parameters $* When you call it this way: ./rdmd_wrapper

Re: yet another event loop

2016-08-26 Thread Eugene Wissner via Digitalmars-d-announce
On Friday, 26 August 2016 at 10:54:17 UTC, bachmeier wrote: The person you responded to is a troll that has been cluttering the forum. No need to even read what they are posting. Didn't know it, thanks

Allows the use of part of the language keywords?

2016-08-26 Thread Brian via Digitalmars-d
Allows the use of part of the language keywords, example: ```D package application.module.user.model; class User { // TODO } ``` [code] sturct module { // TODO } [code] PS: editor don't support markdown or bbcode?- -

Re: Optimisation possibilities: current, future and enhancements

2016-08-26 Thread Basile B. via Digitalmars-d
On Friday, 26 August 2016 at 14:03:13 UTC, Meta wrote: On Friday, 26 August 2016 at 10:51:15 UTC, Johan Engelen wrote: On Thursday, 25 August 2016 at 14:42:28 UTC, Basile B. wrote: I'll add * create temporaries based on the const function attribute. Struct method constness (as in your

Re: Optimisation possibilities: current, future and enhancements

2016-08-26 Thread Meta via Digitalmars-d
On Friday, 26 August 2016 at 10:51:15 UTC, Johan Engelen wrote: On Thursday, 25 August 2016 at 14:42:28 UTC, Basile B. wrote: I'll add * create temporaries based on the const function attribute. Struct method constness (as in your example) does not mean that the return value is constant

[Issue 16365] cannot allow calling function pointer from delegate in @safe code

2016-08-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16365 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 16365] cannot allow calling function pointer from delegate in @safe code

2016-08-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16365 --- Comment #6 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/497fdfbee1b376d049d0531da789dbc60860fe1f fix Issue 16365 - cannot allow calling function pointer from

[Issue 16431] rdmd runs dmd twice for single-files with no dependencies

2016-08-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16431 greensunn...@gmail.com changed: What|Removed |Added Summary|rdmd is slower than DUB |rdmd runs dmd twice for

[Issue 16431] rdmd is slower than DUB

2016-08-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16431 --- Comment #3 from ag0ae...@gmail.com --- (In reply to greensunny12 from comment #2) > Well, it still seems unnecessary to me to run the full-blown CTFE compiler > twice on a file. Sure. If you make rdmd faster, that's great. I just don't think

Re: Entity Component Architecture

2016-08-26 Thread vladdeSV via Digitalmars-d
On Wednesday, 24 August 2016 at 21:09:36 UTC, ilariel wrote: I'm sorry if this sounds rude. No problem. For a small scale project where you don't get performance problems there is nothing wrong this approach if it fits your purpose. Ask, profile, fix bottlenecks and optimize. The approach

Re: using .init reliably

2016-08-26 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, August 26, 2016 10:52:47 Cauterite via Digitalmars-d-learn wrote: > On Friday, 26 August 2016 at 09:48:00 UTC, Jonathan M Davis wrote: > > And I expect that it will become an error at some point in the > > future to define an init member for a user-defined type, at > > which point,

Re: using .init reliably

2016-08-26 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, August 26, 2016 11:20:56 Johan Engelen via Digitalmars-d-learn wrote: > On Friday, 26 August 2016 at 09:48:00 UTC, Jonathan M Davis wrote: > > You're supposed to be able to depend on .init existing. Default > > initialization for structs can be disabled via > > > > @disable this(); > >

Re: using .init reliably

2016-08-26 Thread Johan Engelen via Digitalmars-d-learn
On Friday, 26 August 2016 at 09:48:00 UTC, Jonathan M Davis wrote: You're supposed to be able to depend on .init existing. Default initialization for structs can be disabled via @disable this(); but even then, the init member still exists (it just isn't used for default initialization).

[Issue 16433] __traits(compiles) inconsistent for child class

2016-08-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16433 r...@rcorre.net changed: What|Removed |Added CC||r...@rcorre.net --

[Issue 16433] New: __traits(compiles) inconsistent for child class

2016-08-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16433 Issue ID: 16433 Summary: __traits(compiles) inconsistent for child class Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: enhancement

Re: yet another event loop

2016-08-26 Thread bachmeier via Digitalmars-d-announce
On Friday, 26 August 2016 at 10:38:59 UTC, Eugene Wissner wrote: I think I disagree. For example I didn't know who is kardashian and the name is pretty difficult. And I think neither kardashian nor madonna are worth to name something after them. I also doubt that naming after famous people

Re: Optimisation possibilities: current, future and enhancements

2016-08-26 Thread Johan Engelen via Digitalmars-d
On Thursday, 25 August 2016 at 14:42:28 UTC, Basile B. wrote: I'll add * create temporaries based on the const function attribute. Struct method constness (as in your example) does not mean that the return value is constant when calling it twice in a row. As pointed out by others, the

Re: using .init reliably

2016-08-26 Thread Cauterite via Digitalmars-d-learn
On Friday, 26 August 2016 at 09:48:00 UTC, Jonathan M Davis wrote: And I expect that it will become an error at some point in the future to define an init member for a user-defined type, at which point, there won't be any choice about fixing it. I might take a crack at this patch. Sounds

Re: yet another event loop

2016-08-26 Thread Eugene Wissner via Digitalmars-d-announce
On Friday, 26 August 2016 at 02:22:54 UTC, Bill Hicks wrote: On Wednesday, 24 August 2016 at 18:03:39 UTC, Eugene Wissner wrote: https://github.com/caraus-ecms/tanya Ok there are not so many event loops in D and here an another one and its name is "tanya". Could you change the name to

Re: Optimisation possibilities: current, future and enhancements

2016-08-26 Thread kink via Digitalmars-d
On Friday, 26 August 2016 at 09:30:52 UTC, Timon Gehr wrote: Better performance is better even when it is not the primary concern. It's not the compiler's business to judge coding style It's free to choose not to implement complex optimizations just so that people get super duper performance

Re: yet another event loop

2016-08-26 Thread Robert M. Münch via Digitalmars-d-announce
On 2016-08-24 18:03:39 +, Eugene Wissner said: I want it to become not an event loop only but a general purpose library that has an event loop. Hi, well, I would re-think this since the danger is, that everything is so connected that I can use either all or nothing at all. I'm

[Issue 16430] Show a warning when a semicolon is used after a struct or enum definition

2016-08-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16430 --- Comment #8 from b2.t...@gmx.com --- (In reply to b2.temp from comment #6) > libdparse already produces warnings for empty statements. Oops, I meant that it does that for empty declarations, already, while DMD not yet ! --

Re: copy a JSONValue

2016-08-26 Thread Alex via Digitalmars-d-learn
On Friday, 26 August 2016 at 08:21:14 UTC, Alex wrote: On Friday, 26 August 2016 at 07:20:00 UTC, Daniel Kozak wrote: auto j2 = j.toString.parseJSON; ha! cool! thanks! :) found a bug... https://issues.dlang.org/show_bug.cgi?id=16432 not very serious... but not found yet? ;)

[Issue 16432] New: JSON incorrectly parses to string

2016-08-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16432 Issue ID: 16432 Summary: JSON incorrectly parses to string Product: D Version: D2 Hardware: x86 OS: Mac OS X Status: NEW Severity: normal Priority:

[Issue 16430] Show a warning when a semicolon is used after a struct or enum definition

2016-08-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16430 --- Comment #7 from b2.t...@gmx.com --- *** Issue 16378 has been marked as a duplicate of this issue. *** --

Re: using .init reliably

2016-08-26 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, August 26, 2016 08:59:55 Cauterite via Digitalmars-d-learn wrote: > How can I get the initial value of an arbitrary type? Since any > struct can override it, .init is not reliable: > > struct Z { > enum init = 6; > string val = `asdf`; > }; > assert(Z.init == 6); >

[Issue 16378] Cases where empty statements warning is not emitted

2016-08-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16378 b2.t...@gmx.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

[Issue 16430] Show a warning when a semicolon is used after a struct or enum definition

2016-08-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16430 b2.t...@gmx.com changed: What|Removed |Added Hardware|x86_64 |All OS|Linux

Re: Optimisation possibilities: current, future and enhancements

2016-08-26 Thread Basile B. via Digitalmars-d
On Friday, 26 August 2016 at 08:44:54 UTC, kink wrote: On Friday, 26 August 2016 at 05:50:52 UTC, Basile B. wrote: On Thursday, 25 August 2016 at 22:37:13 UTC, kinke wrote: On Thursday, 25 August 2016 at 18:15:47 UTC, Basile B. wrote: From my perspective, the problem with this example isn't

Re: Optimisation possibilities: current, future and enhancements

2016-08-26 Thread Timon Gehr via Digitalmars-d
On 26.08.2016 10:44, kink wrote: On Friday, 26 August 2016 at 05:50:52 UTC, Basile B. wrote: On Thursday, 25 August 2016 at 22:37:13 UTC, kinke wrote: On Thursday, 25 August 2016 at 18:15:47 UTC, Basile B. wrote: From my perspective, the problem with this example isn't missed optimization

Re: C# 7 Features - Tuples

2016-08-26 Thread ixid via Digitalmars-d
On Thursday, 25 August 2016 at 13:41:29 UTC, dom wrote: https://blogs.msdn.microsoft.com/dotnet/2016/08/24/whats-new-in-csharp-7-0/ came across the new c# features today. I really liked the syntax for Tuples (and deconstructors), would be great to have a similar syntax in D :) This is

using .init reliably

2016-08-26 Thread Cauterite via Digitalmars-d-learn
How can I get the initial value of an arbitrary type? Since any struct can override it, .init is not reliable: struct Z { enum init = 6; string val = `asdf`; }; assert(Z.init == 6); assert(typeof(Z()).init == 6); I know I could use *(cast(Z*) typeid(Z).initializer.ptr) but that

[Issue 16430] Show a warning when a semicolon is used after a struct or enum definition

2016-08-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16430 Cauterite changed: What|Removed |Added CC||cauter...@gmail.com ---

Re: Optimisation possibilities: current, future and enhancements

2016-08-26 Thread kink via Digitalmars-d
On Friday, 26 August 2016 at 05:50:52 UTC, Basile B. wrote: On Thursday, 25 August 2016 at 22:37:13 UTC, kinke wrote: On Thursday, 25 August 2016 at 18:15:47 UTC, Basile B. wrote: From my perspective, the problem with this example isn't missed optimization potential. It's the code itself. Why

Re: copy a JSONValue

2016-08-26 Thread Alex via Digitalmars-d-learn
On Friday, 26 August 2016 at 07:46:13 UTC, Daniel Kozak wrote: Another way is to implement deepCopy by yourself (something like below) import std.json; import std.stdio; JSONValue deepCopy(ref JSONValue val) { JSONValue newVal; switch(val.type) { case JSON_TYPE.STRING:

Re: copy a JSONValue

2016-08-26 Thread Alex via Digitalmars-d-learn
On Friday, 26 August 2016 at 07:20:00 UTC, Daniel Kozak wrote: auto j2 = j.toString.parseJSON; ha! cool! thanks! :)

Re: copy a JSONValue

2016-08-26 Thread Daniel Kozak via Digitalmars-d-learn
On Friday, 26 August 2016 at 06:56:06 UTC, Alex wrote: Hi everybody, I'm little at loss: as documented, a JSONValue is only shallow copied: ... So the effect that the code of "j" is altered was expected. The question is: how to make a deep copy of a JSONValue? Is there a simple way without

Re: C# 7 Features - Tuples

2016-08-26 Thread Kagamin via Digitalmars-d
On Thursday, 25 August 2016 at 14:43:35 UTC, Dominikus Dittes Scherkl wrote: (int, int, int, string) fn() { return (3, 2, 1, "meins"); } int x, y, z; string s; (x, y, z, s) = fn(); See https://forum.dlang.org/post/ubrngkdmyduepmfkh...@forum.dlang.org

  1   2   >