Re: Real implicitly converts to float?

2016-06-22 Thread Tofu Ninja via Digitalmars-d-learn
On Wednesday, 22 June 2016 at 14:17:42 UTC, Jonathan M Davis wrote: Well, that particular value should probably work thanks to VRP (value range propagation), since 10 can fit into float with no loss of precision. However, what's far more disconcerting is that real x = real.max; float y = x;

Re: Examples of dub use needed

2016-06-22 Thread Mike Parker via Digitalmars-d
On Wednesday, 22 June 2016 at 19:20:30 UTC, jmh530 wrote: I will touch dub, but I still felt like shouting "well then why doesn't the next edition of Learning D just tell people to look at some D source code and figure it out" when I saw that... What are you referring to? I think dub is

Re: Examples of dub use needed

2016-06-22 Thread Mike Parker via Digitalmars-d
On Wednesday, 22 June 2016 at 19:00:56 UTC, bachmeier wrote: On Wednesday, 22 June 2016 at 15:48:03 UTC, Mike Parker wrote: Suppose you need to link against a .so file that is in another directory. How do you find out how to do that on this page:

[Issue 16094] error: overlapping slice assignment (CTFE)

2016-06-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16094 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/560f606ae94af80881606a5a8151a3cacb1b5d30 fix Issue 16094 - error: overlapping slice assignment (CTFE)

Re: Get specific item by index from DList

2016-06-22 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Jun 22, 2016 at 10:49:54PM +, TheDGuy via Digitalmars-d-learn wrote: > On Wednesday, 22 June 2016 at 22:25:21 UTC, lmpo wrote: > > On Wednesday, 22 June 2016 at 22:10:09 UTC, TheDGuy wrote: > > > Hi, > > > > > > i am currently programming a small game with GTKD and i have to > > > use

Re: How to use a char[] buffer in D

2016-06-22 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Jun 22, 2016 at 09:57:04PM +, Andrew Chapman via Digitalmars-d-learn wrote: > Hi everyone, just wanting some help with optimisation if anyone is > kind enough :-) > > I have a loop that iterates potentially millions of times, and inside > that loop I have code that appends some

Re: Get specific item by index from DList

2016-06-22 Thread lmpo via Digitalmars-d-learn
On Wednesday, 22 June 2016 at 22:10:09 UTC, TheDGuy wrote: Hi, i am currently programming a small game with GTKD and i have to use a Dlist because an array is static Static ? An array is not static. a DList is only interesting when you have to insert or remove inside the list i.e not at the

[Issue 11167] Slicing a pointer can't be @safe.

2016-06-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11167 David Nadlinger changed: What|Removed |Added Keywords||safe --

Re: How to use a char[] buffer in D

2016-06-22 Thread Ali Çehreli via Digitalmars-d-learn
On 06/22/2016 02:57 PM, Andrew Chapman wrote: > Code such as: > > if(buffer in myHash) { > > } > > throws an access violation. A string value works without error. Does it throw an exception? Can you reproduce the issue with a short program? Ali

Get specific item by index from DList

2016-06-22 Thread TheDGuy via Digitalmars-d-learn
Hi, i am currently programming a small game with GTKD and i have to use a Dlist because an array is static but i want to add user inputs dynamically to a list. Now i am wondering how i can get a specific item from that list? I read that this isn't possible but is it possible to convert that

Re: Is dmd fast?

2016-06-22 Thread Walter Bright via Digitalmars-d
On 6/22/2016 7:28 AM, Adam D. Ruppe wrote: On Wednesday, 22 June 2016 at 13:46:50 UTC, qznc wrote: RDMD 0:00:00.275884 DMD 0:00:00.311102 Since rdmd is just a script wrapper around dmd, it shouldn't actually be faster. rdmd caches "script" programs, so could be faster.

How to use a char[] buffer in D

2016-06-22 Thread Andrew Chapman via Digitalmars-d-learn
Hi everyone, just wanting some help with optimisation if anyone is kind enough :-) I have a loop that iterates potentially millions of times, and inside that loop I have code that appends some strings together, e.g.: string key = s1 ~ "_" ~ s2; I discovered that due to the memory

Re: Is dmd fast?

2016-06-22 Thread qznc via Digitalmars-d
On Wednesday, 22 June 2016 at 19:56:26 UTC, Adam D. Ruppe wrote: D compile speed typically *scales* better than the competition. Instead of chasing the 100ms in hello world, it tackles the 1ms of a real project. Ok, but this is hard to test. It is not feasible to build the same real

[Issue 16192] std.conv.toChars() opSlice wrong for radix other than 10

2016-06-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16192 ag0ae...@gmail.com changed: What|Removed |Added Keywords||pull CC|

Re: Is dmd fast?

2016-06-22 Thread deadalnix via Digitalmars-d
On Wednesday, 22 June 2016 at 19:25:13 UTC, Jack Stouffer wrote: On Wednesday, 22 June 2016 at 19:20:42 UTC, deadalnix wrote: You methodology is flawed. You are essentially measuring link time against the standard lib. As someone else in the thread alluded to, people don't care about the

[Issue 14662] __FILE__ template parameter becomes relative just by changing compilation directory

2016-06-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14662 Johan Engelen changed: What|Removed |Added CC||jbc.enge...@gmail.com

[Issue 16194] auto return type inference depends on return statement order

2016-06-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16194 --- Comment #2 from ZombineDev --- No, I think this is specific only to class sub-typing. For example the following compiles successfully and prints "4", "3.4" and "99". In other words, it actually finds the common type of

Re: Is dmd fast?

2016-06-22 Thread Adam D. Ruppe via Digitalmars-d
On Wednesday, 22 June 2016 at 19:25:13 UTC, Jack Stouffer wrote: So if linking is slow, then compilation is slow. But, 1/3 second isn't slow... I don't feel compilation is slow until it takes more like 5 seconds. Certainly, 1/3s is noticable (if you do a hello world with printf instead of

Re: Is dmd fast?

2016-06-22 Thread ketmar via Digitalmars-d
On Wednesday, 22 June 2016 at 19:25:13 UTC, Jack Stouffer wrote: On Wednesday, 22 June 2016 at 19:20:42 UTC, deadalnix wrote: You methodology is flawed. You are essentially measuring link time against the standard lib. As someone else in the thread alluded to, people don't care about the

Re: Initialise dynamic array in array of structures

2016-06-22 Thread ketmar via Digitalmars-d-learn
On Wednesday, 22 June 2016 at 09:27:01 UTC, cym13 wrote: what i meant is that "{}" should be fully equivalent to "Struct()" ctor in terms of calling postblits, and it isn't.

Re: Initialise dynamic array in array of structures

2016-06-22 Thread ketmar via Digitalmars-d-learn
On Wednesday, 22 June 2016 at 09:27:01 UTC, cym13 wrote: On the other hand I don't see why you'd expect {} to call postblit at all. 'cause it essentially makes a copy. i gave the sample in bugreport. it worth me a hour of debugging to find why my refcounted struct keep crashing with invalid

Re: Is dmd fast?

2016-06-22 Thread Jack Stouffer via Digitalmars-d
On Wednesday, 22 June 2016 at 19:20:42 UTC, deadalnix wrote: You methodology is flawed. You are essentially measuring link time against the standard lib. As someone else in the thread alluded to, people don't care about the nuance, and it's not particularly important. Linking is part of the

Re: Is dmd fast?

2016-06-22 Thread deadalnix via Digitalmars-d
On Wednesday, 22 June 2016 at 13:46:50 UTC, qznc wrote: Walter and we as a community often claim that dmd is fast as in "compiles quickly". Go also claims this. Rust does not. They even state that compilation speed is one of the big tasks they are working on. From the general sentiment, I

Re: Examples of dub use needed

2016-06-22 Thread jmh530 via Digitalmars-d
On Wednesday, 22 June 2016 at 19:00:56 UTC, bachmeier wrote: I will not touch Dub because I can't tell others that they should figure out how to use it by looking at the insides of existing packages and then fiddling around with various configurations to see if they can get it to work. I

Re: Is dmd fast?

2016-06-22 Thread Icecream Bob via Digitalmars-d
On Wednesday, 22 June 2016 at 14:11:12 UTC, Jack Stouffer wrote: On Wednesday, 22 June 2016 at 13:46:50 UTC, qznc wrote: ... Including scripting languages in that example is unfair as they only lex the file. Right away you can tell that "Hello World" is a poor example of fast compile

Re: Is dmd fast?

2016-06-22 Thread jmh530 via Digitalmars-d
On Wednesday, 22 June 2016 at 14:28:28 UTC, qznc wrote: Rust faster than Go? That still seems weird. I like your overall benchmark. Measuring build times there seems like a good idea. I'm more surprised that Go is faster than D.

Re: Phobo's migration

2016-06-22 Thread Miles L. Hunt via Digitalmars-d
On Wednesday, 22 June 2016 at 16:44:25 UTC, Joerg Joergonson wrote: How bout Freezing Phobos, except for bugs and start migrating it to Phobos 2.0?. phobos is already 2.0. It has the same version as the compiler it's distributed with. For someone who has "so ambitious plans" for phobos you

Re: Phobo's migration

2016-06-22 Thread Jack Stouffer via Digitalmars-d
On Wednesday, 22 June 2016 at 17:55:11 UTC, Joerg Joergonson wrote: How is that? That makes no sense. If Phobo's is production ready as claimed then freezing it can't make it automagically non-production ready, can it? D cannot afford to be stagnant in a time of fierce language competition.

Re: Examples of dub use needed

2016-06-22 Thread bachmeier via Digitalmars-d
On Wednesday, 22 June 2016 at 15:48:03 UTC, Mike Parker wrote: I just see things from the perspective that I learned everything I needed from dub --help and the documentation that *is* online. The forums are linked in the menu item 'About' next to 'Documentation' at the top of code.dlang.org.

Re: Is dmd fast?

2016-06-22 Thread ketmar via Digitalmars-d
On Wednesday, 22 June 2016 at 13:46:50 UTC, qznc wrote: Destroy! microbenchmarks sux. destruction sequence complete.

[Issue 16194] auto return type inference depends on return statement order

2016-06-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16194 hba...@hotmail.com changed: What|Removed |Added CC||hba...@hotmail.com --- Comment #1 from

[Issue 13572] etc.c.zlib must be nothrow

2016-06-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13572 --- Comment #7 from Ketmar Dark --- i.e. i always thought that @trusted code should survive external errors (like courrupted data), and does check for null pointers, etc. but no code can validate all invalid arguments passed

[Issue 13572] etc.c.zlib must be nothrow

2016-06-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13572 --- Comment #6 from Ketmar Dark --- my understanding of @trusted (and @safe, for that matter) is that safety promise is nullified if someone passing invalid pointer to such functions. like, pass a slice created from

Re: Phobo's migration

2016-06-22 Thread jmh530 via Digitalmars-d
On Wednesday, 22 June 2016 at 17:55:11 UTC, Joerg Joergonson wrote: Have you every used .NET considerably? You're comparing D to something created and maintained by one of the largest software companies in the world...

Re: GTKD - get CSS class for button

2016-06-22 Thread TheDGuy via Digitalmars-d-learn
On Wednesday, 22 June 2016 at 17:50:53 UTC, Mike Wey wrote: "Type T wraps should match the type of the data" Does string match the type of the data? What is the type of the data? How do i tell the function that i want the Array as a string array? I am not familiar with Types and what 'TC' or

[Issue 16194] New: auto return type inference depends on return statement order

2016-06-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16194 Issue ID: 16194 Summary: auto return type inference depends on return statement order Product: D Version: D2 Hardware: All OS: All Status: NEW

Re: Behavior of __FILE__ in mixin template

2016-06-22 Thread Andre Pany via Digitalmars-d-learn
On Wednesday, 22 June 2016 at 17:52:26 UTC, Ali Çehreli wrote: On 06/22/2016 10:07 AM, Andre Pany wrote: > Hi, > > I thought a mixin template is copied into the place where the mixin > statement > exists and then the coding is evaluated. > This seems not to be true for __FILE__ Apparently its

Re: Using .lib and .dll in D applications

2016-06-22 Thread moe via Digitalmars-d-learn
On Wednesday, 22 June 2016 at 05:34:33 UTC, Mike Parker wrote: On Wednesday, 22 June 2016 at 03:06:29 UTC, moe wrote: I meant like this: - PluginContract // not a dub project, just some folder -- iplugin.d - TestApp // all files for the app (separate project) -- packages

Re: D-Man culture

2016-06-22 Thread Jesse Phillips via Digitalmars-d-announce
On Monday, 20 June 2016 at 14:14:06 UTC, Martin Tschierschke wrote: On Sunday, 19 June 2016 at 15:01:33 UTC, Seb wrote: Hi, I am not sure how much you have heard about the D-Man, but in Japan there is an entire culture based on the D-Man! As I learned about this by accident (and even Walter

Re: Phobo's migration

2016-06-22 Thread Joerg Joergonson via Digitalmars-d
On Wednesday, 22 June 2016 at 16:51:32 UTC, Jack Stouffer wrote: On Wednesday, 22 June 2016 at 16:44:25 UTC, Joerg Joergonson wrote: How bout Freezing Phobos, except for bugs and start migrating it to Phobos 2.0?. This would kill the language. How is that? That makes no sense. If Phobo's is

Re: Behavior of __FILE__ in mixin template

2016-06-22 Thread Ali Çehreli via Digitalmars-d-learn
On 06/22/2016 10:07 AM, Andre Pany wrote: > Hi, > > I thought a mixin template is copied into the place where the mixin > statement > exists and then the coding is evaluated. > This seems not to be true for __FILE__ Apparently its the whole template that supports that. Is moving the 'file'

Re: GTKD - get CSS class for button

2016-06-22 Thread Mike Wey via Digitalmars-d-learn
On 06/22/2016 05:16 PM, TheDGuy wrote: On Wednesday, 22 June 2016 at 13:47:01 UTC, Gerald wrote: On Wednesday, 22 June 2016 at 12:57:51 UTC, TheDGuy wrote: widget.getStyleContext().listClasses() to get a list of all classes assigned to the widget. If you just want to see if a specific class is

Re: Is there anyway to make opApply @nogc?

2016-06-22 Thread Gary Willoughby via Digitalmars-d-learn
On Wednesday, 22 June 2016 at 13:36:54 UTC, Marc Schütz wrote: On Tuesday, 21 June 2016 at 19:21:01 UTC, Gary Willoughby wrote: Right ok, thanks! It doesn't seem to help though as the compiler complains about it being not @nogc. You probably need to declare the delegate and opApply() itself

Re: Examples of dub use needed

2016-06-22 Thread jmh530 via Digitalmars-d
On Wednesday, 22 June 2016 at 15:48:03 UTC, Mike Parker wrote: What needs to be improved? I will say that it looks a lot better now than it used to, even though I'm not sure if the content has changed as much. It's not entirely clear why to use SDLang over JSON. It should be more clearly

Re: Proposed Enhancement: Deprecate std.conv.text With 0 Arguments

2016-06-22 Thread Jack Stouffer via Digitalmars-d
On Wednesday, 22 June 2016 at 17:04:54 UTC, Meta wrote: Intentional or not, I don't see any downside to disallowing calling text with 0 args (aside from backwards-compatibility concerns). It doesn't even return anything useful, just null. Well, the idea is that the function is a string

Behavior of __FILE__ in mixin template

2016-06-22 Thread Andre Pany via Digitalmars-d-learn
Hi, I thought a mixin template is copied into the place where the mixin statement exists and then the coding is evaluated. This seems not to be true for __FILE__ I have a module form, which has a class Form. This module also contains following mixin template mixin template formTemplate() {

Re: Proposed Enhancement: Deprecate std.conv.text With 0 Arguments

2016-06-22 Thread Gary Willoughby via Digitalmars-d
On Wednesday, 22 June 2016 at 15:39:11 UTC, Meta wrote: If it is called with 0 arguments it will return null. This behaviour has caused several bugs in my code because combined with optional parens and UFCS, it is easy to accidentally call text with 0 args but have it look like passing a

Re: Proposed Enhancement: Deprecate std.conv.text With 0 Arguments

2016-06-22 Thread Meta via Digitalmars-d
On Wednesday, 22 June 2016 at 16:47:53 UTC, Jack Stouffer wrote: On Wednesday, 22 June 2016 at 15:48:06 UTC, Seb wrote: I don't see any problem in deprecating it as std.conv.text with 0 arguments is clearly unintended behavior I don't see how you can make that claim, take a look at the code

Re: Phobo's migration

2016-06-22 Thread Jack Stouffer via Digitalmars-d
On Wednesday, 22 June 2016 at 16:44:25 UTC, Joerg Joergonson wrote: How bout Freezing Phobos, except for bugs and start migrating it to Phobos 2.0?. This would kill the language. This will be migrating Phobos over to use the new constructs(nogc, safe, etc), How, in your opinion, are these

Re: Proposed Enhancement: Deprecate std.conv.text With 0 Arguments

2016-06-22 Thread Jack Stouffer via Digitalmars-d
On Wednesday, 22 June 2016 at 15:48:06 UTC, Seb wrote: I don't see any problem in deprecating it as std.conv.text with 0 arguments is clearly unintended behavior I don't see how you can make that claim, take a look at the code again: private S textImpl(S, U...)(U args) { static if

Phobo's migration

2016-06-22 Thread Joerg Joergonson via Digitalmars-d
How bout Freezing Phobos, except for bugs and start migrating it to Phobos 2.0?. This way a proper library can be built that doesn't feel like a lot of stuff thrown together haphazardly(think .NET). This will be migrating Phobos over to use the new constructs(nogc, safe, etc), remove the

Re: TypeInfo_Interface from runtime string?

2016-06-22 Thread Thalamus via Digitalmars-d-learn
On Wednesday, 22 June 2016 at 15:46:15 UTC, Thalamus wrote: On Wednesday, 22 June 2016 at 15:43:08 UTC, Basile B. wrote: On Wednesday, 22 June 2016 at 15:15:51 UTC, Thalamus wrote: [...] No need for a constructor. typeid() returns a static instance that's pre-allocated. [...] Thanks

Re: TypeInfo_Interface from runtime string?

2016-06-22 Thread Thalamus via Digitalmars-d-learn
On Wednesday, 22 June 2016 at 15:43:08 UTC, Basile B. wrote: On Wednesday, 22 June 2016 at 15:15:51 UTC, Thalamus wrote: [...] No need for a constructor. typeid() returns a static instance that's pre-allocated. [...] Thanks Basile.

Re: Proposed Enhancement: Deprecate std.conv.text With 0 Arguments

2016-06-22 Thread Seb via Digitalmars-d
On Wednesday, 22 June 2016 at 15:39:11 UTC, Meta wrote: This is a small but annoying problem: std.conv.text is defined like this: [...] Imho that's a great idea! I don't see any problem in deprecating it as std.conv.text with 0 arguments is clearly unintended behavior. Hence I would call

Re: Examples of dub use needed

2016-06-22 Thread Mike Parker via Digitalmars-d
On Wednesday, 22 June 2016 at 13:51:55 UTC, jmh530 wrote: Given that this project is going to bundled with DMD some time in the future, I think that this response sees the forest for the trees. While those things would make the OPs life a little easier, hopefully, the number of people using

Re: TypeInfo_Interface from runtime string?

2016-06-22 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 22 June 2016 at 15:15:51 UTC, Thalamus wrote: Hi everyone, My project includes lots of .Net interop via C linkage. One of the things I need to do is refer in C# to an interface declared in the D code, and then to actually work with the interface concretely in the D layer. So, I

Proposed Enhancement: Deprecate std.conv.text With 0 Arguments

2016-06-22 Thread Meta via Digitalmars-d
This is a small but annoying problem: std.conv.text is defined like this: string text(T...)(T args) { return textImpl!string(args); } private S textImpl(S, U...)(U args) { static if (U.length == 0) { return null; } else { auto result = to!S(args[0]);

Re: Is dmd fast?

2016-06-22 Thread Adrian Matoga via Digitalmars-d
On Wednesday, 22 June 2016 at 14:28:19 UTC, Adam D. Ruppe wrote: BTW this more measures linker speed than compiler. dmd -c -o- just runs the compiler and skips filesystem output... it'd be pretty fast and if there's similar options for other compilers (gcc has -c too at least) it might be

Re: GTKD - get CSS class for button

2016-06-22 Thread TheDGuy via Digitalmars-d-learn
On Wednesday, 22 June 2016 at 13:47:01 UTC, Gerald wrote: On Wednesday, 22 June 2016 at 12:57:51 UTC, TheDGuy wrote: widget.getStyleContext().listClasses() to get a list of all classes assigned to the widget. If you just want to see if a specific class is assigned to the widget you can use

TypeInfo_Interface from runtime string?

2016-06-22 Thread Thalamus via Digitalmars-d-learn
Hi everyone, My project includes lots of .Net interop via C linkage. One of the things I need to do is refer in C# to an interface declared in the D code, and then to actually work with the interface concretely in the D layer. So, I need to get a TypeInfo_Interface object from a string

Re: Phobos Action Items

2016-06-22 Thread Kagamin via Digitalmars-d
https://lexi-lambda.github.io/blog/2016/06/12/four-months-with-haskell/#documentation-is-nearly-worthless - found this on reddit, criticizes haskell docs and praises racket docs: they are so effective because of how the prose explains what each function does, when to use it, why you’d use it,

Re: Is dmd fast?

2016-06-22 Thread Adam D. Ruppe via Digitalmars-d
On Wednesday, 22 June 2016 at 13:46:50 UTC, qznc wrote: RDMD 0:00:00.275884 DMD 0:00:00.311102 Since rdmd is just a script wrapper around dmd, it shouldn't actually be faster. BTW this more measures linker speed than compiler. dmd -c -o- just runs the compiler and skips

Re: Is dmd fast?

2016-06-22 Thread qznc via Digitalmars-d
On Wednesday, 22 June 2016 at 14:28:19 UTC, Adam D. Ruppe wrote: On Wednesday, 22 June 2016 at 13:46:50 UTC, qznc wrote: RDMD 0:00:00.275884 DMD 0:00:00.311102 Since rdmd is just a script wrapper around dmd, it shouldn't actually be faster. BTW this more measures linker

Re: Is dmd fast?

2016-06-22 Thread qznc via Digitalmars-d
On Wednesday, 22 June 2016 at 14:11:12 UTC, Jack Stouffer wrote: On Wednesday, 22 June 2016 at 13:46:50 UTC, qznc wrote: ... Including scripting languages in that example is unfair as they only lex the file. Sure. Especially bash, which is always in RAM anyways. It shows the possible

Re: TickDuration depreciated, yet stopwatch not?

2016-06-22 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, June 21, 2016 19:17:00 Joerg Joergonson via Digitalmars-d-learn wrote: > Stopwatch depends on TickDuration and TickDuration is depreciated > yet Stopwatch isn't and hasn't been converted to MonoTime... > makes sense? TickDuration does have a note in its documentation about how it's

Re: Real implicitly converts to float?

2016-06-22 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, June 22, 2016 05:04:42 Tofu Ninja via Digitalmars-d-learn wrote: > Is this intended behavior? I can't seem to find it documented > anywhere, I would think the loss in precision would atleast be a > warning. > > real x = 10; > float y = x; // No error or warning > > real to double and

Re: Is dmd fast?

2016-06-22 Thread Jack Stouffer via Digitalmars-d
On Wednesday, 22 June 2016 at 13:46:50 UTC, qznc wrote: ... Including scripting languages in that example is unfair as they only lex the file. Right away you can tell that "Hello World" is a poor example of fast compile times because GCC is near the top; (as you probably know) large Cpp

Re: Examples of dub use needed

2016-06-22 Thread jmh530 via Digitalmars-d
On Wednesday, 22 June 2016 at 01:56:34 UTC, Mike Parker wrote: And there's always the DUB forums [5. I didn't even know there were DUB forums.

Re: Examples of dub use needed

2016-06-22 Thread jmh530 via Digitalmars-d
On Wednesday, 22 June 2016 at 01:56:34 UTC, Mike Parker wrote: There aren't that many commands for DUB on the command line. Most of what you need can be gleaned from dub --help, but there is also documentation online [1]. For package configurations, the documentation at code.dlang.org covers

[Issue 16193] opApply() doesn't heap allocate closure

2016-06-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16193 Mathias Lang changed: What|Removed |Added CC|

Re: GTKD - get CSS class for button

2016-06-22 Thread Gerald via Digitalmars-d-learn
On Wednesday, 22 June 2016 at 12:57:51 UTC, TheDGuy wrote: widget.getStyleContext().listClasses() to get a list of all classes assigned to the widget. If you just want to see if a specific class is assigned to the widget you can use widget.getStyleContext().hasClass() Thanks a lot for your

Is dmd fast?

2016-06-22 Thread qznc via Digitalmars-d
Walter and we as a community often claim that dmd is fast as in "compiles quickly". Go also claims this. Rust does not. They even state that compilation speed is one of the big tasks they are working on. From the general sentiment, I would expect that dmd performs on the level of Go and Rust

Re: Is there anyway to make opApply @nogc?

2016-06-22 Thread Marc Schütz via Digitalmars-d-learn
On Tuesday, 21 June 2016 at 19:21:01 UTC, Gary Willoughby wrote: Right ok, thanks! It doesn't seem to help though as the compiler complains about it being not @nogc. You probably need to declare the delegate and opApply() itself as @nogc, too: int opApply(scope int delegate(int) @nogc dg)

[Issue 16193] New: opApply() doesn't heap allocate closure

2016-06-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16193 Issue ID: 16193 Summary: opApply() doesn't heap allocate closure Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: normal

Re: Access vialotion

2016-06-22 Thread Bell Baggins via Digitalmars-d-learn
On Wednesday, 22 June 2016 at 13:24:47 UTC, vladdeSV wrote: On Wednesday, 22 June 2016 at 12:47:31 UTC, TheDGuy wrote: On Wednesday, 22 June 2016 at 12:45:29 UTC, TheDGuy wrote: I have an array of buttons: class Window : MainWindow{ private Button[4] bArr; this(){ Button btn_1

Re: Access vialotion

2016-06-22 Thread vladdeSV via Digitalmars-d-learn
On Wednesday, 22 June 2016 at 12:47:31 UTC, TheDGuy wrote: On Wednesday, 22 June 2016 at 12:45:29 UTC, TheDGuy wrote: I have an array of buttons: class Window : MainWindow{ private Button[4] bArr; this(){ Button btn_1 = new Button(); Button btn_2 = new Button();

Re: Real implicitly converts to float?

2016-06-22 Thread Tofu Ninja via Digitalmars-d-learn
On Wednesday, 22 June 2016 at 08:57:38 UTC, Guillaume Piolat wrote: On Wednesday, 22 June 2016 at 05:04:42 UTC, Tofu Ninja wrote: Is this intended behavior? I can't seem to find it documented anywhere, I would think the loss in precision would atleast be a warning. real x = 10; float y = x;

Re: Access vialotion

2016-06-22 Thread Moro Greenhand via Digitalmars-d-learn
On Wednesday, 22 June 2016 at 12:47:31 UTC, TheDGuy wrote: On Wednesday, 22 June 2016 at 12:45:29 UTC, TheDGuy wrote: I have an array of buttons: class Window : MainWindow{ private Button[4] bArr; this(){ Button btn_1 = new Button(); Button btn_2 = new Button();

Re: GTKD - get CSS class for button

2016-06-22 Thread TheDGuy via Digitalmars-d-learn
widget.getStyleContext().listClasses() to get a list of all classes assigned to the widget. If you just want to see if a specific class is assigned to the widget you can use widget.getStyleContext().hasClass() Thanks a lot for your answer. Do you know how i can get the first classname as

Re: Access vialotion

2016-06-22 Thread TheDGuy via Digitalmars-d-learn
On Wednesday, 22 June 2016 at 12:45:29 UTC, TheDGuy wrote: I have an array of buttons: class Window : MainWindow{ private Button[4] bArr; this(){ Button btn_1 = new Button(); Button btn_2 = new Button(); Button btn_3 = new Button(); Button btn_4 = new

Access vialotion

2016-06-22 Thread TheDGuy via Digitalmars-d-learn
I have an array of buttons: class Window : MainWindow{ private Button[4] bArr; this(){ Button btn_1 = new Button(); Button btn_2 = new Button(); Button btn_3 = new Button(); Button btn_4 = new Button(); Button[4] bArr = [btn_1,btn_2,btn_3,btn_4];

Re: QtE5 - is a wrapping of Qt-5 for D

2016-06-22 Thread MGW via Digitalmars-d-announce
This is very nice! I would love to know how you managed to get it working. I had trouble with signals and slots, the class hierarchy, and numerous other things when I was trying to get Qt4 to work in D. How did you handle the Qt class constructors and destructors, etc.? Well, there are too

Re: GTKD - get CSS class for button

2016-06-22 Thread Gerald via Digitalmars-d-learn
On Wednesday, 22 June 2016 at 08:08:20 UTC, TheDGuy wrote: Hello, i would like to know if it possible to get the CSS-class which is asigned to a button (for example)? I didn't find any documentation about this, just the function "getStyleContext().getProperty()", my current attempt: Value

Re: inout and opApply

2016-06-22 Thread Kagamin via Digitalmars-d
On Monday, 20 June 2016 at 15:09:22 UTC, Steven Schveighoffer wrote: int opApply(scope int delegate(ref inout T value) dg) inout The inout inside the delegate is wrapped just like the inout of the 'this' parameter. effectively, this becomes equivalent to several function signatures: int

Re: Release DUB 1.0.0

2016-06-22 Thread Sönke Ludwig via Digitalmars-d-announce
Am 21.06.2016 um 00:37 schrieb Basile B.: You should add a system to support example files, without dependency. For example in a static library, something that would indicate that the package in which the file resides is itself a dependency but don't have to be downloaded: package

Re: Release DUB 1.0.0

2016-06-22 Thread Sönke Ludwig via Digitalmars-d-announce
Am 22.06.2016 um 11:51 schrieb gleb: Sönke Ludwig wrote: I'm pleased to announce the release of the first stable version of the DUB package manager. Stable in this case means that Hello! That's great! But... Is "DFLAGS="-defaultlib=libphobos2.so" dub build" still the only way to build

[Issue 13572] etc.c.zlib must be nothrow

2016-06-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13572 --- Comment #5 from Sobirari Muhomori --- Are you sure it can survive if someone messes with z_stream fields? They are all public. --

Re: Phobos: __FILE__ as template default parameter

2016-06-22 Thread Johan Engelen via Digitalmars-d
On Tuesday, 21 June 2016 at 10:39:52 UTC, David Nadlinger wrote: On Monday, 20 June 2016 at 08:10:19 UTC, Dicebot wrote: How about defining semantics like "try inlining if possible, fallback to always emitting symbol to object file otherwise"? That would also allow compatible implementation in

Re: Release DUB 1.0.0

2016-06-22 Thread gleb via Digitalmars-d-announce
Sönke Ludwig wrote: > I'm pleased to announce the release of the first stable version of the > DUB package manager. Stable in this case means that Hello! That's great! But... Is "DFLAGS="-defaultlib=libphobos2.so" dub build" still the only way to build dynamically linked binaries? What

Re: Initialise dynamic array in array of structures

2016-06-22 Thread cym13 via Digitalmars-d-learn
On Wednesday, 22 June 2016 at 08:06:26 UTC, ketmar wrote: On Wednesday, 22 June 2016 at 06:43:12 UTC, Paul wrote: Why is initialisation via {} bad (in simple terms please :D)? first, it is buggy. i.e. it doesn't always call postblit[1]. second, it's syntax is the same as the syntax of

Re: dlang-requests 0.1.7 released

2016-06-22 Thread ikod via Digitalmars-d-announce
On Wednesday, 22 June 2016 at 02:04:25 UTC, Zekereth wrote: On Saturday, 11 June 2016 at 23:03:52 UTC, ikod wrote: Hello, Dlang-requests is library created under influence of Python-requests, with primary goal of easy to use and performance. I have a couple of questions. If a url can't be

Re: QtE5 - is a wrapping of Qt-5 for D

2016-06-22 Thread w0rp via Digitalmars-d-announce
On Monday, 20 June 2016 at 16:52:04 UTC, MGW wrote: This my library has about 400 functions from Qt and is quite efficient for small applications. https://github.com/MGWL/QtE5 Small video about QtE5 and id5 written on its basis - an example of use. QtE5 on Mac OSX

Re: Real implicitly converts to float?

2016-06-22 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 22 June 2016 at 05:04:42 UTC, Tofu Ninja wrote: Is this intended behavior? I can't seem to find it documented anywhere, I would think the loss in precision would atleast be a warning. real x = 10; float y = x; // No error or warning real to double and double to float also work.

Re: problem using ldc 1.0.0 as D compiler

2016-06-22 Thread David Nadlinger via Digitalmars-d
On Tuesday, 21 June 2016 at 21:44:59 UTC, Dicebot wrote: Would you mind making a point release with it if fix is confirmed? That's Kai's territory, but I'm sure he'll agree that this a sensible thing to do. — David

Re: Searching for a T in a T[]

2016-06-22 Thread Nordlöw via Digitalmars-d-learn
On Wednesday, 22 June 2016 at 08:07:51 UTC, David Nadlinger wrote: What about http://dlang.org/phobos/std_algorithm_searching.html#.canFind.canFind.2? My mistake. The reason for the template error message was another than I though of. Thanks.

Re: Searching for a T in a T[]

2016-06-22 Thread cym13 via Digitalmars-d-learn
On Wednesday, 22 June 2016 at 08:04:34 UTC, Nordlöw wrote: Is there now algorithm (similar to `canFind`) that can search for a `T` in a `T[]`? Existing `canFind` only supports sub-sequence needles. I'm aware of `std.string.indexOf` but that's only for strings. I don't see why canFind isn't

GTKD - get CSS class for button

2016-06-22 Thread TheDGuy via Digitalmars-d-learn
Hello, i would like to know if it possible to get the CSS-class which is asigned to a button (for example)? I didn't find any documentation about this, just the function "getStyleContext().getProperty()", my current attempt: Value value;

Re: Initialise dynamic array in array of structures

2016-06-22 Thread ketmar via Digitalmars-d-learn
On Wednesday, 22 June 2016 at 06:43:12 UTC, Paul wrote: Why is initialisation via {} bad (in simple terms please :D)? first, it is buggy. i.e. it doesn't always call postblit[1]. second, it's syntax is the same as the syntax of argument-less lambda, which makes it context-dependent -- so

Re: Searching for a T in a T[]

2016-06-22 Thread David Nadlinger via Digitalmars-d-learn
On Wednesday, 22 June 2016 at 08:04:34 UTC, Nordlöw wrote: Is there now algorithm (similar to `canFind`) that can search for a `T` in a `T[]`? Existing `canFind` only supports sub-sequence needles. What about http://dlang.org/phobos/std_algorithm_searching.html#.canFind.canFind.2? — David

Searching for a T in a T[]

2016-06-22 Thread Nordlöw via Digitalmars-d-learn
Is there now algorithm (similar to `canFind`) that can search for a `T` in a `T[]`? Existing `canFind` only supports sub-sequence needles. I'm aware of `std.string.indexOf` but that's only for strings.

  1   2   >