Re: SDL and new Thread open two windows

2017-09-01 Thread SrMordred via Digitalmars-d-learn
On Saturday, 2 September 2017 at 03:47:24 UTC, Adam D. Ruppe wrote: On Saturday, 2 September 2017 at 03:41:47 UTC, SrMordred wrote: Whats going on , and how to prevent this ? Are you using a static this anywhere? Hm, right. I was constructing the window there. Forgot that static this will

Re: SDL and new Thread open two windows

2017-09-01 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 2 September 2017 at 03:41:47 UTC, SrMordred wrote: Whats going on , and how to prevent this ? Are you using a static this anywhere?

SDL and new Thread open two windows

2017-09-01 Thread SrMordred via Digitalmars-d-learn
Im using SDL2 with derelict, on ubuntu. Last DMD. When using spawn or new Thread like : spawn( (){ while(true){ Thread.sleep(500.msecs); }); the program open two SDL windows. Whats going on , and how to prevent this ?

Re: 24-bit int

2017-09-01 Thread EntangledQuanta via Digitalmars-d-learn
On Saturday, 2 September 2017 at 02:37:08 UTC, Mike Parker wrote: On Saturday, 2 September 2017 at 01:19:52 UTC, EntangledQuanta wrote: The whole point is so that there is no wasted space, so if it requires that then it's not a waste of space but a bug. Audio that is in24 is 3 bytes per

Re: 24-bit int

2017-09-01 Thread EntangledQuanta via Digitalmars-d-learn
On Saturday, 2 September 2017 at 02:49:41 UTC, Ilya Yaroshenko wrote: On Friday, 1 September 2017 at 19:39:14 UTC, EntangledQuanta wrote: Is there a way to create a 24-bit int? One that for all practical purposes acts as such? This is for 24-bit stuff like audio. It would respect endianness,

Re: Release D 2.076.0

2017-09-01 Thread Yuxuan Shui via Digitalmars-d-announce
On Friday, 1 September 2017 at 14:03:26 UTC, Martin Nowak wrote: Glad to announce D 2.076.0. This release comes with static foreach, many -betterC enhancements, various phobos additions, an -mcpu=avx2 switch, and lots of bugfixes. Thanks to everyone involved in this .

Re: 24-bit int

2017-09-01 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Friday, 1 September 2017 at 19:39:14 UTC, EntangledQuanta wrote: Is there a way to create a 24-bit int? One that for all practical purposes acts as such? This is for 24-bit stuff like audio. It would respect endianness, allow for arrays int24[] that work properly, etc. Hi, Probably you

Re: 24-bit int

2017-09-01 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 2 September 2017 at 01:19:52 UTC, EntangledQuanta wrote: The whole point is so that there is no wasted space, so if it requires that then it's not a waste of space but a bug. Audio that is in24 is 3 bytes per sample, not 4. Every 3 bytes are a sample, not every 3 out of 4.

Re: Template substitution for function parameters

2017-09-01 Thread Nicholas Wilson via Digitalmars-d-learn
On Friday, 1 September 2017 at 11:33:15 UTC, Biotronic wrote: On Friday, 1 September 2017 at 10:15:09 UTC, Nicholas Wilson wrote: So I have the following types struct DevicePointer(T) { T* ptr; } struct Buffer(T) { void* driverObject; T[] hostMemory; } and a function auto

Re: replace switch for mapping

2017-09-01 Thread EntangledQuanta via Digitalmars-d-learn
I came up with a library solution that isn't pretty ;/ I offer it up to the gods, but being gods, they probably don't care. template EnumMapper(alias func, string[] args, eT...) { import std.meta, std.typecons, std.traits, std.string, std.algorithm, std.array, std.conv; private

Re: 24-bit int

2017-09-01 Thread EntangledQuanta via Digitalmars-d-learn
On Saturday, 2 September 2017 at 00:43:00 UTC, Nicholas Wilson wrote: On Friday, 1 September 2017 at 22:10:43 UTC, Biotronic wrote: On Friday, 1 September 2017 at 19:39:14 UTC, EntangledQuanta wrote: Is there a way to create a 24-bit int? One that for all practical purposes acts as such? This

Re: 24-bit int

2017-09-01 Thread Nicholas Wilson via Digitalmars-d-learn
On Friday, 1 September 2017 at 22:10:43 UTC, Biotronic wrote: On Friday, 1 September 2017 at 19:39:14 UTC, EntangledQuanta wrote: Is there a way to create a 24-bit int? One that for all practical purposes acts as such? This is for 24-bit stuff like audio. It would respect endianness, allow for

Re: Release D 2.076.0

2017-09-01 Thread Mike Parker via Digitalmars-d-announce
On Friday, 1 September 2017 at 17:49:59 UTC, Ali Çehreli wrote: On 09/01/2017 09:42 AM, Ali Çehreli wrote: > One more correction: It says "to the conv function template" but the > code uses to!uint. Mike doesn't make it easy: How about changing "comv" to "conv" in the "correction". :o) Ali

Re: Bug in D!!!

2017-09-01 Thread EntangledQuanta via Digitalmars-d-learn
On Friday, 1 September 2017 at 23:25:04 UTC, Jesse Phillips wrote: I've love being able to inherit and override generic functions in C#. Unfortunately C# doesn't use templates and I hit so many other issues where Generics just suck. I don't think it is appropriate to dismiss the need for the

Re: enum pointers or class references limitation

2017-09-01 Thread Timon Gehr via Digitalmars-d
On 02.09.2017 01:37, Q. Schroll wrote: On Friday, 1 September 2017 at 23:13:50 UTC, Q. Schroll wrote: [..] Just as Scott Meyers said: make it easy to use correctly and hard to use incorrectly. Today it's easy to use incorrectly. While enum foo = [1,2,3]; assert(foo is foo); fails,

Re: enum pointers or class references limitation

2017-09-01 Thread Timon Gehr via Digitalmars-d
On 02.09.2017 01:13, Q. Schroll wrote: On Friday, 1 September 2017 at 21:08:20 UTC, Ali Çehreli wrote: [snip] > assert(!([1,2,3] is [1,2,3])); > > Which is exactly what enum expands to and totally expected. Where is the > surprise? This is not a surprise. Array literals are not identical. In

Re: enum pointers or class references limitation

2017-09-01 Thread Q. Schroll via Digitalmars-d
On Friday, 1 September 2017 at 23:13:50 UTC, Q. Schroll wrote: [..] Just as Scott Meyers said: make it easy to use correctly and hard to use incorrectly. Today it's easy to use incorrectly. While enum foo = [1,2,3]; assert(foo is foo); fails, enum bla = "123"; assert(foo is foo);

Re: enum pointers or class references limitation

2017-09-01 Thread Timon Gehr via Digitalmars-d
On 01.09.2017 20:48, Dmitry Olshansky wrote: On Thursday, 31 August 2017 at 14:28:57 UTC, Ali Çehreli wrote: On 08/31/2017 01:52 AM, Nicholas Wilson wrote: I think Timon is referring to: enum int[] foo = [1,2,3]; auto bar = foo; auto baz = foo; assert(!(bar is baz)); // Passes Even

Re: Bug in D!!!

2017-09-01 Thread Jesse Phillips via Digitalmars-d-learn
I've love being able to inherit and override generic functions in C#. Unfortunately C# doesn't use templates and I hit so many other issues where Generics just suck. I don't think it is appropriate to dismiss the need for the compiler to generate a virtual function for every instantiated T,

[Issue 17799] New: Disallow enum with indirections

2017-09-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17799 Issue ID: 17799 Summary: Disallow enum with indirections Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P1

Re: enum pointers or class references limitation

2017-09-01 Thread Q. Schroll via Digitalmars-d
On Friday, 1 September 2017 at 21:08:20 UTC, Ali Çehreli wrote: [snip] > assert(!([1,2,3] is [1,2,3])); > > Which is exactly what enum expands to and totally expected. Where is the > surprise? This is not a surprise. Array literals are not identical. In the surprising case foo is a symbol,

Re: get parameter names

2017-09-01 Thread EntangledQuanta via Digitalmars-d-learn
On Friday, 1 September 2017 at 22:21:18 UTC, Biotronic wrote: On Friday, 1 September 2017 at 20:58:20 UTC, EntangledQuanta wrote: template(A, B...) { auto foo(C...)(C c) { ... get c's parameter names, should be alpha, beta } } foo!(., .)(alpha, beta) I need the actual

Re: 24-bit int

2017-09-01 Thread EntangledQuanta via Digitalmars-d-learn
On Friday, 1 September 2017 at 22:10:43 UTC, Biotronic wrote: On Friday, 1 September 2017 at 19:39:14 UTC, EntangledQuanta wrote: [...] I haven't looked at endianness beyond it working on my computer. If you have special needs in that regard, consider this a starting point: [...]

Re: D as a Better C

2017-09-01 Thread Azi Hassan via Digitalmars-d-announce
On Wednesday, 30 August 2017 at 22:48:45 UTC, Adam D. Ruppe wrote: On Wednesday, 30 August 2017 at 22:22:23 UTC, Azi Hassan wrote: extern(C) int main(int argc, char*[] argv, char*[] env) That's a D array of pointers. A D array is larger than a C "array" argument, thus you're skipping past

Re: get parameter names

2017-09-01 Thread Biotronic via Digitalmars-d-learn
On Friday, 1 September 2017 at 20:58:20 UTC, EntangledQuanta wrote: template(A, B...) { auto foo(C...)(C c) { ... get c's parameter names, should be alpha, beta } } foo!(., .)(alpha, beta) I need the actual identifiers passed to foo. I can get the types(obviously C) but when

Re: Release D 2.076.0

2017-09-01 Thread jmh530 via Digitalmars-d-announce
On Friday, 1 September 2017 at 21:29:08 UTC, Ali wrote: to be clear - Implement DIP 1010 - Static foreach is mentioned twice in the changelog, as points 1 and 6 BetterC is also on there twice.

Re: 24-bit int

2017-09-01 Thread Biotronic via Digitalmars-d-learn
On Friday, 1 September 2017 at 19:39:14 UTC, EntangledQuanta wrote: Is there a way to create a 24-bit int? One that for all practical purposes acts as such? This is for 24-bit stuff like audio. It would respect endianness, allow for arrays int24[] that work properly, etc. I haven't looked at

Re: Help Required on Getopt

2017-09-01 Thread Jon Degenhardt via Digitalmars-d-learn
On Friday, 1 September 2017 at 19:04:39 UTC, Daniel Kozak wrote: I have same issue. How this help you? Catching exception does not help. How do I catch exception and still print help message? Your are correct, sorry about that. What my response showed is how to avoid printing the full stack

Re: Function pointer from mangled name at runtime?

2017-09-01 Thread bitwise via Digitalmars-d
On Friday, 1 September 2017 at 20:27:45 UTC, Jonathan Marler wrote: [...] I think that I may have left out an important piece information. My reflection library allows this: static r = reflect!(my.package.module); This reflects the entire module recursively, including all classes, enums,

[Issue 13568] Support compile-time format strings in std.format

2017-09-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13568 hst...@quickfur.ath.cx changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|FIXED

Re: Release D 2.076.0

2017-09-01 Thread Ali via Digitalmars-d-announce
On Friday, 1 September 2017 at 17:33:26 UTC, Ali wrote: On Friday, 1 September 2017 at 14:03:26 UTC, Martin Nowak wrote: http://dlang.org/changelog/2.076.0.html - -Martin static foreach is so nice, it is implemented twice :) to be clear - Implement DIP 1010 - Static foreach is mentioned

[Issue 17634] variadic overload of std.algorithm.searching.countUntil should return which needle was found

2017-09-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17634 --- Comment #2 from b2.t...@gmx.com --- (In reply to b2.temp from comment #1) > "dropExactly(c).startWith(...)" would allow to find the needle > > also we can imagine a struct-based return type that doesn't break the > current code: > > struct

[Issue 17634] variadic overload of std.algorithm.searching.countUntil should return which needle was found

2017-09-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17634 b2.t...@gmx.com changed: What|Removed |Added CC||b2.t...@gmx.com --- Comment #1 from

Re: get parameter names

2017-09-01 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, September 01, 2017 20:58:20 EntangledQuanta via Digitalmars-d- learn wrote: > template(A, B...) > { > auto foo(C...)(C c) > { > ... get c's parameter names, should be alpha, beta > } > } > > > foo!(., .)(alpha, beta) > > I need the actual identifiers passed to foo. I

[Issue 17706] std.math.isFinite does not compile for cdouble: "No traits support for cdouble"

2017-09-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17706 b2.t...@gmx.com changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 13568] Support compile-time format strings in std.format

2017-09-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13568 b2.t...@gmx.com changed: What|Removed |Added Status|NEW |RESOLVED CC|

Re: enum pointers or class references limitation

2017-09-01 Thread Ali Çehreli via Digitalmars-d
On 09/01/2017 11:48 AM, Dmitry Olshansky wrote: > On Thursday, 31 August 2017 at 14:28:57 UTC, Ali Çehreli wrote: >> On 08/31/2017 01:52 AM, Nicholas Wilson wrote: >> >>> I think Timon is referring to: >>> >>> enum int[] foo = [1,2,3]; >>> >>> auto bar = foo; >>> auto baz = foo; >>> >>>

Easy bug: reference to local variable

2017-09-01 Thread Ali Çehreli via Digitalmars-d-learn
Nothing new here but I almost fell prey to this bug today. Spot the bug: import std.stdio; import std.range; int[3] bar() { return [ 1, 2, 3 ]; } auto foo() { auto a = bar(); return zip(a[], a[]); } void main() { writeln(foo()); } In the real code, bar() was a call to

get parameter names

2017-09-01 Thread EntangledQuanta via Digitalmars-d-learn
template(A, B...) { auto foo(C...)(C c) { ... get c's parameter names, should be alpha, beta } } foo!(., .)(alpha, beta) I need the actual identifiers passed to foo. I can get the types(obviously C) but when I try to get the identifier names(__traits(identifier or other

Re: Function pointer from mangled name at runtime?

2017-09-01 Thread bitwise via Digitalmars-d
On Friday, 1 September 2017 at 20:27:45 UTC, Jonathan Marler wrote: Symbol table is usually used to mean the compiler symbol table, so I'm assuming you mean the "export table" in your binary that contains all the exported symbols. The executable will have an entry for those manged getRTInfo

Re: Function pointer from mangled name at runtime?

2017-09-01 Thread bitwise via Digitalmars-d
On Friday, 1 September 2017 at 20:22:21 UTC, Adam D. Ruppe wrote: On Friday, 1 September 2017 at 20:17:54 UTC, bitwise wrote: So I'm thinking now..is this as easy as just figuring out how it's mangled and calling dlsym()? Yeah, that's what I was thinking. You can use the .mangleof property

Re: C++ / Why Iterators Got It All Wrong

2017-09-01 Thread Mark via Digitalmars-d
On Tuesday, 29 August 2017 at 12:50:08 UTC, Robert M. Münch wrote: Maybe of interest: https://www.think-cell.com/en/career/talks/iterators/#1 I haven't read everything, so not sure if it worth to take a look. Iterators have many problems. Andrei's talk some years ago, titled "Iterators

Re: Function pointer from mangled name at runtime?

2017-09-01 Thread Jonathan Marler via Digitalmars-d
On Friday, 1 September 2017 at 19:49:46 UTC, bitwise wrote: If I have the mangled name of a module-scoped D template function as a string, is there a way to check for it's presence in the symbol table, and retrieve the function pointer at runtime? Example: ` module mine; class Test { } `

Re: Function pointer from mangled name at runtime?

2017-09-01 Thread Adam D. Ruppe via Digitalmars-d
On Friday, 1 September 2017 at 20:17:54 UTC, bitwise wrote: So I'm thinking now..is this as easy as just figuring out how it's mangled and calling dlsym()? Yeah, that's what I was thinking. You can use the .mangleof property to get the mangle

Re: Released vibe.d 0.8.1

2017-09-01 Thread WebFreak001 via Digitalmars-d-announce
On Thursday, 31 August 2017 at 11:56:53 UTC, aberba wrote: On Wednesday, 30 August 2017 at 16:53:40 UTC, Matthias Klumpp wrote: [...] Even with mysql (using mysql-native), the absent of something like struct User { @optional int userName; //its ok if row doesn't have this column

Re: Function pointer from mangled name at runtime?

2017-09-01 Thread bitwise via Digitalmars-d
On Friday, 1 September 2017 at 19:49:46 UTC, bitwise wrote: [...] oddly, this seems to compile: extern(C) T foo(T)() { return T.init; } So I'm thinking now..is this as easy as just figuring out how it's mangled and calling dlsym()?

Re: Simplest multithreading example

2017-09-01 Thread ag0aep6g via Digitalmars-d-learn
On 09/01/2017 07:27 AM, Brian wrote: double [] hugeCalc(int i){ // Code that takes a long time } so if I do double[][int] _hugeCalcCache; foreach(i ; I) _hugeCalcCache[i] = hugeCalc(i); of course the required time is I.length * (a long time), so I wanted to shorten this by

Function pointer from mangled name at runtime?

2017-09-01 Thread bitwise via Digitalmars-d
If I have the mangled name of a module-scoped D template function as a string, is there a way to check for it's presence in the symbol table, and retrieve the function pointer at runtime? Example: ` module mine; class Test { } ` ` module reflection; class RuntimeInfo { string name(); }

Re: Bug in D!!!

2017-09-01 Thread EntangledQuanta via Digitalmars-d-learn
This happens when building, not running. This might be a Visual D issue as when I use dmd from the command line, it works fine ;/

24-bit int

2017-09-01 Thread EntangledQuanta via Digitalmars-d-learn
Is there a way to create a 24-bit int? One that for all practical purposes acts as such? This is for 24-bit stuff like audio. It would respect endianness, allow for arrays int24[] that work properly, etc.

Re: Bug in D!!!

2017-09-01 Thread EntangledQuanta via Digitalmars-d-learn
On Friday, 1 September 2017 at 19:25:53 UTC, Adam D Ruppe wrote: On Friday, 1 September 2017 at 18:17:22 UTC, EntangledQuanta wrote: I get an access violation, changed the code to What is the rest of your code? access violation usually means you didn't new the class... No, that is the

[Issue 10930] std.array.replace cannot simple replace an element in array

2017-09-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=10930 --- Comment #6 from Temtaime --- I don't see a reason why single element cannot be replaced For example, both this examples works: [1, 2].split([1]); [1, 2].split(1); --

Re: Bug in D!!!

2017-09-01 Thread Adam D Ruppe via Digitalmars-d-learn
On Friday, 1 September 2017 at 18:17:22 UTC, EntangledQuanta wrote: I get an access violation, changed the code to What is the rest of your code? access violation usually means you didn't new the class...

Re: Help Required on Getopt

2017-09-01 Thread Daniel Kozak via Digitalmars-d-learn
I have same issue. How this help you? Catching exception does not help. How do I catch exception and still print help message? Dne 1. 9. 2017 8:10 odpoledne napsal uživatel "Vino.B via Digitalmars-d-learn" : On Friday, 1 September 2017 at 17:23:01 UTC, Jon

Re: enum pointers or class references limitation

2017-09-01 Thread Dmitry Olshansky via Digitalmars-d
On Thursday, 31 August 2017 at 14:28:57 UTC, Ali Çehreli wrote: On 08/31/2017 01:52 AM, Nicholas Wilson wrote: I think Timon is referring to: enum int[] foo = [1,2,3]; auto bar = foo; auto baz = foo; assert(!(bar is baz)); // Passes Even better: enum int[] foo = [1,2,3];

Re: Bug in D!!!

2017-09-01 Thread EntangledQuanta via Digitalmars-d-learn
On Friday, 1 September 2017 at 15:24:39 UTC, Adam D. Ruppe wrote: static foreach is now in the new release! You can now do stuff like: --- alias I(A...) = A; interface Foo { static foreach(T; I!(int, float)) void set(T t); // define virt funcs for a list of types }

Re: Help Required on Getopt

2017-09-01 Thread Vino.B via Digitalmars-d-learn
On Friday, 1 September 2017 at 17:23:01 UTC, Jon Degenhardt wrote: On Friday, 1 September 2017 at 13:13:39 UTC, Vino.B wrote: Hi All, When i run the below program without any arguments "D1.d -r" it is throwing error, but i need it to show the help menu [snip...] Hi Vino, To get good

Re: traits for function having actual source declaration?

2017-09-01 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, September 01, 2017 14:38:38 bitwise via Digitalmars-d-learn wrote: > When I'm using __traits(allMembers), I get a all the invisible > functions added by the compiler as well "__ctor", "__xdtor", > "__cpctor", etc.. > > Is there a way to filter them out? You can use std.meta.Filter if

Re: Simplest multithreading example

2017-09-01 Thread Ali Çehreli via Digitalmars-d-learn
On 08/31/2017 10:27 PM, Brian wrote: > the 'real' problem is trying > to split a huge calculation to different threads. I still think you can take advantage of std.parallelism: https://dlang.org/phobos/std_parallelism.html Unfortunately, its features like asyncBuf, map, and amap do not

Re: traits for function having actual source declaration?

2017-09-01 Thread bitwise via Digitalmars-d-learn
On Friday, 1 September 2017 at 17:26:11 UTC, ketmar wrote: [...] they *should* listen. anyone who doesn't just aksing for troubles, and i see no reason to guard 'em further. Yeah...eventually came to the same conclusion ;) Thanks

Re: Release D 2.076.0

2017-09-01 Thread Ali Çehreli via Digitalmars-d-announce
On 09/01/2017 09:42 AM, Ali Çehreli wrote: > One more correction: It says "to the conv function template" but the > code uses to!uint. Mike doesn't make it easy: How about changing "comv" to "conv" in the "correction". :o) Ali

Re: Release D 2.076.0

2017-09-01 Thread Ali via Digitalmars-d-announce
On Friday, 1 September 2017 at 14:03:26 UTC, Martin Nowak wrote: Glad to announce D 2.076.0. This release comes with static foreach, many -betterC enhancements, various phobos additions, an -mcpu=avx2 switch, and lots of bugfixes. Thanks to everyone involved in this .

Re: traits for function having actual source declaration?

2017-09-01 Thread ketmar via Digitalmars-d-learn
bitwise wrote: On Friday, 1 September 2017 at 14:38:38 UTC, bitwise wrote: When I'm using __traits(allMembers), I get a all the invisible functions added by the compiler as well "__ctor", "__xdtor", "__cpctor", etc.. Is there a way to filter them out? dlang's "Lexical" page says:

Re: Help Required on Getopt

2017-09-01 Thread Jon Degenhardt via Digitalmars-d-learn
On Friday, 1 September 2017 at 13:13:39 UTC, Vino.B wrote: Hi All, When i run the below program without any arguments "D1.d -r" it is throwing error, but i need it to show the help menu [snip...] Hi Vino, To get good error message behavior you need to put the construct in a try-catch

[Issue 17798] [2.076] "static foreach" not documented

2017-09-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17798 Walter Bright changed: What|Removed |Added CC|

Re: Release D 2.076.0

2017-09-01 Thread Ali Çehreli via Digitalmars-d-announce
On 09/01/2017 09:34 AM, Mike Parker wrote: Good catch. Thanks! Great piece Mike! One more correction: It says "to the conv function template" but the code uses to!uint. Ali

Re: Release D 2.076.0

2017-09-01 Thread Mike Parker via Digitalmars-d-announce
On Friday, 1 September 2017 at 16:16:03 UTC, Joakim wrote: Nice writeup of the major features of this release, think it really helps. Typo in blog post - dramtically Good catch. Thanks! Also, changelog still lists this as a beta, to be released. There was an issue with rebuilding the

Re: Release D 2.076.0

2017-09-01 Thread Joakim via Digitalmars-d-announce
On Friday, 1 September 2017 at 15:24:57 UTC, Mike Parker wrote: On Friday, 1 September 2017 at 14:03:26 UTC, Martin Nowak wrote: Glad to announce D 2.076.0. Blogged and reddited: https://dlang.org/blog/2017/09/01/dmd-2-076-0-released/

Re: Release D 2.076.0

2017-09-01 Thread Mike Parker via Digitalmars-d-announce
On Friday, 1 September 2017 at 14:03:26 UTC, Martin Nowak wrote: Glad to announce D 2.076.0. Blogged and reddited: https://dlang.org/blog/2017/09/01/dmd-2-076-0-released/ https://www.reddit.com/r/programming/comments/6xf77f/version_20760_of_dmd_the_d_reference_compiler/

Re: Bug in D!!!

2017-09-01 Thread Adam D. Ruppe via Digitalmars-d-learn
static foreach is now in the new release! You can now do stuff like: --- alias I(A...) = A; interface Foo { static foreach(T; I!(int, float)) void set(T t); // define virt funcs for a list of types } class Ass : Foo { static foreach(T; I!(int, float))

Re: vibed services stop response after several days of work

2017-09-01 Thread Mike Wey via Digitalmars-d-learn
On 01-09-17 10:01, Suliman wrote: I got same problem on Windows Server 2016 and on Linux Debian 8.5. I have few very simple backend based on vibed 0.8.1, compiler dmd 2.075.1. nginx servise is do port forwarding. Nothing more is used. After several days of working I am begining to get "502 Bad

Re: vibed services stop response after several days of work

2017-09-01 Thread Suliman via Digitalmars-d-learn
It's seems that it's error in libevent on Linux. I tried to add to dub.sdl: versions "libasync" and it's seems that not it's working (but I need more time to test).

Re: traits for function having actual source declaration?

2017-09-01 Thread bitwise via Digitalmars-d-learn
On Friday, 1 September 2017 at 14:38:38 UTC, bitwise wrote: When I'm using __traits(allMembers), I get a all the invisible functions added by the compiler as well "__ctor", "__xdtor", "__cpctor", etc.. Is there a way to filter them out? dlang's "Lexical" page says: "Identifiers starting

traits for function having actual source declaration?

2017-09-01 Thread bitwise via Digitalmars-d-learn
When I'm using __traits(allMembers), I get a all the invisible functions added by the compiler as well "__ctor", "__xdtor", "__cpctor", etc.. Is there a way to filter them out?

[Issue 16230] core.atomic.atomicLoad removes shared from aggregate types too eagerly

2017-09-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16230 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 16230] core.atomic.atomicLoad removes shared from aggregate types too eagerly

2017-09-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16230 --- Comment #4 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/druntime https://github.com/dlang/druntime/commit/7efd0fe5093ac75bf10065f1d3e7951abcc2b334 fix issue 16230 - core.atomic.atomicLoad removes

Release D 2.076.0

2017-09-01 Thread Martin Nowak via Digitalmars-d-announce
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Glad to announce D 2.076.0. This release comes with static foreach, many -betterC enhancements, various phobos additions, an -mcpu=avx2 switch, and lots of bugfixes. Thanks to everyone involved in this . http://dlang.org/download.html

[Issue 17581] Document behavior of -betterC

2017-09-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17581 --- Comment #3 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/dlang/dlang.org https://github.com/dlang/dlang.org/commit/1fb448587c174137b4e66d6b68313f3f1bdf5808 Merge pull request #1796 from wilzbach/fix-17581

Help Required on Getopt

2017-09-01 Thread Vino.B via Digitalmars-d-learn
Hi All, When i run the below program without any arguments "D1.d -r" it is throwing error, but i need it to show the help menu Program: import std.stdio; import std.getopt; string r; void main (string[] args) { getopt(args, std.getopt.config.caseInsensitive,

Re: Valid File Path

2017-09-01 Thread Vino.B via Digitalmars-d-learn
On Thursday, 31 August 2017 at 23:45:01 UTC, Jonathan M Davis wrote: On Thursday, August 31, 2017 23:23:17 Vino via Digitalmars-d-learn wrote: [...] And why would that not be valid? isValidPath and isValidFilename are quite specific about what they think are valid path/file names, and

[Issue 17581] Document behavior of -betterC

2017-09-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17581 --- Comment #2 from github-bugzi...@puremagic.com --- Commit pushed to stable at https://github.com/dlang/dlang.org https://github.com/dlang/dlang.org/commit/1fb448587c174137b4e66d6b68313f3f1bdf5808 Merge pull request #1796 from wilzbach/fix-17581

Re: gcd with doubles

2017-09-01 Thread Moritz Maxeiner via Digitalmars-d-learn
On Friday, 1 September 2017 at 09:33:08 UTC, Alex wrote: On Sunday, 27 August 2017 at 23:13:24 UTC, Moritz Maxeiner wrote: On Sunday, 27 August 2017 at 19:47:59 UTC, Alex wrote: [...] To expand on the earlier workaround: You can also adapt a floating point to string algorithm in order to

Re: Template substitution for function parameters

2017-09-01 Thread Nicholas Wilson via Digitalmars-d-learn
On Friday, 1 September 2017 at 11:33:15 UTC, Biotronic wrote: On Friday, 1 September 2017 at 10:15:09 UTC, Nicholas Wilson wrote: So I have the following types struct DevicePointer(T) { T* ptr; } struct Buffer(T) { void* driverObject; T[] hostMemory; } and a function auto

Re: Template substitution for function parameters

2017-09-01 Thread Biotronic via Digitalmars-d-learn
On Friday, 1 September 2017 at 10:15:09 UTC, Nicholas Wilson wrote: So I have the following types struct DevicePointer(T) { T* ptr; } struct Buffer(T) { void* driverObject; T[] hostMemory; } and a function auto enqueue(alias k)(HostArgsOf!k) { ... } where k would be a function like

Re: Template substitution for function parameters

2017-09-01 Thread Nicholas Wilson via Digitalmars-d-learn
On Friday, 1 September 2017 at 10:58:51 UTC, user1234 wrote: On Friday, 1 September 2017 at 10:15:09 UTC, Nicholas Wilson wrote: So I have the following types ... i.e. it substitutes the template DevicePointer for the template Buffer in Parameters!foo, The templates can be assumed to not be

Re: Bug in D!!!

2017-09-01 Thread Biotronic via Digitalmars-d-learn
On Thursday, 31 August 2017 at 15:48:12 UTC, EntangledQuanta wrote: On Thursday, 31 August 2017 at 10:34:14 UTC, Kagamin wrote: On Thursday, 31 August 2017 at 00:49:22 UTC, EntangledQuanta wrote: I've already implemented a half ass library solution. It can be improved alot. Then, by all

Re: Template substitution for function parameters

2017-09-01 Thread user1234 via Digitalmars-d-learn
On Friday, 1 September 2017 at 10:15:09 UTC, Nicholas Wilson wrote: So I have the following types ... i.e. it substitutes the template DevicePointer for the template Buffer in Parameters!foo, The templates can be assumed to not be nested templates, i.e. DevicePointer!(DevicePointer!(float))

Re: vibed services stop response after several days of work

2017-09-01 Thread Suliman via Digitalmars-d-learn
On Friday, 1 September 2017 at 08:01:24 UTC, Suliman wrote: I got same problem on Windows Server 2016 and on Linux Debian 8.5. I have few very simple backend based on vibed 0.8.1, compiler dmd 2.075.1. nginx servise is do port forwarding. Nothing more is used. After several days of working I

Re: Synax for variadic template

2017-09-01 Thread Alex via Digitalmars-d-learn
On Friday, 1 September 2017 at 10:01:16 UTC, Nicholas Wilson wrote: b.arr refers to an `(AliasSeq!(int, double))[]`, so with `b.arr[0] ~= 5;` you are trying to append a integer to an array of pairs of ints and doubles, which you can't do. b.arr[0] ~= ElementType!(typeof(b.arr))(5,42.0);

Re: D on Tiobe Index

2017-09-01 Thread Vadim Lopatin via Digitalmars-d-announce
On Thursday, 31 August 2017 at 14:57:28 UTC, bitwise wrote: What I would most like to see in the future would be a more complete and simplified set of tools for D. I believe there should be at least one full-featured tool for each operating system, which includes syntax highlighting,

Template substitution for function parameters

2017-09-01 Thread Nicholas Wilson via Digitalmars-d-learn
So I have the following types struct DevicePointer(T) { T* ptr; } struct Buffer(T) { void* driverObject; T[] hostMemory; } and a function auto enqueue(alias k)(HostArgsOf!k) { ... } where k would be a function like void foo( DevicePointer!float a, float b , int c) { ... } How can I

Re: Synax for variadic template

2017-09-01 Thread Nicholas Wilson via Digitalmars-d-learn
On Friday, 1 September 2017 at 09:38:59 UTC, Alex wrote: Hi all! Say, I have struct A(T...) { T arr; } struct B(T...) { T[] arr; } void main() { A!(int[], double[]) a; a.arr[0] ~= 5; a.arr[0] ~= 6; static assert(!__traits(compiles, a.arr[0] ~=

[Issue 9682] Propagate range sortedness property throughout Phobos algorithms

2017-09-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=9682 --- Comment #3 from ZombineDev --- (Reopening, as per my comments here: https://github.com/dlang/phobos/pull/5712#issuecomment-326535098) --

[Issue 17666] std.c.linux.socket has no replacement

2017-09-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17666 --- Comment #9 from Jonathan M Davis --- (In reply to Sebastiaan Koppe from comment #8) > Finally had some time to take a look. Pretty awesome. Thanks. > > But why in core.sys.linux.netinet.in_ is some stuff behind

Synax for variadic template

2017-09-01 Thread Alex via Digitalmars-d-learn
Hi all! Say, I have struct A(T...) { T arr; } struct B(T...) { T[] arr; } void main() { A!(int[], double[]) a; a.arr[0] ~= 5; a.arr[0] ~= 6; static assert(!__traits(compiles, a.arr[0] ~= 3.5)); a.arr[1] ~= 19.8;

Re: gcd with doubles

2017-09-01 Thread Alex via Digitalmars-d-learn
On Sunday, 27 August 2017 at 23:13:24 UTC, Moritz Maxeiner wrote: On Sunday, 27 August 2017 at 19:47:59 UTC, Alex wrote: [...] To expand on the earlier workaround: You can also adapt a floating point to string algorithm in order to dynamically determine an upper bound on the number of after

[Issue 9682] Propagate range sortedness property throughout Phobos algorithms

2017-09-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=9682 ZombineDev changed: What|Removed |Added Status|RESOLVED|REOPENED

Re: GitBook about D on embedded ARM Linux

2017-09-01 Thread aberba via Digitalmars-d-announce
On Thursday, 31 August 2017 at 14:43:22 UTC, thinwybk wrote: There is no single point of entry to find information about how to use D on ARM Linux. I created a small project on GitHub https://github.com/fkromer/d-on-embedded-linux-arm which shall enable absolute beginners (of embedded Linux

Re: Parse tree node allocator

2017-09-01 Thread Per Nordlöw via Digitalmars-d-learn
On Thursday, 31 August 2017 at 15:55:26 UTC, Stefan Koch wrote: On Thursday, 31 August 2017 at 15:43:05 UTC, Per Nordlöw wrote: Which allocator is best suited for allocating tree nodes (all of equal size around 40-60 bytes in size) in one shot and then delete them all in one go? My use case is

[Issue 9682] group(SortedRange) ==> SortedRange, filter(SortedRange) ==> SortedRange

2017-09-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=9682 RazvanN changed: What|Removed |Added Status|NEW |RESOLVED

  1   2   >