Re: The Mystery of the Misbehaved Malloc

2016-07-29 Thread 岩倉 澪 via Digitalmars-d-learn
On Saturday, 30 July 2016 at 05:21:26 UTC, ag0aep6g wrote: On 07/30/2016 07:00 AM, 岩倉 澪 wrote: auto mem = malloc(2^^31); 2^^31 is negative. 2^^31-1 is the maximum positive value of an int, so 2^^31 wraps around to int.min. Try 2u^^31. bah, I'm an idiot! CASE CLOSED. Thanks for

WindowsCE toolchain

2016-07-29 Thread rota via Digitalmars-d-learn
Hello! I'm used small device(Electronic dictionary) which installed Windows CE 6.0. How can i found D compiler(ldc or dmd) for Windows CE?(I just wonder. not serious.) regards,

Re: The Mystery of the Misbehaved Malloc

2016-07-29 Thread ag0aep6g via Digitalmars-d-learn
On 07/30/2016 07:00 AM, 岩倉 澪 wrote: auto mem = malloc(2^^31); 2^^31 is negative. 2^^31-1 is the maximum positive value of an int, so 2^^31 wraps around to int.min. Try 2u^^31.

The Mystery of the Misbehaved Malloc

2016-07-29 Thread 岩倉 澪 via Digitalmars-d-learn
So I ran into a problem earlier - trying to allocate 2GB or more on Windows would fail even if there was enough room. Mentioned it in the D irc channel and a few fine folks pointed out that Windows only allows 2GB for 32-bit applications unless you pass a special flag which may or may not be a

Re: Does D have object wrappers for primitives?

2016-07-29 Thread stunaep via Digitalmars-d-learn
On Friday, 29 July 2016 at 20:25:16 UTC, Cauterite wrote: On Friday, 29 July 2016 at 20:13:34 UTC, stunaep wrote: I have some java code I need to convert and at one point it uses an Object[] array to store various ints, longs, and strings. Java has built in Integer and Long classes that wrap

Re: [OT] Music to Program Compilers To

2016-07-29 Thread Jack Stouffer via Digitalmars-d
On Friday, 29 July 2016 at 22:44:04 UTC, Walter Bright wrote: ... I open pandora and type in "death metal", and when working on really hard problems, "thrash metal". To each his own ¯\_(ツ)_/¯

Re: [OT] Music to Program Compilers To

2016-07-29 Thread deadalnix via Digitalmars-d
When coding, it is either old school electro : https://www.youtube.com/watch?v=QpDn4-Na5co https://www.youtube.com/watch?v=DY1s9SmrQRE (this one is not actually old, but the style). Or classic rock like airbourne. The harder the problems gets, the harder the music needs to be :) For hard

Re: Things that make writing a clean binding system more difficult

2016-07-29 Thread deadalnix via Digitalmars-d
On Friday, 29 July 2016 at 04:44:16 UTC, Timon Gehr wrote: My parser accepts the following: int function(int,int)ref functionPointer; I wasn't really aware that this was illegal in DMD. (Other function attributes, such as pure, are accepted.) In fact, even the following is disallowed: int

Re: [OT] Music to Program Compilers To

2016-07-29 Thread Meta via Digitalmars-d
On Friday, 29 July 2016 at 22:44:04 UTC, Walter Bright wrote: http://70sdisconights.com/ Yes, I listen to it while I work. When I was younger I could not start programming until I got some music going. Now I rarely ever listen to music while programming... I feel like it disrupts my thought

[Issue 16337] New: Posix get empty environment value returns null

2016-07-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16337 Issue ID: 16337 Summary: Posix get empty environment value returns null Product: D Version: D2 Hardware: All OS: All Status: NEW Keywords: pull

[Issue 15906] [REG2.068.1] GIT HEAD undefined references

2016-07-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15906 Walter Bright changed: What|Removed |Added Status|NEW |RESOLVED

Re: C's void func() vs. void func(void).

2016-07-29 Thread Mike Parker via Digitalmars-d-learn
On Friday, 29 July 2016 at 18:24:52 UTC, ag0aep6g wrote: On 07/29/2016 02:15 PM, Mike Parker wrote: And if it is a cross-platform library that is stdcall on Windows and cdecl elsewhere: extern(C) void fun(); extern(System), no? Yeah, that's what I had intended.

Re: Why D isn't the next "big thing" already

2016-07-29 Thread Karabuta via Digitalmars-d-learn
On Tuesday, 26 July 2016 at 15:11:00 UTC, llaine wrote: Hi guys, I'm using D since a few month now and I was wondering why people don't jump onto it that much and why it isn't the "big thing" already. Everybody is into javascript nowadays, but IMO even for doing web I found Vibe.d more

[Issue 16316] [REG 2.071] (Import deprecation) fully qualified name of imports in mixin template not accessible

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

[Issue 16316] [REG 2.071] (Import deprecation) fully qualified name of imports in mixin template not accessible

2016-07-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16316 --- Comment #1 from github-bugzi...@puremagic.com --- Commit pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/b517d86ed55cccb7b33608ec3e22f0036462f445 fix Issue 16316 - FQN of imports in mixin template not

[Issue 15900] [REG 2.071] (Import deprecation) Public import ignored when using fully qualified name

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

[Issue 15900] [REG 2.071] (Import deprecation) Public import ignored when using fully qualified name

2016-07-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15900 --- Comment #4 from github-bugzi...@puremagic.com --- Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/0a20f1d407281f61da5b6386fdbe762bab410200 fix Issue 15900 - public imports not accessible using FQN -

Re: Overflows in Phobos

2016-07-29 Thread Charles Hixson via Digitalmars-d
On 07/26/2016 07:36 AM, ketmar via Digitalmars-d wrote: On Tuesday, 26 July 2016 at 14:28:48 UTC, Timon Gehr wrote: "The expression assert(0) is a special case; it signifies that it is unreachable code. [...] The optimization and code generation phases of compilation may assume that it is

Re: D for competitive programming

2016-07-29 Thread sarn via Digitalmars-d
To add to the list, here are a couple of other online judges that explicitly support D: http://www.spoj.com/ http://judge.u-aizu.ac.jp/onlinejudge/ Of course, if you use a language-agnostic platform like Code Jam, you can do what you like. Project Euler (maths-oriented) and the Matasano

Re: [OT] Music to Program Compilers To

2016-07-29 Thread Walter Bright via Digitalmars-d
On 7/29/2016 3:45 PM, Cauterite wrote: On Friday, 29 July 2016 at 22:44:04 UTC, Walter Bright wrote: http://70sdisconights.com/ Yes, I listen to it while I work. that webpage design though >_< I'm spared that because I listen via a Grace Digital tuner, recently bought to replace the

Re: [OT] Music to Program Compilers To

2016-07-29 Thread Cauterite via Digitalmars-d
On Friday, 29 July 2016 at 22:44:04 UTC, Walter Bright wrote: http://70sdisconights.com/ Yes, I listen to it while I work. that webpage design though >_<

[OT] Music to Program Compilers To

2016-07-29 Thread Walter Bright via Digitalmars-d
http://70sdisconights.com/ Yes, I listen to it while I work.

Re: Battle-plan for CTFE

2016-07-29 Thread Stefan Koch via Digitalmars-d-announce
On Friday, 29 July 2016 at 14:28:03 UTC, Stefan Koch wrote: if ((a && b) || (a && c)) {//bla} This is now solved although quite naively at the cost of inserting twice the number of instructions for thoose cases. Then agian we are still much faster then the old interpreter. And I can still

Re: Does D have object wrappers for primitives?

2016-07-29 Thread Ali Çehreli via Digitalmars-d-learn
On 07/29/2016 01:40 PM, Cauterite wrote: > On Friday, 29 July 2016 at 20:26:47 UTC, Ali Çehreli wrote: >> >> I was going to suggest Algebraic because it allows arrays of mixed >> primitive types (wrapped in Algebraic): >> >> https://dlang.org/phobos/std_variant.html#.Algebraic >> >> Ali > > It

Re: Does D have object wrappers for primitives?

2016-07-29 Thread Cauterite via Digitalmars-d-learn
On Friday, 29 July 2016 at 20:26:47 UTC, Ali Çehreli wrote: I was going to suggest Algebraic because it allows arrays of mixed primitive types (wrapped in Algebraic): https://dlang.org/phobos/std_variant.html#.Algebraic Ali It could work, but keep in mind Algebraic is a structure, not

Re: D for competitive programming

2016-07-29 Thread urxvt1 via Digitalmars-d
On Thursday, 28 July 2016 at 22:07:44 UTC, Seb wrote: On Thursday, 28 July 2016 at 21:20:29 UTC, urxvt1 wrote: I wanted to try topcoder problems (never used this site before) and I found out that it doesn't support dlang. They only have c++, java, c#, vb.net, python languages. It would be great

Re: Does D have object wrappers for primitives?

2016-07-29 Thread Ali Çehreli via Digitalmars-d-learn
On 07/29/2016 01:25 PM, Cauterite wrote: On Friday, 29 July 2016 at 20:13:34 UTC, stunaep wrote: I have some java code I need to convert and at one point it uses an Object[] array to store various ints, longs, and strings. Java has built in Integer and Long classes that wrap the primitives in

Re: Does D have object wrappers for primitives?

2016-07-29 Thread Cauterite via Digitalmars-d-learn
On Friday, 29 July 2016 at 20:13:34 UTC, stunaep wrote: I have some java code I need to convert and at one point it uses an Object[] array to store various ints, longs, and strings. Java has built in Integer and Long classes that wrap the primitives in an object and strings are already

Does D have object wrappers for primitives?

2016-07-29 Thread stunaep via Digitalmars-d-learn
I have some java code I need to convert and at one point it uses an Object[] array to store various ints, longs, and strings. Java has built in Integer and Long classes that wrap the primitives in an object and strings are already objects.

Re: string mixin and alias

2016-07-29 Thread Andre via Digitalmars-d-learn
On Friday, 29 July 2016 at 18:39:23 UTC, Jesse Phillips wrote: On Friday, 29 July 2016 at 18:34:56 UTC, Jesse Phillips wrote: Here the generateCode() is mixed in to the context of foo(), which is fine if your code is performing actions but is no good if you're creating declarations that you

Re: Use dup on Containers with const Elements

2016-07-29 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/29/16 3:00 PM, Q. Schroll wrote: Cases to consider: Arrays and AAs with const(T) Elements, where T is a value or a reference type respectively. [snip] Questions: (1) Why do I have to specify the type here? Why does inference fail? (2) Why not just S[S]? The copy of a const S is a S so

Re: New Diet template engine almost complete, ready for comments

2016-07-29 Thread Sönke Ludwig via Digitalmars-d-announce
Am 29.07.2016 um 13:28 schrieb Chris: Talking about diets, will reShop[1] be available for Android an iOS too? You could extend it by adding "health tips" (add fruit & veg automatically), a calorie counter (for single items and the whole list) ;) http://rejectedsoftware.com/products/reshop

Use dup on Containers with const Elements

2016-07-29 Thread Q. Schroll via Digitalmars-d-learn
Cases to consider: Arrays and AAs with const(T) Elements, where T is a value or a reference type respectively. class C { } struct S { } const(S)[] varr; const(C)[] carr; const(S)[S] vaav; const(C)[S] caav; const(S)[C] vaac; const(C)[C] caac; pragma(msg,

[Issue 13983] RefCounted needs to be pure, @safe, nothrow

2016-07-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13983 Steven Schveighoffer changed: What|Removed |Added CC|

Re: string mixin and alias

2016-07-29 Thread Jesse Phillips via Digitalmars-d-learn
On Friday, 29 July 2016 at 18:34:56 UTC, Jesse Phillips wrote: Here the generateCode() is mixed in to the context of foo(), which is fine if your code is performing actions but is no good if you're creating declarations that you want to use in the context of main(). Here is a fully

Re: Old COM with D Slides/Presentation?

2016-07-29 Thread ZombineDev via Digitalmars-d
On Friday, 29 July 2016 at 17:57:04 UTC, Adam D. Ruppe wrote: On Friday, 29 July 2016 at 17:53:35 UTC, ZombineDev wrote: Is this what you are looking for: http://www.lunesu.com/uploads/ModernCOMProgramminginD.pdf ? that link isn't working for me but i think this is the same content

Re: string mixin and alias

2016-07-29 Thread Jesse Phillips via Digitalmars-d-learn
D won't let you hide the mixin, the keyword is there specifically to indicate code is being injected in that location. This isn't what you are looking for, but you can do something like this: - string generateCode(string s){return "";} void main() { enum s =

Re: Old COM with D Slides/Presentation?

2016-07-29 Thread ZombineDev via Digitalmars-d
On Friday, 29 July 2016 at 18:26:18 UTC, Nick Sabalausky wrote: On 07/29/2016 01:53 PM, ZombineDev wrote: Is this what you are looking for: http://www.lunesu.com/uploads/ModernCOMProgramminginD.pdf ? Ah, yes, that's it, thanks. Glad I could help :)

Re: Old COM with D Slides/Presentation?

2016-07-29 Thread Nick Sabalausky via Digitalmars-d
On 07/29/2016 01:53 PM, ZombineDev wrote: Is this what you are looking for: http://www.lunesu.com/uploads/ModernCOMProgramminginD.pdf ? Ah, yes, that's it, thanks.

Re: C's void func() vs. void func(void).

2016-07-29 Thread ag0aep6g via Digitalmars-d-learn
On 07/29/2016 02:15 PM, Mike Parker wrote: And if it is a cross-platform library that is stdcall on Windows and cdecl elsewhere: extern(C) void fun(); extern(System), no?

Re: Old COM with D Slides/Presentation?

2016-07-29 Thread Adam D. Ruppe via Digitalmars-d
On Friday, 29 July 2016 at 17:53:35 UTC, ZombineDev wrote: Is this what you are looking for: http://www.lunesu.com/uploads/ModernCOMProgramminginD.pdf ? that link isn't working for me but i think this is the same content http://www.slideserve.com/geneva/modern-com-programming-in-d

Re: Old COM with D Slides/Presentation?

2016-07-29 Thread ZombineDev via Digitalmars-d
On Friday, 29 July 2016 at 17:45:58 UTC, Nick Sabalausky wrote: A few years ago there was a presentation, or maybe only slides were posted (I don't recall), that demonstrated D putting C++ and even C# to absolute shame for interfacing with COM using some closed in-house D library. I'm trying

Old COM with D Slides/Presentation?

2016-07-29 Thread Nick Sabalausky via Digitalmars-d
A few years ago there was a presentation, or maybe only slides were posted (I don't recall), that demonstrated D putting C++ and even C# to absolute shame for interfacing with COM using some closed in-house D library. I'm trying to search for the slides or any links or anything relating to

Re: D-Man culture

2016-07-29 Thread Chris via Digitalmars-d-announce
On Thursday, 28 July 2016 at 16:10:58 UTC, Seb wrote: we could generate revenue with the (real) D-Man? I don't know, if it existed independently of DLang, or if it's in some way related to DLang. In the latter case we might use it to make some money for the D Foundation. @Chris you should get

Re: Terminix Stable 1.2.0 Released

2016-07-29 Thread David Nadlinger via Digitalmars-d-announce
On Saturday, 23 July 2016 at 14:24:08 UTC, Matthias Klumpp wrote: 4) Resolving weird LDC bugs like this one: https://github.com/ldc-developers/ldc/issues/1618 - might actually be an LLVM issue, but I don't know enough to pin down the issue. Turns out that this is not actually a LDC/LLVM bug,

[Issue 16336] New: Inconsistent flag handling of std.format.FormatSpec

2016-07-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16336 Issue ID: 16336 Summary: Inconsistent flag handling of std.format.FormatSpec Product: D Version: D2 Hardware: x86_64 OS: Windows Status: NEW Severity: minor

Re: simple sax-style xml parser

2016-07-29 Thread ketmar via Digitalmars-d-announce
On Friday, 29 July 2016 at 14:47:08 UTC, Chris wrote: Thanks. I might actually use it. I need an XML parser and wrote a very basic and incomplete one for my needs. great. don't forget to get lastest versions from that links. and feel free to report any bugs here, i'll try to fix them asap.

Re: simple sax-style xml parser

2016-07-29 Thread Chris via Digitalmars-d-announce
On Wednesday, 20 July 2016 at 01:49:37 UTC, ketmar wrote: i wrote a simple sax-style xml parser[1][2] for my own needs, and decided to share it. it has two interfaces: `xmparse()` function which simply calls callbacks without any validation or encoding conversion, and `SaxyEx` class, which

Re: Battle-plan for CTFE

2016-07-29 Thread Stefan Koch via Digitalmars-d-announce
On Friday, 29 July 2016 at 12:47:55 UTC, Robert burner Schadek wrote: On Friday, 29 July 2016 at 11:30:20 UTC, Stefan Koch wrote: please share your thoughts. When is this moving into dmd master? As soon as it passes the test-suite. And can execute diet-ng on the fast-path. Currently I have

Re: Battle-plan for CTFE

2016-07-29 Thread Stefan Koch via Digitalmars-d-announce
On Friday, 29 July 2016 at 13:07:12 UTC, Edwin van Leeuwen wrote: On Friday, 29 July 2016 at 11:30:20 UTC, Stefan Koch wrote: I have fresh performance statistics: Is there any improvement in memory usage? Yes! There memory usage is the same as run-time execution. plus about 16k for the

[Issue 15306] Delegates with shared context can have unshared aliasing

2016-07-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15306 Sobirari Muhomori changed: What|Removed |Added See Also|

[Issue 16335] Thread constructor accepts a delegate with nonshared context

2016-07-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16335 Sobirari Muhomori changed: What|Removed |Added See Also|

Re: New __FILE_DIR__ trait?

2016-07-29 Thread Jonathan Marler via Digitalmars-d
On Thursday, 28 July 2016 at 17:21:52 UTC, Sebastien Alaiwan wrote: On Thursday, 28 July 2016 at 06:21:06 UTC, Jonathan Marler wrote: auto __DIR__(string fileFullPath = __FILE_FULL_PATH__) pure { return fileFullPath.dirName; } Doesn't work, I don't think you can wrap such things (

[Issue 16335] New: Thread constructor accepts a delegate with nonshared context

2016-07-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16335 Issue ID: 16335 Summary: Thread constructor accepts a delegate with nonshared context Product: D Version: D2 Hardware: All URL:

Re: When I should to call destroy?

2016-07-29 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, July 29, 2016 13:18:00 Suliman via Digitalmars-d-learn wrote: > Use the `destroy` function to finalize an object by calling its > destructor. The memory of the object is not immediately > deallocated, instead the GC will collect the memory of the object > at an undetermined point after

FunctionTypeOf behaves unexpectedly for function pointers?

2016-07-29 Thread pineapple via Digitalmars-d-learn
This failure seems curious and I haven't been able to understand why it occurs, or whether it might be intentional. For all other callable types, including functions and delegates and types implementing opCall, the assertion passes. import std.traits : FunctionTypeOf; void function()

Re: When I should to call destroy?

2016-07-29 Thread Lodovico Giaretta via Digitalmars-d-learn
On Friday, 29 July 2016 at 13:18:00 UTC, Suliman wrote: Use the `destroy` function to finalize an object by calling its destructor. The memory of the object is not immediately deallocated, instead the GC will collect the memory of the object at an undetermined point after finalization: class

Re: Documented unittests & code coverage

2016-07-29 Thread Jack Stouffer via Digitalmars-d
On Friday, 29 July 2016 at 07:01:35 UTC, Walter Bright wrote: The pilot reads the indicated value, interprets it in the context of what the other instruments say, APPLIES GOOD JUDGMENT, and flies the airplane. Continuing with this metaphor, in this situation you're not the pilot making the

[Issue 16182] std.traits.fullyQualifiedName Bug

2016-07-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16182 --- Comment #3 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/59df244abb8296089285c14935c498d624bc5890 Fix for issue 16182

Re: When I should to call destroy?

2016-07-29 Thread Kagamin via Digitalmars-d-learn
On Friday, 29 July 2016 at 13:18:00 UTC, Suliman wrote: But I can't understand if D have GC it should remove objects when their life is finished. When I should to call `destroy`? What would be if I will not call it? You should call destroy when you want to call the destructor

Re: When I should to call destroy?

2016-07-29 Thread Cauterite via Digitalmars-d-learn
On Friday, 29 July 2016 at 13:18:00 UTC, Suliman wrote: But I can't understand if D have GC it should remove objects when their life is finished. When I should to call `destroy`? What would be if I will not call it? `destroy` is mainly about running destructors deterministically. From the

When I should to call destroy?

2016-07-29 Thread Suliman via Digitalmars-d-learn
Use the `destroy` function to finalize an object by calling its destructor. The memory of the object is not immediately deallocated, instead the GC will collect the memory of the object at an undetermined point after finalization: class Foo { int x; this() { x = 1; } } Foo foo = new Foo;

Re: Things that make writing a clean binding system more difficult

2016-07-29 Thread Dicebot via Digitalmars-d
On 07/29/2016 03:55 PM, Jonathan M Davis via Digitalmars-d wrote: > On Friday, July 29, 2016 14:14:49 Dicebot via Digitalmars-d wrote: >> What you want it contradictory to the concept of "storage class". > > Why? I thought the the whole idea of "storage class" was that it was an > attribute that

[Issue 16334] dmd producing invalid OMF file

2016-07-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16334 Ketmar Dark changed: What|Removed |Added CC|

Re: Battle-plan for CTFE

2016-07-29 Thread Edwin van Leeuwen via Digitalmars-d-announce
On Friday, 29 July 2016 at 11:30:20 UTC, Stefan Koch wrote: I have fresh performance statistics: Is there any improvement in memory usage?

Re: Things that make writing a clean binding system more difficult

2016-07-29 Thread Jonathan M Davis via Digitalmars-d
On Friday, July 29, 2016 14:14:49 Dicebot via Digitalmars-d wrote: > On 07/29/2016 02:05 PM, Jonathan M Davis via Digitalmars-d wrote: > > On Friday, July 29, 2016 02:55:14 Walter Bright via Digitalmars-d wrote: > >> On 7/29/2016 1:34 AM, Jonathan M Davis via Digitalmars-d wrote: > >>> I've always

Re: Battle-plan for CTFE

2016-07-29 Thread Robert burner Schadek via Digitalmars-d-announce
On Friday, 29 July 2016 at 11:30:20 UTC, Stefan Koch wrote: please share your thoughts. When is this moving into dmd master?

Re: C's void func() vs. void func(void).

2016-07-29 Thread ciechowoj via Digitalmars-d-learn
On Friday, 29 July 2016 at 12:20:17 UTC, Mike Parker wrote: Though, I should add the caveat that you need to ensure the definition of the C function does not specify any parameters. AFAIK, this is legal: // foo.h void func(); // foo.c void func(int a, int b) { ... } In which case you

Re: string mixin and alias

2016-07-29 Thread pineapple via Digitalmars-d-learn
On Friday, 29 July 2016 at 12:22:54 UTC, Andre Pany wrote: It is more or less syntax sugar. In the main function instead of writing "mixin(generateCode(s));" I want to write "foo(s);". So, the mixin statement is hidden while the functionality of mixin stays. Kind regards André As far as I

Re: Things that make writing a clean binding system more difficult

2016-07-29 Thread Kagamin via Digitalmars-d
On Thursday, 28 July 2016 at 20:16:11 UTC, Jonathan M Davis wrote: Well, if we decided to make parens with ref legal, then we could make it work. e.g. ref(int) function(int, int) functionPointer; Now, I don't know of any other case where you'd actually use parens with ref if it were legal,

Re: string mixin and alias

2016-07-29 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/29/16 2:38 AM, Andre Pany wrote: Hi, is there a way to alias a string mixin? Neither foo nor foo2 compiles. import std.meta : Alias; alias foo = (s) => Alias!(mixin(generateCode(s))); s is a runtime parameter. You can't mixin stuff that is only available at runtime. alias

Re: Things that make writing a clean binding system more difficult

2016-07-29 Thread Steven Schveighoffer via Digitalmars-d
On 7/29/16 12:44 AM, Timon Gehr wrote: My parser accepts the following: int function(int,int)ref functionPointer; I wasn't really aware that this was illegal in DMD. (Other function attributes, such as pure, are accepted.) In fact, even the following is disallowed: int foo(int)ref{} Should

Re: Documented unittests & code coverage

2016-07-29 Thread Steven Schveighoffer via Digitalmars-d
On 7/29/16 3:01 AM, Walter Bright wrote: On 7/28/2016 11:07 PM, Jack Stouffer wrote: you're making a decision on the user's behalf that coverage % is unimportant without knowing their circumstances. Think of it like the airspeed indicator on an airplane. There is no right or wrong airspeed.

Re: C's void func() vs. void func(void).

2016-07-29 Thread Mike Parker via Digitalmars-d-learn
On Friday, 29 July 2016 at 12:15:22 UTC, Mike Parker wrote: Yes, this is correct as long as the calling convention is not stdcall or something else: Though, I should add the caveat that you need to ensure the definition of the C function does not specify any parameters. AFAIK, this is

Re: string mixin and alias

2016-07-29 Thread Andre Pany via Digitalmars-d-learn
On Friday, 29 July 2016 at 12:11:44 UTC, pineapple wrote: On Friday, 29 July 2016 at 06:38:17 UTC, Andre Pany wrote: Hi, is there a way to alias a string mixin? Neither foo nor foo2 compiles. import std.meta : Alias; alias foo = (s) => Alias!(mixin(generateCode(s))); alias foo2(string s) =

[Issue 16334] New: dmd producing invalid OMF file

2016-07-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16334 Issue ID: 16334 Summary: dmd producing invalid OMF file Product: D Version: D2 Hardware: x86 OS: Windows Status: NEW Severity: major Priority: P1

Re: C's void func() vs. void func(void).

2016-07-29 Thread Mike Parker via Digitalmars-d-learn
On Friday, 29 July 2016 at 10:57:37 UTC, ciechowoj wrote: In C, a function `void func()` doesn't declare a function without arguments, instead it declares a function that takes unspecified number of arguments. The correct way to declare a function that takes no arguments is to use the `void`

Re: string mixin and alias

2016-07-29 Thread pineapple via Digitalmars-d-learn
On Friday, 29 July 2016 at 06:38:17 UTC, Andre Pany wrote: Hi, is there a way to alias a string mixin? Neither foo nor foo2 compiles. import std.meta : Alias; alias foo = (s) => Alias!(mixin(generateCode(s))); alias foo2(string s) = Alias!(mixin(generateCode(s))); string generateCode(string

From the D Blog: Martin Nowak on the DMD release process

2016-07-29 Thread Mike Parker via Digitalmars-d-announce
It was time for another Core Team Update on the D Blog. This time around, Martin Nowak shares how he got involved with the DMD release process and where you can learn more about it. The post is at [1] and the reddit thread at [2]. Now that Vladimir and Martin have gotten their updates out of

Re: Question about destructor of database and multiple use access

2016-07-29 Thread Suliman via Digitalmars-d-learn
So my last variant is right? How can I inspect code, to better understand how GC works? Also where I can find idiomatic code with comments? Just to read for better understand design solutions.

Re: Battle-plan for CTFE

2016-07-29 Thread Stefan Koch via Digitalmars-d-announce
Hi, I have fresh performance statistics: The test[1] involved running an empty while loop. Machine 1 Linux : DMD release : Interpreted : 3400 ms || Pseudo-Jited 230 || 50ms Native DMD Debug : Interpreted 4560 || Pseudo-Jited 260ms || Native 230 ms LDC release : Interpreted 2400 ms ||

Re: [OT] Re: Make D language as Apache foundation project

2016-07-29 Thread ksdflikdsjus via Digitalmars-d
On Thursday, 28 July 2016 at 09:23:09 UTC, jdfgjdf wrote: On Thursday, 28 July 2016 at 09:19:03 UTC, Jack Applegame wrote: On Wednesday, 27 July 2016 at 15:44:21 UTC, Seb wrote: http://dlang.org/foundation.html Wow. This page details Andrei's full name: Tudor Andrei Cristian Alexandrescu.

Re: New Diet template engine almost complete, ready for comments

2016-07-29 Thread Chris via Digitalmars-d-announce
Talking about diets, will reShop[1] be available for Android an iOS too? You could extend it by adding "health tips" (add fruit & veg automatically), a calorie counter (for single items and the whole list) ;) http://rejectedsoftware.com/products/reshop

Re: Things that make writing a clean binding system more difficult

2016-07-29 Thread Dicebot via Digitalmars-d
On 07/29/2016 02:05 PM, Jonathan M Davis via Digitalmars-d wrote: > On Friday, July 29, 2016 02:55:14 Walter Bright via Digitalmars-d wrote: >> On 7/29/2016 1:34 AM, Jonathan M Davis via Digitalmars-d wrote: >>> I've always looked at D's ref as being essentially the same as C++'s & >>> except that

Re: Things that make writing a clean binding system more difficult

2016-07-29 Thread Jonathan M Davis via Digitalmars-d
On Friday, July 29, 2016 02:55:14 Walter Bright via Digitalmars-d wrote: > On 7/29/2016 1:34 AM, Jonathan M Davis via Digitalmars-d wrote: > > I've always looked at D's ref as being essentially the same as C++'s & > > except that it's not considered to be part of the type, just attached to > > it

Re: Documented unittests & code coverage

2016-07-29 Thread Chris via Digitalmars-d
On Friday, 29 July 2016 at 07:01:35 UTC, Walter Bright wrote: On 7/28/2016 11:07 PM, Jack Stouffer wrote: you're making a decision on the user's behalf that coverage % is unimportant without knowing their circumstances. Think of it like the airspeed indicator on an airplane. There is no

C's void func() vs. void func(void).

2016-07-29 Thread ciechowoj via Digitalmars-d-learn
In C, a function `void func()` doesn't declare a function without arguments, instead it declares a function that takes unspecified number of arguments. The correct way to declare a function that takes no arguments is to use the `void` keyword: `void func(void)`. What is the correct way to

Re: The D Language Foundation has filed for non-profit status

2016-07-29 Thread Chris via Digitalmars-d-announce
On Thursday, 21 July 2016 at 02:16:55 UTC, Andrei Alexandrescu wrote: Hello everyone, Effective today the IRS has received the application of The D Language Foundation for tax-exempt (non-profit) status. An attorney and an accountant have helped me with the application. Going forward, they

Re: Things that make writing a clean binding system more difficult

2016-07-29 Thread Walter Bright via Digitalmars-d
On 7/29/2016 1:34 AM, Jonathan M Davis via Digitalmars-d wrote: I've always looked at D's ref as being essentially the same as C++'s & except that it's not considered to be part of the type, just attached to it in a way that doesn't propagate. The same with with in or out. I just don't see how

Re: Why D isn't the next "big thing" already

2016-07-29 Thread llaine via Digitalmars-d-learn
On Thursday, 28 July 2016 at 15:16:20 UTC, Gorge Jingale wrote: On Wednesday, 27 July 2016 at 10:41:54 UTC, ketmar wrote: On Wednesday, 27 July 2016 at 10:39:52 UTC, NX wrote: Lack of production quality tools like? no, "refactoring" and other crap is not "production quality tools", they are

Re: Things that make writing a clean binding system more difficult

2016-07-29 Thread Jonathan M Davis via Digitalmars-d
On Friday, July 29, 2016 09:03:18 Timon Gehr via Digitalmars-d wrote: > 'ref' has nothing to do with the type. This is not C++. > > The only thing that is inconsistent here is that 'ref' is not accepted > on the right for function declarations. ref may not be part of the type, but it just seems

Re: Can't Compile Global Semaphores?

2016-07-29 Thread Jean-Yves Vion-Dury via Digitalmars-d-learn
On Monday, 21 March 2016 at 13:19:34 UTC, denizzzka wrote: On Monday, 27 July 2015 at 20:12:10 UTC, John Colvin wrote: Yes, but then core.sync.semaphore doesn't support being shared, so... I don't really understand how

Re: Things that make writing a clean binding system more difficult

2016-07-29 Thread Timon Gehr via Digitalmars-d
On 29.07.2016 08:51, Jonathan M Davis via Digitalmars-d wrote: On Friday, July 29, 2016 08:29:19 Timon Gehr via Digitalmars-d wrote: On 29.07.2016 06:52, Jonathan M Davis via Digitalmars-d wrote: On Friday, July 29, 2016 06:44:16 Timon Gehr via Digitalmars-d wrote: My parser accepts the

Re: Documented unittests & code coverage

2016-07-29 Thread Walter Bright via Digitalmars-d
On 7/28/2016 11:07 PM, Jack Stouffer wrote: you're making a decision on the user's behalf that coverage % is unimportant without knowing their circumstances. Think of it like the airspeed indicator on an airplane. There is no right or wrong airspeed. The pilot reads the indicated value,

Re: Documented unittests & code coverage

2016-07-29 Thread Walter Bright via Digitalmars-d
On 7/28/2016 10:49 PM, Jonathan M Davis via Digitalmars-d wrote: True, but particularly when you start doing stuff like trying to require that modules have 100% coverage - or that the coverage not be reduced by a change - it starts mattering - especially if it's done with build tools. The

Re: Dealing with unicode

2016-07-29 Thread John via Digitalmars-d-learn
On Friday, 29 July 2016 at 06:32:24 UTC, Fabian wrote: I'm trying to add support for unicode to my app in D and having issues. string str = "Pokémon No"; writeln(str); this outputs: Pok├®mon No what I want to do is change the funky character such that the string reads: Pok\u00e9mon No as

Re: Things that make writing a clean binding system more difficult

2016-07-29 Thread Jonathan M Davis via Digitalmars-d
On Friday, July 29, 2016 08:29:19 Timon Gehr via Digitalmars-d wrote: > On 29.07.2016 06:52, Jonathan M Davis via Digitalmars-d wrote: > > On Friday, July 29, 2016 06:44:16 Timon Gehr via Digitalmars-d wrote: > >> My parser accepts the following: > >> > >> int function(int,int)ref functionPointer;

Re: string mixin and alias

2016-07-29 Thread rikki cattermole via Digitalmars-d-learn
On 29/07/2016 6:38 PM, Andre Pany wrote: Hi, is there a way to alias a string mixin? Neither foo nor foo2 compiles. import std.meta : Alias; alias foo = (s) => Alias!(mixin(generateCode(s))); alias foo2(string s) = Alias!(mixin(generateCode(s))); string generateCode(string s){return "";}

Re: Dealing with unicode

2016-07-29 Thread rikki cattermole via Digitalmars-d-learn
On 29/07/2016 6:32 PM, Fabian wrote: I'm trying to add support for unicode to my app in D and having issues. string str = "Pokémon No"; writeln(str); this outputs: Pok├®mon No what I want to do is change the funky character such that the string reads: Pok\u00e9mon No as \u00e9 == é how can

string mixin and alias

2016-07-29 Thread Andre Pany via Digitalmars-d-learn
Hi, is there a way to alias a string mixin? Neither foo nor foo2 compiles. import std.meta : Alias; alias foo = (s) => Alias!(mixin(generateCode(s))); alias foo2(string s) = Alias!(mixin(generateCode(s))); string generateCode(string s){return "";} void main() { enum s = "a = 2 + 3; b = 4 +

  1   2   >