Re: How is D doing?

2015-12-23 Thread thedeemon via Digitalmars-d-learn
On Tuesday, 22 December 2015 at 21:38:22 UTC, ZombineDev wrote: Google Trends shows something interesting: https://google.com/trends/explore#q=%2Fm%2F01kbt7%2C%20%2Fm%2F0dsbpg6%2C%20%2Fm%2F091hdj%2C%20%2Fm%2F03j_q%2C%20C%2B%2B&cmpt=q&tz=Etc%2FGMT-2 Today I Learned C++ is most interested by in E

Multiple selective imports on one line

2015-12-23 Thread earthfront via Digitalmars-d-learn
I'm using hackerpilot's excellent textadept plugin + DCD, Dfmt, and Dscanner. Upon saving files, it produces suggestions, much like warnings from the compiler. One suggestion is to use selective imports in local scopes. OK, I'll do that. Now I'm left with a smattering of lines which are just

Re: Multiple selective imports on one line

2015-12-23 Thread Jakob Ovrum via Digitalmars-d-learn
On Wednesday, 23 December 2015 at 10:51:52 UTC, earthfront wrote: I'm using hackerpilot's excellent textadept plugin + DCD, Dfmt, and Dscanner. Upon saving files, it produces suggestions, much like warnings from the compiler. One suggestion is to use selective imports in local scopes. OK, I'l

Re: Multiple selective imports on one line

2015-12-23 Thread ZombineDev via Digitalmars-d-learn
On Wednesday, 23 December 2015 at 10:51:52 UTC, earthfront wrote: I'm using hackerpilot's excellent textadept plugin + DCD, Dfmt, and Dscanner. Upon saving files, it produces suggestions, much like warnings from the compiler. One suggestion is to use selective imports in local scopes. OK, I'l

Re: Most performant way of converting int to string

2015-12-23 Thread Jakob Ovrum via Digitalmars-d-learn
On Tuesday, 22 December 2015 at 17:23:11 UTC, Andrew Chapman wrote: On Tuesday, 22 December 2015 at 17:18:16 UTC, cym13 wrote: On Tuesday, 22 December 2015 at 17:15:27 UTC, Andrew Chapman wrote: Sorry if this is a silly question but is the to! method from the conv library the most efficient way

Re: Most performant way of converting int to string

2015-12-23 Thread Jakob Ovrum via Digitalmars-d-learn
On Wednesday, 23 December 2015 at 11:21:32 UTC, Jakob Ovrum wrote: Dynamic memory allocation is expensive. If the string is short-lived, allocate it on the stack: See also std.conv.toChars[1] for stringifying lazily/on-demand. http://dlang.org/phobos/std_conv#toChars

Convert to string an enum item

2015-12-23 Thread tcak via Digitalmars-d-learn
[code] import std.stdio; import std.conv; enum Values: ubyte{ One = 1, Two = 2 } void main(){ writeln( std.conv.to!string( Values.One ) ); } [/code] Output is "One". casting works, but to be able to cast correctly, I need to tell compiler that it is "ubyte". Isn't there any NON-HACK

Merry Christmas

2015-12-23 Thread steven kladitis via Digitalmars-d-learn
Twas the Night before Christmas and all through my D code. The compiler was compiling the new and the olde. Thanks to Walter, Alexander and Ali. I try to write more D code with happiness and Glee. In the forums with help from folks like me galore. I find I am not crazy, just need to learn more. S

Re: How is D doing?

2015-12-23 Thread D via Digitalmars-d-learn
I'm doing quite well, thank you.

Re: Convert to string an enum item

2015-12-23 Thread Alex Parrill via Digitalmars-d-learn
On Wednesday, 23 December 2015 at 13:11:28 UTC, tcak wrote: [code] import std.stdio; import std.conv; enum Values: ubyte{ One = 1, Two = 2 } void main(){ writeln( std.conv.to!string( Values.One ) ); } [/code] Output is "One". casting works, but to be able to cast correctly, I need to

Re: Convert to string an enum item

2015-12-23 Thread Meta via Digitalmars-d-learn
On Wednesday, 23 December 2015 at 17:43:52 UTC, Alex Parrill wrote: On Wednesday, 23 December 2015 at 13:11:28 UTC, tcak wrote: [code] import std.stdio; import std.conv; enum Values: ubyte{ One = 1, Two = 2 } void main(){ writeln( std.conv.to!string( Values.One ) ); } [/code] Output i

Re: Convert to string an enum item

2015-12-23 Thread Meta via Digitalmars-d-learn
On Wednesday, 23 December 2015 at 17:43:52 UTC, Alex Parrill wrote: On Wednesday, 23 December 2015 at 13:11:28 UTC, tcak wrote: [code] import std.stdio; import std.conv; enum Values: ubyte{ One = 1, Two = 2 } void main(){ writeln( std.conv.to!string( Values.One ) ); } [/code] Output i

Graphics/font/platform backends with common interfaces?

2015-12-23 Thread Taylor Hillegeist via Digitalmars-d-learn
So I have seen alot of projects that need the same sort of stuff. graphics libraries gui libraries game libraries ploting libaries they would all benefit from a backend solution with a common interface for color fonts drawing pen_style aliasing etc. but each one i look at seems to have a bui

Re: Multiple selective imports on one line

2015-12-23 Thread earthfront via Digitalmars-d-learn
On Wednesday, 23 December 2015 at 11:12:22 UTC, ZombineDev wrote: Actually array() is from sts.array and correct way to use selective imports is: import std.exception : enforce; import std.array : array; import std.algorithm.iteration : filter; import std.functional : memoize; If you want to im

Re: Multiple selective imports on one line

2015-12-23 Thread earthfront via Digitalmars-d-learn
On Wednesday, 23 December 2015 at 11:00:19 UTC, Jakob Ovrum wrote: On Wednesday, 23 December 2015 at 10:51:52 UTC, earthfront wrote: Now I'm left with a smattering of lines which are just selective imports from a single module: import std.exception:enforce; import std.algorithm:array; imp

Re: Graphics/font/platform backends with common interfaces?

2015-12-23 Thread rumbu via Digitalmars-d-learn
On Wednesday, 23 December 2015 at 19:22:01 UTC, Taylor Hillegeist wrote: So I have seen alot of projects that need the same sort of stuff. graphics libraries gui libraries game libraries ploting libaries they would all benefit from a backend solution with a common interface for color fonts

Re: Graphics/font/platform backends with common interfaces?

2015-12-23 Thread Taylor Hillegeist via Digitalmars-d-learn
On Wednesday, 23 December 2015 at 20:23:25 UTC, rumbu wrote: On Wednesday, 23 December 2015 at 19:22:01 UTC, Taylor It was an initiative, but it looks abandoned now (Aurora Graphics): Thread: http://forum.dlang.org/thread/op.w9w0efr1707...@invictus.hra.local Source Code: https://github.com/au

Re: Graphics/font/platform backends with common interfaces?

2015-12-23 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 23 December 2015 at 20:49:21 UTC, Taylor Hillegeist wrote: | GRAPICS LIB | +---+---+---+ <- what is this interface |SDL|GDI|OPENGL.| +---+---+---+ SDL, GDI, and OpenGL *are* graphics libs so it seems a bit silly to put an interface there.

Re: Graphics/font/platform backends with common interfaces?

2015-12-23 Thread Taylor Hillegeist via Digitalmars-d-learn
On Wednesday, 23 December 2015 at 20:52:05 UTC, Adam D. Ruppe wrote: On Wednesday, 23 December 2015 at 20:49:21 UTC, Taylor Hillegeist wrote: | GRAPICS LIB | +---+---+---+ <- what is this interface |SDL|GDI|OPENGL.| +---+---+---+ SDL, GDI, and OpenGL *are* graphics libs so it see

Re: Multiple selective imports on one line

2015-12-23 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 23 December 2015 at 19:34:26 UTC, earthfront wrote: On Wednesday, 23 December 2015 at 11:00:19 UTC, Jakob Ovrum wrote: [...] My goal is to import several symbols from different modules on one line. I'm trying to figure out if it's possible or not. It makes the code more concise

Re: Graphics/font/platform backends with common interfaces?

2015-12-23 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 23 December 2015 at 20:52:05 UTC, Adam D. Ruppe wrote: On Wednesday, 23 December 2015 at 20:49:21 UTC, Taylor Hillegeist wrote: | GRAPICS LIB | +---+---+---+ <- what is this interface |SDL|GDI|OPENGL.| +---+---+---+ SDL, GDI, and OpenGL *are* graphics libs so it see

Re: Graphics/font/platform backends with common interfaces?

2015-12-23 Thread Taylor Hillegeist via Digitalmars-d-learn
On Wednesday, 23 December 2015 at 20:57:27 UTC, Taylor Hillegeist wrote: On Wednesday, 23 December 2015 at 20:52:05 UTC, Adam D. Ruppe wrote: On Wednesday, 23 December 2015 at 20:49:21 UTC, Taylor Hillegeist wrote: | GRAPICS LIB | +---+---+---+ <- what is this interface |SDL|GDI|OPENG

Re: Graphics/font/platform backends with common interfaces?

2015-12-23 Thread Taylor Hillegeist via Digitalmars-d-learn
On Wednesday, 23 December 2015 at 21:07:12 UTC, Basile B. wrote: On Wednesday, 23 December 2015 at 20:52:05 UTC, Adam D. Ruppe wrote: [...] yes silly, more specially as - some of them are 2D with FP coordinates - some of them are 2D with integral coordinates - some of them are 2D with integra

Re: Graphics/font/platform backends with common interfaces?

2015-12-23 Thread Taylor Hillegeist via Digitalmars-d-learn
On Wednesday, 23 December 2015 at 21:12:11 UTC, Taylor Hillegeist wrote: On Wednesday, 23 December 2015 at 21:07:12 UTC, Basile B. wrote: [...] Thanks for letting me know! So is what your saying is that an common interface is not possible or practical or perhaps useful? Also wouldn't the le

Re: Graphics/font/platform backends with common interfaces?

2015-12-23 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 23 December 2015 at 21:12:11 UTC, Taylor Hillegeist wrote: On Wednesday, 23 December 2015 at 21:07:12 UTC, Basile B. wrote: [...] Thanks for letting me know! So is what your saying is that an common interface is not possible or practical or perhaps useful? It's possible but it

Re: Graphics/font/platform backends with common interfaces?

2015-12-23 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 23 December 2015 at 21:19:14 UTC, Taylor Hillegeist wrote: On Wednesday, 23 December 2015 at 21:12:11 UTC, Taylor Hillegeist wrote: On Wednesday, 23 December 2015 at 21:07:12 UTC, Basile B. wrote: [...] Thanks for letting me know! So is what your saying is that an common interf

Re: Multiple selective imports on one line

2015-12-23 Thread ZombineDev via Digitalmars-d-learn
On Wednesday, 23 December 2015 at 19:27:31 UTC, earthfront wrote: On Wednesday, 23 December 2015 at 11:12:22 UTC, ZombineDev wrote: Actually array() is from sts.array and correct way to use selective imports is: import std.exception : enforce; import std.array : array; import std.algorithm.iter

Re: Most performant way of converting int to string

2015-12-23 Thread Andrew Chapman via Digitalmars-d-learn
On Wednesday, 23 December 2015 at 11:46:37 UTC, Jakob Ovrum wrote: On Wednesday, 23 December 2015 at 11:21:32 UTC, Jakob Ovrum wrote: Dynamic memory allocation is expensive. If the string is short-lived, allocate it on the stack: See also std.conv.toChars[1] for stringifying lazily/on-demand.

Re: Most performant way of converting int to string

2015-12-23 Thread Ali Çehreli via Digitalmars-d-learn
On 12/23/2015 02:29 PM, Andrew Chapman wrote: > string v = toChars!(16,char,LetterCase.lower)(i); > > to convert an integer to Hex for example, but the compiler wasn't happy > with it. How would I convert an int to a string using this? I had to squint at the error message to understand that the

Re: Graphics/font/platform backends with common interfaces?

2015-12-23 Thread Rikki Cattermole via Digitalmars-d-learn
On 24/12/15 8:22 AM, Taylor Hillegeist wrote: So I have seen alot of projects that need the same sort of stuff. graphics libraries gui libraries game libraries ploting libaries they would all benefit from a backend solution with a common interface for color fonts drawing pen_style aliasing etc

Re: How is D doing?

2015-12-23 Thread rsw0x via Digitalmars-d-learn
On Tuesday, 22 December 2015 at 21:38:22 UTC, ZombineDev wrote: On Tuesday, 22 December 2015 at 17:49:34 UTC, Jakob Jenkov wrote: On Tuesday, 22 December 2015 at 03:30:32 UTC, ShinraTensei wrote: I recently noticed massive increase in new languages for a person to jump into(Nim, Rust, Go...etc)

Re: How is D doing?

2015-12-23 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Thursday, 24 December 2015 at 00:16:16 UTC, rsw0x wrote: restrict it to 'programming' to get a more accurate assessment of D. https://google.com/trends/explore#cat=0-5-31&q=%2Fm%2F01kbt7%2C%20%2Fm%2F0dsbpg6%2C%20%2Fm%2F091hdj%2C%20%2Fm%2F03j_q&date=1%2F2010%2061m&cmpt=q&tz=Etc%2FGMT-2 remove

What's wrong with my debugger?

2015-12-23 Thread Chris via Digitalmars-d-learn
Please see the linked screenshot: http://i.imgur.com/SpkXu5m.png As you can see, the inside, outside and collision arrays don't seem to work with the debugger. They show a bogus lenght and a bogus memory address. Extracting the lenghts to separate variables outl, insl and coll show that the ar

Re: Graphics/font/platform backends with common interfaces?

2015-12-23 Thread Taylor Hillegeist via Digitalmars-d-learn
On Wednesday, 23 December 2015 at 23:34:58 UTC, Rikki Cattermole wrote: On 24/12/15 8:22 AM, Taylor Hillegeist wrote: [...] So far I've been implementing windowing and image libraries for Phobos. Right now windowing works on Windows minice eventing. Once eventing is done it is ready for the

Re: Graphics/font/platform backends with common interfaces?

2015-12-23 Thread Rikki Cattermole via Digitalmars-d-learn
On 24/12/15 4:03 PM, Taylor Hillegeist wrote: On Wednesday, 23 December 2015 at 23:34:58 UTC, Rikki Cattermole wrote: On 24/12/15 8:22 AM, Taylor Hillegeist wrote: [...] So far I've been implementing windowing and image libraries for Phobos. Right now windowing works on Windows minice eventin

Re: How is D doing?

2015-12-23 Thread Craig Dillabaugh via Digitalmars-d-learn
On Thursday, 24 December 2015 at 00:16:16 UTC, rsw0x wrote: On Tuesday, 22 December 2015 at 21:38:22 UTC, ZombineDev wrote: On Tuesday, 22 December 2015 at 17:49:34 UTC, Jakob Jenkov wrote: clip removed C++ because it just dwarfs the others. D, as I expected, has a massive following in Japan

Re: How is D doing?

2015-12-23 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Dec 24, 2015 at 12:16:16AM +, rsw0x via Digitalmars-d-learn wrote: [...] > D, as I expected, has a massive following in Japan. I'm still not > quite sure why. Maybe because one of the most prolific contributors to D, esp. to dmd, (and by far) happens to be from Japan? T -- Many ope

Re: How is D doing?

2015-12-23 Thread rsw0x via Digitalmars-d-learn
On Thursday, 24 December 2015 at 06:10:55 UTC, H. S. Teoh wrote: On Thu, Dec 24, 2015 at 12:16:16AM +, rsw0x via Digitalmars-d-learn wrote: [...] D, as I expected, has a massive following in Japan. I'm still not quite sure why. Maybe because one of the most prolific contributors to D, esp.

Re: How is D doing?

2015-12-23 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Dec 24, 2015 at 07:19:20AM +, rsw0x via Digitalmars-d-learn wrote: > On Thursday, 24 December 2015 at 06:10:55 UTC, H. S. Teoh wrote: > >On Thu, Dec 24, 2015 at 12:16:16AM +, rsw0x via Digitalmars-d-learn > >wrote: [...] > >>D, as I expected, has a massive following in Japan. I'm st

Re: Most performant way of converting int to string

2015-12-23 Thread Minas Mina via Digitalmars-d-learn
On Wednesday, 23 December 2015 at 22:29:31 UTC, Andrew Chapman wrote: On Wednesday, 23 December 2015 at 11:46:37 UTC, Jakob Ovrum wrote: On Wednesday, 23 December 2015 at 11:21:32 UTC, Jakob Ovrum wrote: Dynamic memory allocation is expensive. If the string is short-lived, allocate it on the st