[Issue 15191] DIP25: Taking address of ref return is not type checked soundly

2016-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15191 --- Comment #2 from Walter Bright --- The trouble here is the following: int[N]* bar(return ref int[N] s) @safe { return (s); // <== taking the address of a reference should be an error } --

DMD 2.071.1 and Issue 15925 - [REG 2.071] Import declaration from mixin templates are ignored

2016-06-29 Thread captaindet via Digitalmars-d
the changelog to 2.071.1 lists 15925 as a fixed regression, and https://issues.dlang.org/show_bug.cgi?id=15925 lists it as "RESOLVED FIXED" however, the issue as originally submitted still exists in 2.071.1. so what is going on? for me as a non-core dev it is difficult to get the gist of the

[Issue 15191] DIP25: Taking address of ref return is not type checked soundly

2016-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15191 --- Comment #1 from Walter Bright --- Reformatting for readability: enum N=100; ref int[N] foo(return ref int[N] s)@safe { return s; } int[N]* bar(return ref int[N] s) @safe { return (s); } ref int[N] baz()@safe

Re: Hooking into GC

2016-06-29 Thread Martin Nowak via Digitalmars-d-learn
On Thursday, 30 June 2016 at 03:03:16 UTC, MMJones wrote: I need to get more info than just the memory usage. Like what is using the memory. That's what -profile-gc is for, it tracks allocations. Give it a try, IIIRC it's missing explicit GC.malloc calls atm., but those should be rare anyhow

[Issue 14238] DIP25: escape checks can be circumvented with delegate

2016-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14238 --- Comment #1 from Walter Bright --- The problem here is that 'scope' is not implemented. --

Re: Is there an embeddable HTTP server in D?

2016-06-29 Thread Adam D. Ruppe via Digitalmars-d
On Thursday, 30 June 2016 at 00:10:54 UTC, ketmar wrote: Adam's cgi.d from arsd repo[1] contains built-in server implementation too, it as one of the available options. Indeed. To use this, download cgi.d: https://raw.githubusercontent.com/adamdruppe/arsd/master/cgi.d then make a program

Re: stub out your gc without hacking on druntime

2016-06-29 Thread Adam D. Ruppe via Digitalmars-d
On Thursday, 30 June 2016 at 04:07:03 UTC, Hiemlick Hiemlicker wrote: Can one use this to hook in to any phobo's lib functions? Yeah, you could. Easier though is to just copy the phobos lib file, modify it, then compile it into your program explicitly: cp dmd2/src/phobos/std/file.d . # edit

Re: stub out your gc without hacking on druntime

2016-06-29 Thread Hiemlick Hiemlicker via Digitalmars-d
On Tuesday, 11 June 2013 at 12:13:05 UTC, Adam D. Ruppe wrote: On Tuesday, 11 June 2013 at 03:08:36 UTC, H. S. Teoh wrote: [...] Yea, that's the idea here. Like Simen said, if these were errors, your program wouldn't even start, so noop is better. Though gc_init should call thread_init,

Re: Battle-plan for CTFE

2016-06-29 Thread Stefan Koch via Digitalmars-d-announce
On Thursday, 30 June 2016 at 01:32:47 UTC, Martin Nowak wrote: On Thursday, 30 June 2016 at 01:20:08 UTC, Stefan Koch wrote: First small code example compiles! int bug6498(int x) { int n = 0; while (n < x) { n++; } return n; } evaluation of bug6498(100_000_00) took 226 msecs.

Re: Hooking into GC

2016-06-29 Thread MMJones via Digitalmars-d-learn
On Thursday, 30 June 2016 at 01:26:47 UTC, Martin Nowak wrote: On Wednesday, 29 June 2016 at 14:41:48 UTC, MMJones wrote: On Wednesday, 29 June 2016 at 10:07:19 UTC, Martin Nowak wrote: How will this affect the trackallocs module? Will it break it, replace it? Essentially a merge of it? Should

Re: -dip25 switch: time to make it always on?

2016-06-29 Thread Walter Bright via Digitalmars-d
On 6/29/2016 7:02 PM, ketmar wrote: thank you. this is the first time i can really make at least some sense of it. so, basically, in @safe code i should explicitly mark returning `ref`s, or compiler will complain? Yup. That's all there is to it.

Re: -dip25 switch: time to make it always on?

2016-06-29 Thread ketmar via Digitalmars-d
On Thursday, 30 June 2016 at 01:54:27 UTC, Walter Bright wrote: On 6/29/2016 5:08 PM, ketmar wrote: On Wednesday, 29 June 2016 at 20:52:52 UTC, Walter Bright wrote: On 6/29/2016 8:26 AM, Adam D. Ruppe wrote: tbh, I've never been able to figure out what it is even supposed to do and thus never

Re: -dip25 switch: time to make it always on?

2016-06-29 Thread Walter Bright via Digitalmars-d
On 6/29/2016 5:08 PM, ketmar wrote: On Wednesday, 29 June 2016 at 20:52:52 UTC, Walter Bright wrote: On 6/29/2016 8:26 AM, Adam D. Ruppe wrote: tbh, I've never been able to figure out what it is even supposed to do and thus never actually used it, despite being interested in the subject. One

Re: -dip25 switch: time to make it always on?

2016-06-29 Thread deadalnix via Digitalmars-d
On Wednesday, 29 June 2016 at 10:02:08 UTC, Dicebot wrote: Please don't. There is a dire need to fix the implementation first, currently DIP25 is almost unusable for anyone who doesn't know exact limits of the feature - compiler diagnostics are pretty much non-existent. Right now it is miles

[Issue 16220] User-defined synchronized implementation

2016-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16220 ZombineDev changed: What|Removed |Added Summary|sync|User-defined

[Issue 16220] New: sync

2016-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16220 Issue ID: 16220 Summary: sync Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P1 Component: dmd

Re: Battle-plan for CTFE

2016-06-29 Thread Martin Nowak via Digitalmars-d-announce
On Thursday, 30 June 2016 at 01:20:08 UTC, Stefan Koch wrote: First small code example compiles! int bug6498(int x) { int n = 0; while (n < x) { n++; } return n; } evaluation of bug6498(100_000_00) took 226 msecs. evaluation of bug6498(100_000_000) took 2228 msecs. The memory

Re: Battle-plan for CTFE

2016-06-29 Thread Stefan Koch via Digitalmars-d-announce
First small code example compiles! int bug6498(int x) { int n = 0; while (n < x) { n++; } return n; } evaluation of bug6498(100_000_00) took 226 msecs. evaluation of bug6498(100_000_000) took 2228 msecs. The memory allocated by the Evaluator is exactly 12 bytes.

Re: What's the secret to static class members

2016-06-29 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 29 June 2016 at 19:10:18 UTC, chmike wrote: Claiming the problems you encountered are due to bad design of the language is unfair if you don't expose clearly the problem and verify the problem is not your side. There is a deeply thought rationale for every rule of the D

[Issue 12132] Object.Monitor and core.sync primitives should be shared

2016-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12132 ZombineDev changed: What|Removed |Added CC|

Re: year to date pull statistics (2016-06-25)

2016-06-29 Thread Brad Roberts via Digitalmars-d
total open: 295 created since 2016-01-01 and still open: 159 created closed delta 2016-06-26 - today 47 37-10 2016-06-19 - 2016-06-25 44 24-20 2016-06-12 - 2016-06-18 37 48 11 2016-06-05 - 2016-06-11 40 42 2

[Issue 8993] Implement unique references/isolated memory

2016-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=8993 ZombineDev changed: What|Removed |Added Keywords||safe

[Issue 7902] [TDPL] sychronized is supposed to be for classes, not functions

2016-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=7902 ZombineDev changed: What|Removed |Added Keywords||safe

[Issue 13727] std.stdio.File not thread-safe

2016-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13727 ZombineDev changed: What|Removed |Added Keywords||safe

[Issue 16057] [TDPL] synchronized (a, b) compiles and runs with wrong semantics

2016-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16057 ZombineDev changed: What|Removed |Added Keywords||safe

[Issue 14251] synchronized (mtx) doesn't check attributes (pure, const)

2016-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14251 ZombineDev changed: What|Removed |Added Keywords||safe

Re: Cast vs Virtual Method vs TypeId?

2016-06-29 Thread rikki cattermole via Digitalmars-d-learn
On 30/06/2016 12:25 PM, Jonathan Marler wrote: I'd like to hear peoples thoughts on the various solutions for the following problem. Say you have some hierarchy of classes like: class GameObject { // ... } class Entity : GameObject { // ... } class Player : Entity { // ... } class Enemy

Cast vs Virtual Method vs TypeId?

2016-06-29 Thread Jonathan Marler via Digitalmars-d-learn
I'd like to hear peoples thoughts on the various solutions for the following problem. Say you have some hierarchy of classes like: class GameObject { // ... } class Entity : GameObject { // ... } class Player : Entity { // ... } class Enemy : Entity { // ... } // ... Assume you have

Re: IFTI in Eponymous Templates

2016-06-29 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 29 June 2016 at 21:38:23 UTC, ag0aep6g wrote: You're explicitly instantiating the outer bar there, not the inner one. Yes, you're correct. I mixed up the inner/outer. I just thought it was something weird I had noticed.

Re: Is there an embeddable HTTP server in D?

2016-06-29 Thread ketmar via Digitalmars-d
Adam's cgi.d from arsd repo[1] contains built-in server implementation too, it as one of the available options. [1] https://github.com/adamdruppe/arsd

Re: -dip25 switch: time to make it always on?

2016-06-29 Thread ketmar via Digitalmars-d
On Wednesday, 29 June 2016 at 20:52:52 UTC, Walter Bright wrote: On 6/29/2016 8:26 AM, Adam D. Ruppe wrote: tbh, I've never been able to figure out what it is even supposed to do and thus never actually used it, despite being interested in the subject. One way to find out is to turn it on

Re: Registration-free COM client

2016-06-29 Thread Thalamus via Digitalmars-d-learn
On Wednesday, 29 June 2016 at 19:21:50 UTC, John wrote: On Wednesday, 29 June 2016 at 14:51:10 UTC, Thalamus wrote: [...] A little research reveals that C# COM servers don't export DllGetClassObject, or any of the COM server plumbing. "Registering for COM interop" merely adds the registry

[Issue 15387] slice in extern(C++) ICE's

2016-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15387 ZombineDev changed: What|Removed |Added CC|

[Issue 15191] DIP25: Taking address of ref return is not type checked soundly

2016-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15191 ZombineDev changed: What|Removed |Added CC|

[Issue 15192] DIP25: Nested ref returns are type checked unsoundly

2016-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15192 ZombineDev changed: What|Removed |Added CC|

[Issue 16216] struct equality compares padding

2016-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16216 ZombineDev changed: What|Removed |Added CC|

[Issue 15193] DIP25 (implementation): Lifetimes of temporaries tracked incorrectly

2016-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15193 ZombineDev changed: What|Removed |Added CC|

[Issue 14242] destruction of static arrays with elaborate destructor elements does not propagate attributes

2016-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14242 ZombineDev changed: What|Removed |Added CC|

[Issue 16208] moduleinfo importedModules contains needless duplicates

2016-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16208 ZombineDev changed: What|Removed |Added CC|

Re: Google's code ownership

2016-06-29 Thread qznc via Digitalmars-d
On Wednesday, 29 June 2016 at 20:09:52 UTC, Dechcaudron wrote: On Wednesday, 29 June 2016 at 20:06:18 UTC, Seb wrote: How about doing something similar for Phobos? On a related note Facebook open-sourced it's "mention-bot" [2] that could be helpful in case no owners are defined. I second it.

Re: Blocking points for further D adoption

2016-06-29 Thread qznc via Digitalmars-d
On Thursday, 2 June 2016 at 18:14:08 UTC, Jack Stouffer wrote: On Thursday, 2 June 2016 at 15:40:28 UTC, Seb wrote: I heard this a lot too. "You don't have a web server in your standard libary?? It's 2016!" Just to be clear, it's not a good idea to have a full blown server in your stdlib.

Re: -dip25 switch: time to make it always on?

2016-06-29 Thread Meta via Digitalmars-d
On Wednesday, 29 June 2016 at 20:51:56 UTC, Walter Bright wrote: On 6/29/2016 6:45 AM, Jacob Carlborg wrote: How is it a success? Grepping on "return ref" gives back four results in Phobos and one in druntime. It was designed to solve the returning reference problem with as few annotations

[Issue 14485] .front of empty filtered zip range is accessible

2016-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14485 --- Comment #5 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/ad7dbaa0505a2f0b4f6982625e6cca1163fd3c56 Fixed Issue 14485: .front of empty filtered zip range

[Issue 14485] .front of empty filtered zip range is accessible

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

Re: IFTI in Eponymous Templates

2016-06-29 Thread ag0aep6g via Digitalmars-d-learn
On 06/29/2016 08:59 PM, jmh530 wrote: For instance, in the bar function below, I have to explicitly instantiate the inner function template. [...] template bar(T) { T bar(U)(T x, U y) { return x + cast(T)y; } } void main() { int a = 1; long b = 2;

Re: Call to Action: making Phobos @safe

2016-06-29 Thread Walter Bright via Digitalmars-d
On 6/29/2016 10:25 AM, Atila Neves wrote: On Saturday, 25 June 2016 at 22:56:12 UTC, Walter Bright wrote: On 6/25/2016 3:44 PM, Walter Bright wrote: 4. Add @safe to the unittest A unittest that is deliberately unsafe should be annotated with @system. Meaning that any un-annotated unittest

Re: -dip25 switch: time to make it always on?

2016-06-29 Thread Walter Bright via Digitalmars-d
On 6/29/2016 8:26 AM, Adam D. Ruppe wrote: tbh, I've never been able to figure out what it is even supposed to do and thus never actually used it, despite being interested in the subject. One way to find out is to turn it on and let it do the work for you.

Re: -dip25 switch: time to make it always on?

2016-06-29 Thread Walter Bright via Digitalmars-d
On 6/29/2016 6:45 AM, Jacob Carlborg wrote: How is it a success? Grepping on "return ref" gives back four results in Phobos and one in druntime. It was designed to solve the returning reference problem with as few annotations as possible. Needing only 4 annotations in the entire runtime

Re: Is there an embeddable HTTP server in D?

2016-06-29 Thread Dicebot via Digitalmars-d
On Wednesday, 29 June 2016 at 20:39:45 UTC, Arun Chandrasekaran wrote: In C++ land, I've used cpp-netlib[0] to create a HTTP server. Is there a similar library in D? cpp-netlib uses Boost ASIO and it supports synchronous and asynchronous HTTP servers. It also support HTTP client API (which

Re: IFTI in Eponymous Templates

2016-06-29 Thread Hiemlick Hiemlicker via Digitalmars-d-learn
On Wednesday, 29 June 2016 at 18:59:19 UTC, jmh530 wrote: I was playing around with some Eponymous Templates. I had been under the impression that Implicit Function-Template Instantiation (IFTI) meant that you don't have to explicitly instantiate all functions. However, it seems like there are

Is there an embeddable HTTP server in D?

2016-06-29 Thread Arun Chandrasekaran via Digitalmars-d
In C++ land, I've used cpp-netlib[0] to create a HTTP server. Is there a similar library in D? cpp-netlib uses Boost ASIO and it supports synchronous and asynchronous HTTP servers. It also support HTTP client API (which I've not used). Arun [0] http://cpp-netlib.org/0.11.2/index.html

Re: Google's code ownership

2016-06-29 Thread Dechcaudron via Digitalmars-d
On Wednesday, 29 June 2016 at 20:06:18 UTC, Seb wrote: How about doing something similar for Phobos? On a related note Facebook open-sourced it's "mention-bot" [2] that could be helpful in case no owners are defined. I second it. Hopefully this will turn out in a shorter review process for

Google's code ownership

2016-06-29 Thread Seb via Digitalmars-d
From the recent article "Why Google Stores Billions of Lines of Code in a Single Repository" a very interesting excerpt about their code ownership [1]: An important aspect of Google culture that encourages code quality is the expectation that all code is reviewed before being committed to

Add more feature categories to Wiki/Editors

2016-06-29 Thread WebFreak001 via Digitalmars-d
https://wiki.dlang.org/Editors Some plugins/editors can do even more than these few feature categories listed there. Adding them there might help users decide between editors because of some feature they really like. I thought of 2 additional categories so far: Debugging and Profiling

Re: C++17 is feature complete

2016-06-29 Thread Ola Fosheim Grøstad via Digitalmars-d
On Wednesday, 29 June 2016 at 16:38:07 UTC, Enamex wrote: That's what I said. They're not in the C++17 spec but we won't be waiting for C++Next for them, hopefully. Grafting a meaningful module system on top of a 40 years old language is full of pitfalls and making the wrong choice would be

Re: Registration-free COM client

2016-06-29 Thread John via Digitalmars-d-learn
On Wednesday, 29 June 2016 at 14:51:10 UTC, Thalamus wrote: I was hoping there would be a code-only solution, and I'm glad to see one is possible. It isn't quite working for me yet, though. I can get the HINSTANCE in the CoLoadLibrary call, but GetProcAddress for DllGetClassObject fails, with

Re: What's the secret to static class members

2016-06-29 Thread chmike via Digitalmars-d-learn
On Wednesday, 29 June 2016 at 17:00:49 UTC, Guido wrote: On Wednesday, 29 June 2016 at 15:40:57 UTC, Andrea Fontana wrote: On Wednesday, 29 June 2016 at 15:33:58 UTC, Guido wrote: The problem is actually much more profound. The classes need to be declared outside the main() scope. WTF?!?!?!

IFTI in Eponymous Templates

2016-06-29 Thread jmh530 via Digitalmars-d-learn
I was playing around with some Eponymous Templates. I had been under the impression that Implicit Function-Template Instantiation (IFTI) meant that you don't have to explicitly instantiate all functions. However, it seems like there are cases with eponymous templates with functions in them

Possible to Animate Program

2016-06-29 Thread Hiemlick Hiemlicker via Digitalmars-d
Is it possible to add a hook to every function call/delegate/lambda both start and end? What about the ability to essentially log a programs execution path, then "play it back" and only view the source code one is interested in along with the state at any moment in time. Similar to debugging

Re: What's the secret to static class members

2016-06-29 Thread Ali Çehreli via Digitalmars-d-learn
On 06/29/2016 10:00 AM, Guido wrote: > doesn't work. As others said, everything that you've mentioned do indeed work: void main() { class Grid { public: static uint xdim; } class Holder : Grid { uint var; } Grid.xdim = 0; auto grid = new Grid;

Re: Registration-free COM client

2016-06-29 Thread John via Digitalmars-d-learn
On Wednesday, 29 June 2016 at 17:55:27 UTC, John wrote: On Wednesday, 29 June 2016 at 14:51:10 UTC, Thalamus wrote: and the D code (mostly unchanged from your example): interface ITestInterface { int Identifier(); } ITestInterface needs to derive from IUnknown. I realise that doesn't

Re: Call to Action: making Phobos @safe

2016-06-29 Thread Atila Neves via Digitalmars-d
On Wednesday, 29 June 2016 at 17:33:18 UTC, Lodovico Giaretta wrote: On Wednesday, 29 June 2016 at 17:25:31 UTC, Atila Neves wrote: On Saturday, 25 June 2016 at 22:56:12 UTC, Walter Bright wrote: On 6/25/2016 3:44 PM, Walter Bright wrote: 4. Add @safe to the unittest A unittest that is

Re: one-file pure D decoders for vorbis, flac and mp3

2016-06-29 Thread ketmar via Digitalmars-d-announce
On Wednesday, 29 June 2016 at 18:03:50 UTC, deadalnix wrote: I did vorbis by myself in the past in java, that format is UUUGHH ! lucky me, Sean did all the hard work. ;-) Good work. thank you.

Re: one-file pure D decoders for vorbis, flac and mp3

2016-06-29 Thread deadalnix via Digitalmars-d-announce
On Wednesday, 29 June 2016 at 09:07:18 UTC, ketmar wrote: i decided to make some noise about those, as people may thinking about doing the ports themselves, and effectively double (or triple, or...) the work. so, here they are: * Vorbis decoder[1] (stb_vorbis port), PD; * FLAC decoder[2]

Re: Phobos posix.mak -> D file using reggae: round 2

2016-06-29 Thread Atila Neves via Digitalmars-d
On Monday, 18 April 2016 at 15:15:26 UTC, Atila Neves wrote: Here's[1] another attempt at converting the Makefile for POSIX systems to D using reggae[2]. I first tried my hand at writing a parser for Makefiles using Pegged and machine translating to D. I learned a lot about parsing and GNU

[Issue 16219] std.experimental.allocator.makeArray does unnecessary allocations for ranges with length

2016-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16219 --- Comment #1 from Jack Stouffer --- https://github.com/dlang/phobos/pull/4503 --

Re: Registration-free COM client

2016-06-29 Thread John via Digitalmars-d-learn
On Wednesday, 29 June 2016 at 14:51:10 UTC, Thalamus wrote: and the D code (mostly unchanged from your example): interface ITestInterface { int Identifier(); } ITestInterface needs to derive from IUnknown.

Re: Diff between function and delegate

2016-06-29 Thread jmh530 via Digitalmars-d-learn
On Monday, 27 June 2016 at 19:59:05 UTC, Mathias Lang wrote: Delegate don't GC allocate when: - You take a pointer to a member function - The function accept a `scope` delegate and you pass a literal - You use `scope myDG = (Params) { body... }` I have a somewhat related question. Why use a

[Issue 16219] New: std.experimental.allocator.makeArray does unnecessary allocations for ranges with length

2016-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16219 Issue ID: 16219 Summary: std.experimental.allocator.makeArray does unnecessary allocations for ranges with length Product: D Version: D2 Hardware: All OS: All

[Issue 15387] slice in extern(C++) ICE's

2016-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15387 uplink.co...@googlemail.com changed: What|Removed |Added Severity|enhancement |normal --- Comment #1 from

[Issue 15387] slice in extern(C++) ICE's

2016-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15387 uplink.co...@googlemail.com changed: What|Removed |Added CC||uplink.co...@googlemail.com --

Re: Diff between function and delegate

2016-06-29 Thread Meta via Digitalmars-d-learn
On Monday, 27 June 2016 at 19:59:05 UTC, Mathias Lang wrote: - You use `scope myDG = (Params) { body... }` It looks like i is still moved to the heap but marking `test` with @nogc compiles successfully. Then when I run the code the assertion is triggered. What exactly is going on here?

Re: Call to Action: making Phobos @safe

2016-06-29 Thread Lodovico Giaretta via Digitalmars-d
On Wednesday, 29 June 2016 at 17:25:31 UTC, Atila Neves wrote: On Saturday, 25 June 2016 at 22:56:12 UTC, Walter Bright wrote: On 6/25/2016 3:44 PM, Walter Bright wrote: 4. Add @safe to the unittest A unittest that is deliberately unsafe should be annotated with @system. Meaning that any

Re: std.experimental.randomized_unittest_benchmark is ready for comments

2016-06-29 Thread Jack Stouffer via Digitalmars-d
On Sunday, 19 June 2016 at 19:03:55 UTC, Robert burner Schadek wrote: On Sunday, 19 June 2016 at 18:51:09 UTC, Jack Stouffer wrote: I would like to try this out on my date parsing library, but I don't see a way to generate strings of a specific format. take a look at

Re: Call to Action: making Phobos @safe

2016-06-29 Thread Atila Neves via Digitalmars-d
On Saturday, 25 June 2016 at 22:56:12 UTC, Walter Bright wrote: On 6/25/2016 3:44 PM, Walter Bright wrote: 4. Add @safe to the unittest A unittest that is deliberately unsafe should be annotated with @system. Meaning that any un-annotated unittest needs corrective action one way or the

Re: What's the secret to static class members

2016-06-29 Thread ag0aep6g via Digitalmars-d-learn
On 06/29/2016 07:00 PM, Guido wrote: On another topic, tuples seem to have a major problem as well. Tuple!(float, float, float) test; Tuple!(float, float, float) [] array_data; test[0] = 1.0; // works array_data[i][0] = 1.0; // doesn't work. Works just fine for me, if I add the missing

Re: What's the secret to static class members

2016-06-29 Thread Guido via Digitalmars-d-learn
On Wednesday, 29 June 2016 at 15:40:57 UTC, Andrea Fontana wrote: On Wednesday, 29 June 2016 at 15:33:58 UTC, Guido wrote: The problem is actually much more profound. The classes need to be declared outside the main() scope. WTF?!?!?! I put them in main() so they would be in scope. This seems

Status of std.async?

2016-06-29 Thread Shammah Chancellor via Digitalmars-d
So, I've used vibed a bit in the past and really like it, but am hesitant to base other network based clients on it. I see now that there are several other Async libraries for D, including one native one. It also looks like Sonke is working on another native async library. My question is

Re: C++17 is feature complete

2016-06-29 Thread Enamex via Digitalmars-d
On Tuesday, 28 June 2016 at 19:27:36 UTC, Ola Fosheim Grøstad wrote: On Tuesday, 28 June 2016 at 18:50:25 UTC, Enamex wrote: Also, C++17 is 'getting' Modules and Concepts Lite later in tech specs... that don't even have working drafts according to this [https://isocpp.org/std/status] (but have

Re: Programming in D: A Happy Accident

2016-06-29 Thread WhatMeWorry via Digitalmars-d-announce
On Wednesday, 29 June 2016 at 13:20:46 UTC, Mike Parker wrote: Ali put together a guest post for the D blog on how he fell into to writing a Turkish tutorial on D that later became one of the best known resources for learning the language. Long live 'Programming in D'!

Re: What's the secret to static class members

2016-06-29 Thread Andrea Fontana via Digitalmars-d-learn
On Wednesday, 29 June 2016 at 15:33:58 UTC, Guido wrote: The problem is actually much more profound. The classes need to be declared outside the main() scope. WTF?!?!?! I put them in main() so they would be in scope. This seems like a *MAJOR* design flaw with the language, not to mention the

Re: What's the secret to static class members

2016-06-29 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 29 June 2016 at 15:33:58 UTC, Guido wrote: The problem is actually much more profound. The classes need to be declared outside the main() scope. WTF?!?!?! It's not going to work anywhere if you type 'Class' as opposed to 'class'. Types can be declared in any scope: ``` void

Re: static if enhancement

2016-06-29 Thread Wyatt via Digitalmars-d
On Friday, 24 June 2016 at 18:27:07 UTC, Steven Schveighoffer wrote: void fun(T)(T obj) { static if (!hasMember(T, "gun")) throw new Exception("No gun"); obj.gun; } Call with something that doesn't have a gun member, and even without the reachability warnings (no -w switch), it

Re: What's the secret to static class members

2016-06-29 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 29 June 2016 at 15:33:58 UTC, Guido wrote: The problem is actually much more profound. The classes need to be declared outside the main() scope. WTF?!?!?! Not true. What are you actually trying to compile?

Re: What's the secret to static class members

2016-06-29 Thread Guido via Digitalmars-d-learn
On Wednesday, 29 June 2016 at 15:18:53 UTC, Guido wrote: I'm using a static class member in a parent class, but can't get the compiler to see it. Class Grid{ public: uint xdim; } Class Holder : Grid { uint var; } Any of the following should work, but none of them do: Grid.xdim = 0;

Re: IUP, CD, IM, lua interfaces in D.

2016-06-29 Thread Mike Parker via Digitalmars-d-announce
On Wednesday, 29 June 2016 at 14:01:52 UTC, mogu wrote: On Wednesday, 29 June 2016 at 09:48:19 UTC, Chris wrote: Have you seen this: https://github.com/DerelictOrg/DerelictLua There is also https://github.com/JakobOvrum/LuaD I have already looked over these projects before I wrote this

Re: -dip25 switch: time to make it always on?

2016-06-29 Thread Adam D. Ruppe via Digitalmars-d
On Wednesday, 29 June 2016 at 09:40:45 UTC, Walter Bright wrote: It's been a strong success. tbh, I've never been able to figure out what it is even supposed to do and thus never actually used it, despite being interested in the subject.

Re: What's the secret to static class members

2016-06-29 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 29 June 2016 at 15:18:53 UTC, Guido wrote: I'm using a static class member in a parent class, but can't get the compiler to see it. Class Grid{ public: uint xdim; } That's not static do `static uint xdim;` if you want it static (in this context, static means it is

What's the secret to static class members

2016-06-29 Thread Guido via Digitalmars-d-learn
I'm using a static class member in a parent class, but can't get the compiler to see it. Class Grid{ public: uint xdim; } Class Holder : Grid { uint var; } Any of the following should work, but none of them do: Grid.xdim = 0; grid = new Grid; grid.xdim = 0; holder = new Holder;

Re: Get return type statically

2016-06-29 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Jun 27, 2016 at 08:13:21PM -0700, H. S. Teoh via Digitalmars-d-learn wrote: > On Tue, Jun 28, 2016 at 01:41:03AM +, Smoke Adams via Digitalmars-d-learn > wrote: > > I have a type > > > > public class SuperFunction(T) > > { > > T t; > > return(T) Do() { return t(); } > > } > > >

Re: Registration-free COM client

2016-06-29 Thread Thalamus via Digitalmars-d-learn
On Tuesday, 28 June 2016 at 02:30:56 UTC, thedeemon wrote: To load load a COM object from a given file (DLL or AX) without having it registered, just load the file with CoLoadLibrary() and use its DllGetClassObject() function to get IClassFactory which will give you any kind of object in this

Re: Hooking into GC

2016-06-29 Thread MMJones via Digitalmars-d-learn
On Wednesday, 29 June 2016 at 10:07:19 UTC, Martin Nowak wrote: On Wednesday, 29 June 2016 at 02:18:27 UTC, MMJones wrote: I read somewhere that one can modify the D files from phobos and runtime to supply a stub for the GC. I would like to add some logging features to the GC. Does this not

Re: IUP, CD, IM, lua interfaces in D.

2016-06-29 Thread Chris via Digitalmars-d-announce
On Wednesday, 29 June 2016 at 14:01:52 UTC, mogu wrote: On Wednesday, 29 June 2016 at 09:48:19 UTC, Chris wrote: Have you seen this: https://github.com/DerelictOrg/DerelictLua There is also https://github.com/JakobOvrum/LuaD I have already looked over these projects before I wrote this

Re: IUP, CD, IM, lua interfaces in D.

2016-06-29 Thread mogu via Digitalmars-d-announce
On Wednesday, 29 June 2016 at 08:24:30 UTC, Dsby wrote: Great! 蘑菇大神威武、、 白玉大大威武

Re: IUP, CD, IM, lua interfaces in D.

2016-06-29 Thread mogu via Digitalmars-d-announce
On Wednesday, 29 June 2016 at 09:48:19 UTC, Chris wrote: Have you seen this: https://github.com/DerelictOrg/DerelictLua There is also https://github.com/JakobOvrum/LuaD I have already looked over these projects before I wrote this down. The problems are that luaD is in version 5.1 and

Re: -dip25 switch: time to make it always on?

2016-06-29 Thread Jacob Carlborg via Digitalmars-d
On 29/06/16 11:40, Walter Bright wrote: It was added for 2.067 back in March of 2015: https://dlang.org/changelog/2.067.0.html It's been a strong success. Time to make it the default instead of enabled by a switch? How is it a success? Grepping on "return ref" gives back four results in

Re: Accessing types by context

2016-06-29 Thread Jacob Carlborg via Digitalmars-d
On 29/06/16 05:11, Hiemlick Hiemlicker wrote: Suppose one has void test(myEnum e) enum myEnum { A,B,C } It would be very cool if we could do test(A) instead of test(myEnum.A). by context, the compiler can look first in the scope for something named A then look in the enum itself and prepend

Re: one-file pure D decoders for vorbis, flac and mp3

2016-06-29 Thread Suliman via Digitalmars-d-announce
On Wednesday, 29 June 2016 at 09:07:18 UTC, ketmar wrote: i decided to make some noise about those, as people may thinking about doing the ports themselves, and effectively double (or triple, or...) the work. so, here they are: * Vorbis decoder[1] (stb_vorbis port), PD; * FLAC decoder[2]

Re: I have a problem with D

2016-06-29 Thread Bienlein via Digitalmars-d
You can make use of the visitor pattern. The user that created some subclass then only needs to fill the visitor method with some stuff and that's it. The visitor was already initialized when created which happened before it was handed in to the visitor method of the subclass as a method

Re: Programming in D: A Happy Accident

2016-06-29 Thread Mike Parker via Digitalmars-d-announce
And once again, I forgot the reddit link (see, Vladimir... I'm the kind of guy that absolutely needs an edit button!). https://www.reddit.com/r/programming/comments/4qfg67/programming_in_d_a_happy_accident_how_a_turkish_d/

  1   2   >