Re: Abstract Classes

2017-12-05 Thread Ali Çehreli via Digitalmars-d-learn
On 12/05/2017 11:23 PM, IM wrote: Assume the following: interface IFace {   void foo();   void bar(); } abstract class A : IFace {   override void foo() {} } class B : A {   override void bar() {} } Now why this fails to compiler with the following message: --->>> function bar does not

Abstract Classes

2017-12-05 Thread IM via Digitalmars-d-learn
Assume the following: interface IFace { void foo(); void bar(); } abstract class A : IFace { override void foo() {} } class B : A { override void bar() {} } Now why this fails to compiler with the following message: --->>> function bar does not override any function, did you mean to

Re: Advanced code coverage analysis

2017-12-05 Thread Basile B. via Digitalmars-d
On Wednesday, 6 December 2017 at 03:15:38 UTC, Walter Bright wrote: On 12/5/2017 2:55 AM, Basile B. wrote: On Monday, 4 December 2017 at 20:33:56 UTC, thinwybk wrote: Hi everyone, as far as I know there is a statement coverage analyzer built into DMD https://dlang.org/code_coverage.html .

[Issue 17723] Replace Facebook on the front page with Weka.io

2017-12-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17723 --- Comment #4 from Seb --- > Shot a mail to Benoit from Netflix for their permission. PR with the Netflix logo: https://github.com/dlang/dlang.org/pull/1942 --

Re: git workflow for D

2017-12-05 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, December 06, 2017 04:56:17 Arun Chandrasekaran via Digitalmars-d-learn wrote: > Looks like Mercurial is going to be rewritten in Rust > https://www.mercurial-scm.org/wiki/OxidationPlan > > So Facebook don't use D? As I understand it, the main languages at Facebook are C++ and PHP,

Re: git workflow for D

2017-12-05 Thread Arun Chandrasekaran via Digitalmars-d-learn
On Monday, 4 December 2017 at 01:26:45 UTC, Arun Chandrasekaran wrote: On Sunday, 3 December 2017 at 23:39:49 UTC, Basile B. wrote: [...] If you still lose changes, you could try using Mercurial with hggit. It can be a bit slow, but not destructive as git itself. ;) I really wish

Re: Interfacing D with C: Getting Started

2017-12-05 Thread Arun Chandrasekaran via Digitalmars-d-announce
On Wednesday, 6 December 2017 at 04:33:38 UTC, Mike Parker wrote: On Wednesday, 6 December 2017 at 04:27:01 UTC, Mike Parker wrote: On Wednesday, 6 December 2017 at 04:14:35 UTC, Arun Chandrasekaran wrote: [...] Why is this? How are we expected to write cross platform code with long/ulong?

Re: Adding Markdown to Ddoc

2017-12-05 Thread Walter Bright via Digitalmars-d
On 12/5/2017 8:37 PM, Mike Parker wrote: Can you see me jumping up and down over here? No, but my seismometer is showing some action!

[Issue 18019] getopt: different behaviour for built-in and custom options

2017-12-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18019 Dmitry changed: What|Removed |Added Summary|getopt wrong behaviour |getopt: different behaviour

Re: Adding Markdown to Ddoc

2017-12-05 Thread Mike Parker via Digitalmars-d
On Wednesday, 6 December 2017 at 04:11:33 UTC, Walter Bright wrote: https://help.github.com/articles/basic-writing-and-formatting-syntax/ Anyone interested in picking up the flag? (I know this has come up before, and I've been opposed to it, but I've changed my mind.) Can you see me jumping

Re: Interfacing D with C: Getting Started

2017-12-05 Thread Mike Parker via Digitalmars-d-announce
On Wednesday, 6 December 2017 at 04:27:01 UTC, Mike Parker wrote: On Wednesday, 6 December 2017 at 04:14:35 UTC, Arun Chandrasekaran wrote: In D, long and ulong are always 8 bytes. This lines up with most 64-bit systems under the version(Posix) umbrella, where long and unsigned long are also 8

Re: Interfacing D with C: Getting Started

2017-12-05 Thread Mike Parker via Digitalmars-d-announce
On Wednesday, 6 December 2017 at 01:29:10 UTC, Joakim wrote: Typo: substitue And I thought I had managed to catch everything this time. Thanks! I think you should change the "long" explanation to "However, in C, they are 4 bytes" as it may not be clear to some that you're now talking

Re: Interfacing D with C: Getting Started

2017-12-05 Thread Mike Parker via Digitalmars-d-announce
On Wednesday, 6 December 2017 at 04:14:35 UTC, Arun Chandrasekaran wrote: In D, long and ulong are always 8 bytes. This lines up with most 64-bit systems under the version(Posix) umbrella, where long and unsigned long are also 8 bytes. However, they are 4 bytes on 32-bit architectures.

Re: Adding Markdown to Ddoc

2017-12-05 Thread rikki cattermole via Digitalmars-d
We should probably do the opposite. Build a markdown parser and then have a way to give the output an understanding of ddoc features. It will also be usable in other projects ;)

Adding Markdown to Ddoc

2017-12-05 Thread Walter Bright via Digitalmars-d
https://help.github.com/articles/basic-writing-and-formatting-syntax/ Anyone interested in picking up the flag? (I know this has come up before, and I've been opposed to it, but I've changed my mind.)

Re: Interfacing D with C: Getting Started

2017-12-05 Thread Arun Chandrasekaran via Digitalmars-d-announce
In D, long and ulong are always 8 bytes. This lines up with most 64-bit systems under the version(Posix) umbrella, where long and unsigned long are also 8 bytes. However, they are 4 bytes on 32-bit architectures. Moreover, they’re always 4 bytes on Windows, even on a 64-bit architecture. Why

[Issue 6400] opDispatch with WithStatement

2017-12-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6400 --- Comment #12 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/4dfa27ecb16639044961ad995a32352111c19edc Fix issue 6400 - Better interaction between with() and

Re: Advanced code coverage analysis

2017-12-05 Thread Walter Bright via Digitalmars-d
On 12/5/2017 2:55 AM, Basile B. wrote: On Monday, 4 December 2017 at 20:33:56 UTC, thinwybk wrote: Hi everyone, as far as I know there is a statement coverage analyzer built into DMD https://dlang.org/code_coverage.html . Are there code coverage analyzers for D which support branch coverage

[Issue 8858] DMD's -v option doesn't output dependencies with imports inside functions

2017-12-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=8858 --- Comment #5 from Jonathan Marler --- This PR (https://github.com/dlang/dmd/pull/7400) adds the "-deps-" option to dmd so that it will analyze dependencies without printing them. This will allow rdmd to get the imports via

Re: (Possibly paid opportunity): PyD - Win 64

2017-12-05 Thread Laeeth Isharc via Digitalmars-d
On Saturday, 2 December 2017 at 09:12:07 UTC, Thomas Mader wrote: On Friday, 1 December 2017 at 13:30:21 UTC, Laeeth Isharc wrote: Hi. I'd like to get PyD working on Windows 64. I think it's probably just a simple linking / library problem, but don't have time to work on it myself right

Re: lower case only first letter of word

2017-12-05 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/5/17 2:41 PM, kdevel wrote: On Tuesday, 5 December 2017 at 17:25:57 UTC, Steven Schveighoffer wrote: [...] struct LowerCaseFirst(R) // if(isSomeString!R) {    R src;    bool notFirst; // terrible name, but I want default false    dchar front() {   import std.uni: toLower;   return

Re: Interfacing D with C: Getting Started

2017-12-05 Thread Joakim via Digitalmars-d-announce
On Tuesday, 5 December 2017 at 16:06:19 UTC, Mike Parker wrote: This is the first post in a new tutorial series I'm doing on the blog. I've covered this topic elsewhere, so for most of the basics I just link to existing material. The purpose of this series is to delve into some of the trouble

Re: Embedded Containers

2017-12-05 Thread Mike Parker via Digitalmars-d
On Tuesday, 5 December 2017 at 19:13:10 UTC, A Guy With a Question wrote: Ok, so that worked. I still have the problem with importing though: mypackage: Item seems to generate the error: "Error: undefined identifier 'Item'" Which is weird, because I'm able to bring in Array through

cannot deduce template lambda from argument

2017-12-05 Thread aliak via Digitalmars-d-learn
Hi, Having a little trouble understanding lambda type deduction. I have this lambda: immutable lambda(T) = (T n) => n * n; and if I call it with an explicit type it works else it errors with: lambda cannot deduce function from argument types !()(int) auto x = lambda!int(2); // ok auto x =

Re: Building is slow!

2017-12-05 Thread Arek via Digitalmars-d
On Tuesday, 5 December 2017 at 19:28:12 UTC, Ivan Trombley wrote: There are issues with using "--build-mode=singleFile --parallel". On Windows I get errors saying that it can't write out some intermediate files (it looks like the file names may be too long for Windows) and on Linux, it makes

Re: StopWatch problem

2017-12-05 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, December 05, 2017 14:25:12 Ali Çehreli via Digitalmars-d-learn wrote: > Selective imports complicates matters. Changing the imports lets it > compile with 2.076: > > void main() { > import std.datetime; > import std.stdio: writeln; > > StopWatch sw; >

Re: StopWatch problem

2017-12-05 Thread Ali Çehreli via Digitalmars-d-learn
On 12/05/2017 01:45 PM, Jonathan M Davis wrote: > On Tuesday, December 05, 2017 21:33:53 Joel via Digitalmars-d-learn wrote: >> void main() { >>import std.datetime: Duration, msecs; >>import std.datetime.stopwatch: StopWatch; >> >>StopWatch sw; >>if (sw.peek.msecs) { >> >>}

Re: StopWatch problem

2017-12-05 Thread Joel via Digitalmars-d-learn
On Tuesday, 5 December 2017 at 21:45:20 UTC, Jonathan M Davis wrote: On Tuesday, December 05, 2017 21:33:53 Joel via Digitalmars-d-learn wrote: [...] core.time.msecs is an alias for core.time.dur!"msecs". It takes a long for the number of milliseconds and returns a Duration. If you want to

Re: Embedded Containers

2017-12-05 Thread A Guy With a Question via Digitalmars-d
On Tuesday, 5 December 2017 at 22:21:51 UTC, Jonathan M Davis wrote: On Tuesday, December 05, 2017 22:09:12 A Guy With a Question via Digitalmars-d wrote: Is there actually a difference between the c style cast and cast(type)? Other than verbosity... They're not the same. D's cast is not

Re: Embedded Containers

2017-12-05 Thread Jonathan M Davis via Digitalmars-d
On Tuesday, December 05, 2017 22:09:12 A Guy With a Question via Digitalmars-d wrote: > Is there actually a difference between the c style cast and > cast(type)? Other than verbosity... They're not the same. D's cast is not split up like C++'s casts are, but it's not exactly the same as C's cast

Re: Embedded Containers

2017-12-05 Thread A Guy With a Question via Digitalmars-d
On Tuesday, 5 December 2017 at 20:38:01 UTC, Timon Gehr wrote: On 05.12.2017 20:11, H. S. Teoh wrote: On Tue, Dec 05, 2017 at 07:09:50PM +, Adam D. Ruppe via Digitalmars-d wrote: On Tuesday, 5 December 2017 at 19:01:48 UTC, A Guy With a Question wrote: alias Items(T) = Array!Item(T);

[Issue 8858] DMD's -v option doesn't output dependencies with imports inside functions

2017-12-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=8858 Jonathan Marler changed: What|Removed |Added Status|REOPENED|RESOLVED

[Issue 8856] import inside function sometimes causes link errors

2017-12-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=8856 Issue 8856 depends on issue 8858, which changed state. Issue 8858 Summary: DMD's -v option doesn't output dependencies with imports inside functions https://issues.dlang.org/show_bug.cgi?id=8858 What|Removed |Added

[Issue 8858] DMD's -v option doesn't output dependencies with imports inside functions

2017-12-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=8858 Jonathan Marler changed: What|Removed |Added CC|

Re: StopWatch problem

2017-12-05 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, December 05, 2017 21:33:53 Joel via Digitalmars-d-learn wrote: > void main() { > import std.datetime: Duration, msecs; > import std.datetime.stopwatch: StopWatch; > > StopWatch sw; > if (sw.peek.msecs) { > > } > } > > I get this error with the code: > z.d(6): Error: function

StopWatch problem

2017-12-05 Thread Joel via Digitalmars-d-learn
void main() { import std.datetime: Duration, msecs; import std.datetime.stopwatch: StopWatch; StopWatch sw; if (sw.peek.msecs) { } } I get this error with the code: z.d(6): Error: function core.time.dur!"msecs".dur (long length) is not

[Issue 8856] import inside function sometimes causes link errors

2017-12-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=8856 Timothee Cour changed: What|Removed |Added CC|

[Issue 8858] DMD's -v option doesn't output dependencies with imports inside functions

2017-12-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=8858 --- Comment #3 from Timothee Cour --- *** Issue 8856 has been marked as a duplicate of this issue. *** --

Re: Embedded Containers

2017-12-05 Thread Timon Gehr via Digitalmars-d
On 05.12.2017 20:11, H. S. Teoh wrote: On Tue, Dec 05, 2017 at 07:09:50PM +, Adam D. Ruppe via Digitalmars-d wrote: On Tuesday, 5 December 2017 at 19:01:48 UTC, A Guy With a Question wrote: alias Items(T) = Array!Item(T); try: Array!(Item!(T)) I'm not quite sure I understand how to

[Issue 8856] import inside function sometimes causes link errors

2017-12-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=8856 Issue 8856 depends on issue 8858, which changed state. Issue 8858 Summary: DMD's -v option doesn't output dependencies with imports inside functions https://issues.dlang.org/show_bug.cgi?id=8858 What|Removed |Added

[Issue 8858] DMD's -v option doesn't output dependencies with imports inside functions

2017-12-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=8858 Timothee Cour changed: What|Removed |Added Status|RESOLVED|REOPENED

Re: lower case only first letter of word

2017-12-05 Thread Ali Çehreli via Digitalmars-d-learn
On 12/05/2017 11:41 AM, kdevel wrote: On Tuesday, 5 December 2017 at 17:25:57 UTC, Steven Schveighoffer wrote: But one cannot use the return value of lowerCaseFirst as argument for foo(string). Only the use as argument to writeln seems to work. That's how ranges work. LowerCaseFirst

unicode combinig mark/ std.uni question

2017-12-05 Thread ikod via Digitalmars-d
Hello, I have to create very basic IDNA (Internationalized Domain Names in Applications) library. There are two parts in IDNA - user input checks and punycode encoding/decoding. Punycode part already completed, and now I have to add some checks but I'm weak in unicode and cant find proper

Re: D User Survey

2017-12-05 Thread user1234 via Digitalmars-d-announce
On Monday, 4 December 2017 at 21:22:39 UTC, Guillaume Piolat wrote: On Friday, 1 December 2017 at 18:56:50 UTC, WebFreak001 wrote: Hi everyone, I made a public survey (everyone can look at the responses) and it would be great if you took some time and answered it. I think it will greatly

[Issue 18036] Documentation of moveFront() fails to mention different behavior depending on hasElaborateCopyConstructor

2017-12-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18036 --- Comment #1 from Ali Cehreli --- To add, the users are surprised that the source object is not set to .init in some cases. --

Re: What does the following program do?

2017-12-05 Thread Ali Çehreli via Digitalmars-d
On 12/05/2017 06:11 AM, Shachar Shemesh wrote: > "move" was supposed to initialize "source" to init. This does not appear > to be the case. Is that a bug? Where? The same issue came up recently in the learn group regarding moveFront(). The documentation fails to mention that the .init behavior

[Issue 18036] New: Documentation of moveFront() fails to mention different behavior depending on hasElaborateCopyConstructor

2017-12-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18036 Issue ID: 18036 Summary: Documentation of moveFront() fails to mention different behavior depending on hasElaborateCopyConstructor Product: D Version: D2

Re: lower case only first letter of word

2017-12-05 Thread kdevel via Digitalmars-d-learn
On Tuesday, 5 December 2017 at 17:25:57 UTC, Steven Schveighoffer wrote: [...] struct LowerCaseFirst(R) // if(isSomeString!R) { R src; bool notFirst; // terrible name, but I want default false dchar front() { import std.uni: toLower; return notFirst ? src.front :

Re: lower case only first letter of word

2017-12-05 Thread Ali Çehreli via Digitalmars-d-learn
On 12/05/2017 09:25 AM, Steven Schveighoffer wrote: Non-allocating version: struct LowerCaseFirst(R) // if(isSomeString!R) {    R src;    bool notFirst; // terrible name, but I want default false    dchar front() {   import std.uni: toLower;   return notFirst ? src.front :

Re: Embedded interfaces with generic members

2017-12-05 Thread A Guy With a Question via Digitalmars-d-learn
On Tuesday, 5 December 2017 at 19:27:37 UTC, Ali Çehreli wrote: On 12/05/2017 11:07 AM, A Guy With a Question wrote: > The following doesn't appear to be valid syntax. Array!Item!T You can ommit the template argument list parenteses only for single symbols. Starting with the full syntax:

Re: Embedded Containers

2017-12-05 Thread A Guy With a Question via Digitalmars-d
On Tuesday, 5 December 2017 at 19:19:50 UTC, colin wrote: On Tuesday, 5 December 2017 at 19:13:10 UTC, A Guy With a Question wrote: On Tuesday, 5 December 2017 at 19:09:50 UTC, Adam D. Ruppe wrote: [...] Ok, so that worked. I still have the problem with importing though: mypackage: Item

Re: Building is slow!

2017-12-05 Thread Ivan Trombley via Digitalmars-d
There are issues with using "--build-mode=singleFile --parallel". On Windows I get errors saying that it can't write out some intermediate files (it looks like the file names may be too long for Windows) and on Linux, it makes the executable at least 3 MB larger in release mode. Also, it

Re: Embedded interfaces with generic members

2017-12-05 Thread Ali Çehreli via Digitalmars-d-learn
On 12/05/2017 11:07 AM, A Guy With a Question wrote: > The following doesn't appear to be valid syntax. Array!Item!T You can ommit the template argument list parenteses only for single symbols. Starting with the full syntax: Array!(Item!(T)) Since Item!(T) uses a single symbol, T, you can

Re: Embedded Containers

2017-12-05 Thread H. S. Teoh via Digitalmars-d
On Tue, Dec 05, 2017 at 07:09:50PM +, Adam D. Ruppe via Digitalmars-d wrote: > On Tuesday, 5 December 2017 at 19:01:48 UTC, A Guy With a Question wrote: > > alias Items(T) = Array!Item(T); > > try: > > Array!(Item!(T)) > > > I'm not quite sure I understand how to create a generic container

Re: Embedded Containers

2017-12-05 Thread colin via Digitalmars-d
On Tuesday, 5 December 2017 at 19:13:10 UTC, A Guy With a Question wrote: On Tuesday, 5 December 2017 at 19:09:50 UTC, Adam D. Ruppe wrote: [...] Ok, so that worked. I still have the problem with importing though: mypackage: Item seems to generate the error: "Error: undefined identifier

Re: Embedded Containers

2017-12-05 Thread A Guy With a Question via Digitalmars-d
On Tuesday, 5 December 2017 at 19:09:50 UTC, Adam D. Ruppe wrote: On Tuesday, 5 December 2017 at 19:01:48 UTC, A Guy With a Question wrote: alias Items(T) = Array!Item(T); try: Array!(Item!(T)) I'm not quite sure I understand how to create a generic container interface or class in D.

Re: Embedded Containers

2017-12-05 Thread John Chapman via Digitalmars-d
On Tuesday, 5 December 2017 at 19:01:48 UTC, A Guy With a Question wrote: The following doesn't appear to be valid syntax. Array!Item!T I get the following error: "multiple ! arguments are not allowed" Which is ok...I get THAT error, however, this does not work either: alias

Embedded interfaces with generic members

2017-12-05 Thread A Guy With a Question via Digitalmars-d-learn
The following doesn't appear to be valid syntax. Array!Item!T I get the following error: "multiple ! arguments are not allowed" Which is ok...I get THAT error, however, this does not work either: alias Items(T) = Array!Item(T); This gives me the error: Error: function declaration

Re: Embedded Containers

2017-12-05 Thread Adam D. Ruppe via Digitalmars-d
On Tuesday, 5 December 2017 at 19:01:48 UTC, A Guy With a Question wrote: alias Items(T) = Array!Item(T); try: Array!(Item!(T)) I'm not quite sure I understand how to create a generic container interface or class in D. Just using the parenthesis should help. The thing with A!B!C is that

Re: Embedded Containers

2017-12-05 Thread A Guy With a Question via Digitalmars-d
Ah crud, I posted this to the wrong forum. Sorry.

Embedded Containers

2017-12-05 Thread A Guy With a Question via Digitalmars-d
The following doesn't appear to be valid syntax. Array!Item!T I get the following error: "multiple ! arguments are not allowed" Which is ok...I get THAT error, however, this does not work either: alias Items(T) = Array!Item(T); This gives me the error: Error: function declaration

Re: git workflow for D

2017-12-05 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Dec 04, 2017 at 12:02:37PM -0800, Ali Çehreli via Digitalmars-d-learn wrote: [...] > Paraphrasing someone I trust very much, "Never 'pull', always 'fetch > -p' and then rebase." I always use `git pull --ff-only`. Lets me pull when it's "safe", aborts if it will end up in a mess (i.e.,

Re: git workflow for D

2017-12-05 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Dec 04, 2017 at 06:51:42AM -0500, Nick Sabalausky (Abscissa) via Digitalmars-d-learn wrote: > On 12/03/2017 03:05 PM, bitwise wrote: > > I've finally started learning git, due to our team expanding beyond > > one person - awesome, right? > > PROTIP: Version control systems (no matter

Re: Interfacing D with C: Getting Started

2017-12-05 Thread aberba via Digitalmars-d-announce
On Tuesday, 5 December 2017 at 16:06:19 UTC, Mike Parker wrote: This is the first post in a new tutorial series I'm doing on the blog. I've covered this topic elsewhere, so for most of the basics I just link to existing material. The purpose of this series is to delve into some of the trouble

Re: GtkD 3.7.0 released, GTK+ with D.

2017-12-05 Thread aberba via Digitalmars-d-announce
On Saturday, 2 December 2017 at 08:17:24 UTC, helxi wrote: On Sunday, 15 October 2017 at 20:18:37 UTC, Mike Wey wrote: [...] I highly appreciate that the project is being actively maintained but I want to express my concern. It would be really nice if there was an easy tutorial for the

GSoC 2018 - Your project ideas

2017-12-05 Thread Seb via Digitalmars-d-announce
Hi all, Google Summer of Code (GSoC) 2018 is about to start soon [1] (the application period for organizations is in January 2018). Hence, I would very happy about any project ideas you have or projects which are important to you. And, of course, if you would be willing to mentor a student,

[Issue 18035] New: super does not work properly for template base classes

2017-12-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18035 Issue ID: 18035 Summary: super does not work properly for template base classes Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity:

[Issue 3720] Taking address of member functions possible without an instance

2017-12-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=3720 --- Comment #14 from Steven Schveighoffer --- (In reply to Mike Franklin from comment #13) > > My preference would be to embed in the type of the function pointer, the > > fact that it takes a hidden context pointer. Then the

Re: lower case only first letter of word

2017-12-05 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/5/17 10:00 AM, Mengu wrote: On Tuesday, 5 December 2017 at 14:34:57 UTC, Mengu wrote: On Tuesday, 5 December 2017 at 14:01:35 UTC, Marc wrote: On Tuesday, 5 December 2017 at 13:40:08 UTC, Daniel Kozak wrote: [...] Yes, this is not what I want. I want to convert only the first letter

Re: Release candidate vibe.d 0.8.2-rc.2

2017-12-05 Thread tetyys via Digitalmars-d-announce
very nice to see development going strong

Directory Size

2017-12-05 Thread Vino via Digitalmars-d-learn
Hi All, Is there any better ways to get the size of folders , The below code perfectly works , but i need return type as Array!(Tuple!(string, string)) rather then using the "Result.insertBack(d); Result.insertBack(to!string(SdFiles[].sum))" as per the below example. E.g:

Re: git workflow for D

2017-12-05 Thread John Gabriele via Digitalmars-d-learn
On Sunday, 3 December 2017 at 20:05:47 UTC, bitwise wrote: {snip} If anyone can offer any kind of advice, or an article that explains these things concisely and effectively, that would be helpful. I found some git-specific info in this wiki page:

Re: Object oriented programming and interfaces

2017-12-05 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/4/17 3:43 PM, Dirk wrote: Hi! I defined an interface: interface Medoid {     float distance( Medoid other );     uint id() const @property; } and a class implementing that interface: class Item : Medoid {     float distance( Item i ) {...}     uint id() const @property {...} } The

Re: Passing Function as an argument to another Function

2017-12-05 Thread Vino via Digitalmars-d-learn
On Monday, 4 December 2017 at 19:25:15 UTC, Ali Çehreli wrote: On 12/04/2017 04:52 AM, Vino wrote: > [...] Every expression has a type. 'auto' in that context (or 'const', etc.) just helps with not spelling-out that type. You can see the type with pragma(msg) and typeof: [...] Hi Ali,

[Issue 3720] Taking address of member functions possible without an instance

2017-12-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=3720 --- Comment #13 from Mike Franklin --- > My preference would be to embed in the type of the function pointer, the > fact that it takes a hidden context pointer. Then the compiler can disallow > simply calling it without stuffing

Interfacing D with C: Getting Started

2017-12-05 Thread Mike Parker via Digitalmars-d-announce
This is the first post in a new tutorial series I'm doing on the blog. I've covered this topic elsewhere, so for most of the basics I just link to existing material. The purpose of this series is to delve into some of the trouble spots that arise from the differences between the two languages.

Re: git workflow for D

2017-12-05 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/4/17 3:14 PM, Ali Çehreli wrote: Dear git experts, given 3 repos, now what are the steps? Is the following correct? What are the exact commands? Disclaimer: I'm not a git expert. - Only once, create the original repo as an upstream of your local repo. The wording is off

Re: lower case only first letter of word

2017-12-05 Thread Jacob Carlborg via Digitalmars-d-learn
On 2017-12-05 15:34, Mengu wrote: this is how i'd do it: string upcaseFirst(string wut) {   import std.ascii : toUpper;   import std.array : appender;   auto s = appender!string;   s ~= wut[0].toUpper;   s ~= wut[1..$];   return s.data; } That's not Unicode aware and is only safe to

Re: git workflow for D

2017-12-05 Thread Jesse Phillips via Digitalmars-d-learn
I'm going to answer with something that others may not agree with, maybe they can enlighten me, but let me first get a generic principle of git and answer some questions. Git has 2 types of branches, local branches (you know them as just branches) and remotes (which have their own local

[Issue 3720] Taking address of member functions possible without an instance

2017-12-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=3720 Steven Schveighoffer changed: What|Removed |Added CC|

Re: Object oriented programming and interfaces

2017-12-05 Thread Jesse Phillips via Digitalmars-d-learn
On Monday, 4 December 2017 at 20:43:27 UTC, Dirk wrote: Hi! I defined an interface: interface Medoid { float distance( Medoid other ); uint id() const @property; } and a class implementing that interface: class Item : Medoid { float distance( Item i ) {...} uint id() const

Re: lower case only first letter of word

2017-12-05 Thread Mengu via Digitalmars-d-learn
On Tuesday, 5 December 2017 at 14:34:57 UTC, Mengu wrote: On Tuesday, 5 December 2017 at 14:01:35 UTC, Marc wrote: On Tuesday, 5 December 2017 at 13:40:08 UTC, Daniel Kozak wrote: [...] Yes, this is not what I want. I want to convert only the first letter of the word to lower case and left

Re: lower case only first letter of word

2017-12-05 Thread Mengu via Digitalmars-d-learn
On Tuesday, 5 December 2017 at 14:01:35 UTC, Marc wrote: On Tuesday, 5 December 2017 at 13:40:08 UTC, Daniel Kozak wrote: but this will change all other uppercase to lowercase, so maybe it is not what you want. If you really want just change first char to upper, then there is nothing wrong to

Re: What does the following program do?

2017-12-05 Thread Nemanja Boric via Digitalmars-d
On Tuesday, 5 December 2017 at 14:11:02 UTC, Shachar Shemesh wrote: import std.algorithm: move; import std.stdio; import std.string; class A { int val; override string toString() const { return "A(%s)".format(val); } } struct B { int val; } void main() { B b =

Release candidate vibe.d 0.8.2-rc.2

2017-12-05 Thread Sönke Ludwig via Digitalmars-d-announce
The second release candidate for 0.8.1 is out (the first one was not announced). 0.8.2 notably contains a HTTP forward proxy, handling incoming HTTP requests on custom transports and a MongoDB based session store. On top of that, there are many smaller improvements in the HTTP server, web/REST

What does the following program do?

2017-12-05 Thread Shachar Shemesh via Digitalmars-d
import std.algorithm: move; import std.stdio; import std.string; class A { int val; override string toString() const { return "A(%s)".format(val); } } struct B { int val; } void main() { B b = B(12); B* bp = B* bp2; writefln("bp=%s bp2=%s", bp, bp2);

Re: lower case only first letter of word

2017-12-05 Thread Marc via Digitalmars-d-learn
On Tuesday, 5 December 2017 at 13:40:08 UTC, Daniel Kozak wrote: but this will change all other uppercase to lowercase, so maybe it is not what you want. If you really want just change first char to upper, then there is nothing wrong to do it yourself On Tue, Dec 5, 2017 at 2:37 PM, Daniel

No line numbers in stack trace (again)

2017-12-05 Thread Nordlöw via Digitalmars-d-learn
If I get the following stack trace ___without line numbers___ (instead ??:?) what's missing? core.exception.AssertError@src/knet/linking.d(444): Assertion failure ??:? _d_assertp [0x5092ab19] ??:? pure @safe knet.storage.Edge

Re: lower case only first letter of word

2017-12-05 Thread Daniel Kozak via Digitalmars-d-learn
but this will change all other uppercase to lowercase, so maybe it is not what you want. If you really want just change first char to upper, then there is nothing wrong to do it yourself On Tue, Dec 5, 2017 at 2:37 PM, Daniel Kozak wrote: > Something like this:

Re: lower case only first letter of word

2017-12-05 Thread ketmar via Digitalmars-d-learn
Marc wrote: Does D have a native function to capitalize only the first letter of the word? (I'm asking that so I might avoid reinvent the wheel, which I did sometimes in D) http://dpldocs.info/experimental-docs/std.string.capitalize.html

Re: lower case only first letter of word

2017-12-05 Thread Daniel Kozak via Digitalmars-d-learn
Something like this: https://dlang.org/phobos/std_uni.html#asCapitalized On Tue, Dec 5, 2017 at 2:31 PM, Marc via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> wrote: > Does D have a native function to capitalize only the first letter of the > word? (I'm asking that so I might avoid

lower case only first letter of word

2017-12-05 Thread Marc via Digitalmars-d-learn
Does D have a native function to capitalize only the first letter of the word? (I'm asking that so I might avoid reinvent the wheel, which I did sometimes in D)

Re: Python and D (PyD)

2017-12-05 Thread Fat_Umpalumpa via Digitalmars-d-learn
Omg this was working a few days ago just fine! Now I can't even start the histogram example! I haven't changed the code and I know this worked a week ago. dub still builds the program, however now when running the program, I get an error

Re: Advanced code coverage analysis

2017-12-05 Thread Johan Engelen via Digitalmars-d
On Monday, 4 December 2017 at 20:33:56 UTC, thinwybk wrote: Hi everyone, as far as I know there is a statement coverage analyzer built into DMD https://dlang.org/code_coverage.html . Are there code coverage analyzers for D which support branch coverage and other more advanced coverage

Re: Object oriented programming and interfaces

2017-12-05 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 5 December 2017 at 07:47:32 UTC, Dirk wrote: The distance function is implementation dependend and can only be computed between two objects of the same class (in this example the class is Item). Just don't put it in the interface. Leave it in the individual classes with the

[Issue 18034] New: SIMD optimization issues

2017-12-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18034 Issue ID: 18034 Summary: SIMD optimization issues Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: major Priority: P1

Re: Advanced code coverage analysis

2017-12-05 Thread Basile B. via Digitalmars-d
On Monday, 4 December 2017 at 20:33:56 UTC, thinwybk wrote: Hi everyone, as far as I know there is a statement coverage analyzer built into DMD https://dlang.org/code_coverage.html . Are there code coverage analyzers for D which support branch coverage and other more advanced coverage

Re: Object oriented programming and interfaces

2017-12-05 Thread bauss via Digitalmars-d-learn
On Tuesday, 5 December 2017 at 08:08:55 UTC, Daniel Kozak wrote: You can do something like this: interface Medoid(T) { float distance( T other ); uint id() const @property; } class Item : Medoid!(Item) { float distance( Item m ) { return 0.;} uint id() const @property { return

Re: Object oriented programming and interfaces

2017-12-05 Thread Daniel Kozak via Digitalmars-d-learn
You can do something like this: interface Medoid(T) { float distance( T other ); uint id() const @property; } class Item : Medoid!(Item) { float distance( Item m ) { return 0.;} uint id() const @property { return 1; } } class MedoidClassification { this(T:Medoid!T)(T[] list)

Re: Object oriented programming and interfaces

2017-12-05 Thread Andrea Fontana via Digitalmars-d-learn
On Tuesday, 5 December 2017 at 07:47:32 UTC, Dirk wrote: What would be a good way to implement this? Did you tried to use introspection?

  1   2   >