Re: Modules

2016-07-23 Thread rikki cattermole via Digitalmars-d-learn
On 24/07/2016 2:28 PM, Rufus Smith wrote: NM, ignore. Seems it was something else going on. Although, if you know how how dmd resolves this stuff exactly, it would be nice to know. Does it just use the module names regardless of path or does the path where the module is located have any

Re: Modules

2016-07-23 Thread Rufus Smith via Digitalmars-d-learn
NM, ignore. Seems it was something else going on. Although, if you know how how dmd resolves this stuff exactly, it would be nice to know. Does it just use the module names regardless of path or does the path where the module is located have any play(assuming they are properly passed to the

Modules

2016-07-23 Thread Rufus Smith via Digitalmars-d-learn
How do module names and actual folder paths relate? For my own libraries, I use the file path as module name, more or less. e.g., module foo.bar.x; is in folder foo\bar. I imported some external lib that has it's own layout, but I wanted to incorporate it in to my lib, so I stuck it in a

Re: Cannot compare object.opEquals is not nogc

2016-07-23 Thread Rufus Smith via Digitalmars-d-learn
On Saturday, 23 July 2016 at 22:48:07 UTC, Lodovico Giaretta wrote: On Saturday, 23 July 2016 at 21:44:05 UTC, Rufus Smith wrote: On Saturday, 23 July 2016 at 17:27:24 UTC, Lodovico Giaretta wrote: - we trust what we are doing: e.g. we cannot mark a thing @nogc, but we know it is and the

Re: How to pause terminal in D on Linux?

2016-07-23 Thread Zekereth via Digitalmars-d-learn
On Saturday, 23 July 2016 at 19:08:00 UTC, WhatMeWorry wrote: What I thought would be trivial is becoming a nightmare. Can anybody set me straight. Thanks in advance. [...] Use the getchar() function. void pause(const string msg = "Press enter/return to continue...") { write(msg);

Re: Expression template

2016-07-23 Thread ketmar via Digitalmars-d-learn
On Saturday, 23 July 2016 at 23:36:40 UTC, Etranger wrote: is there any good benchmarking lib like the #[bench] in rust that I can use ?) dunno, i'm usually just using std.datetime.benchmark.

Re: Expression template

2016-07-23 Thread ag0aep6g via Digitalmars-d-learn
On 07/23/2016 01:05 PM, Etranger wrote: 1- Is there a cleaner way to do it ? I had to use struct because I want every thing to happen at compile time and on the stack (without gc). And I had to use string mixins because template mixin does not work the way I tried to use it ( see the error last

Expression template

2016-07-23 Thread Etranger via Digitalmars-d-learn
On Saturday, 23 July 2016 at 19:08:45 UTC, ketmar wrote: 2OP: sorry, i can barely read that code. this has nothing to do with your skills, it is the topic -- i've never seen clean lazy evaluation code. after all, this is a hack. still, i think that such a library worth at least some work. as

Re: Cannot compare object.opEquals is not nogc

2016-07-23 Thread Lodovico Giaretta via Digitalmars-d-learn
On Saturday, 23 July 2016 at 21:44:05 UTC, Rufus Smith wrote: On Saturday, 23 July 2016 at 17:27:24 UTC, Lodovico Giaretta wrote: - we trust what we are doing: e.g. we cannot mark a thing @nogc, but we know it is and the profiler confirms that no allocation happens, so we are happy; our

Re: Cannot compare object.opEquals is not nogc

2016-07-23 Thread Lodovico Giaretta via Digitalmars-d-learn
On Saturday, 23 July 2016 at 21:44:05 UTC, Rufus Smith wrote: Templates are not the end all be all. They don't allow for run-time polymorphism, which is an important aspect of software. Ok, so you need runtime polymorphism. And you want it in @nogc code. That's not difficult. Just have the

Re: Cannot compare object.opEquals is not nogc

2016-07-23 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, July 23, 2016 21:33:29 Rufus Smith via Digitalmars-d-learn wrote: > I am trying to write some general code that works on arbitrary > types. I need to compare, obviously, as that is relatively basic > thing on objects. That's part of of why attribute inferrence works on templates.

Re: Cannot compare object.opEquals is not nogc

2016-07-23 Thread Rufus Smith via Digitalmars-d-learn
On Saturday, 23 July 2016 at 17:27:24 UTC, Lodovico Giaretta wrote: On Saturday, 23 July 2016 at 17:04:42 UTC, Jonathan Marler wrote: On Saturday, 23 July 2016 at 16:46:20 UTC, Jonathan Marler wrote: [...] Actually Im going to disagree with myself. This technique actually wouldn't work with

Re: Cannot compare object.opEquals is not nogc

2016-07-23 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, July 23, 2016 11:25:02 Steven Schveighoffer via Digitalmars-d- learn wrote: > The real problem here is that there is a base method at all. We have > been striving to remove it at some point, but it is very difficult due > to all the legacy code which is written. > > Almost all the

Re: Cannot compare object.opEquals is not nogc

2016-07-23 Thread Rufus Smith via Digitalmars-d-learn
On Saturday, 23 July 2016 at 17:23:37 UTC, Marco Leise wrote: Am Sat, 23 Jul 2016 13:18:03 + schrieb Rufus Smith : Trying to compare a *ptr value with a value in nogc code results in the error: Error: @nogc function '...' cannot call non-@nogc function

Re: JSON Serialization with runtime filtering.

2016-07-23 Thread yawniek via Digitalmars-d-learn
On Friday, 22 July 2016 at 12:36:31 UTC, Alexander Milushev wrote: I there any json serialization library which allow to make decision about ignoring fields in runtime? I trying to write rest client but server accept either 'cmd' or 'args' field for example and I need to find solution. can

Re: DConf 2016 on YouTube

2016-07-23 Thread burjui via Digitalmars-d-announce
Excellent, thanks to all people involved! DConfs are my favourite conferences: great speakers and very interesting topics. I wish Adam Ruppe had a talk at this one, I absolutely love his presentation style and sense of humour.

Re: proposal: private module-level import for faster compilation

2016-07-23 Thread Jacob Carlborg via Digitalmars-d
On 2016-07-22 10:28, Dicebot wrote: .. which naturally leads to watching about Benjamin DConf talk about fixing "export" and that is where everything clicks together. Organizing large projects as bunch of small static libraries per package and defining public API of those via `export` (and not

Re: Transform/Compile to C/CPP as a target

2016-07-23 Thread Jacob Carlborg via Digitalmars-d-learn
On 2016-07-23 14:27, ParticlePeter wrote: Is there any kind of project or workflow that converts D (subset) to C/CPP ? No idea about the status but: https://github.com/adamdruppe/tools/blob/dtoh/dtoh.d -- /Jacob Carlborg

Re: Expression template

2016-07-23 Thread ketmar via Digitalmars-d-learn
2OP: sorry, i can barely read that code. this has nothing to do with your skills, it is the topic -- i've never seen clean lazy evaluation code. after all, this is a hack. still, i think that such a library worth at least some work. as for "is my code/approach is good enough", i know only two

How to pause terminal in D on Linux?

2016-07-23 Thread WhatMeWorry via Digitalmars-d-learn
What I thought would be trivial is becoming a nightmare. Can anybody set me straight. Thanks in advance. void writeAndPause(string s) { writeln(s); // writeln("Press any key to continue..."); // works fine on Windows // executeShell("pause");// works fine on

Re: Expression template

2016-07-23 Thread ketmar via Digitalmars-d-learn
On Saturday, 23 July 2016 at 12:27:39 UTC, rikki cattermole wrote: Either way I recommend you not worry about it. Compilers can be smart and dmd is mostly good enough in this department. he has something to worry about. remember, this is scientific department, where ours 4x4 matrices are

[Issue 12918] Copying-constructing structs onto the heap

2016-07-23 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12918 Thayne changed: What|Removed |Added CC||astrotha...@gmail.com ---

[Issue 16312] "Error: Overlapping fields" caused by use of deprecated features in referred to fields

2016-07-23 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16312 --- Comment #3 from Marco Leise --- I just got the overlapping fields error after a bunch of "undefined identifier" errors. So it doesn't only happen after deprecated features are used. It happens with both dmd 2.069 and 2.071.1

Re: Cannot compare object.opEquals is not nogc

2016-07-23 Thread Lodovico Giaretta via Digitalmars-d-learn
On Saturday, 23 July 2016 at 17:04:42 UTC, Jonathan Marler wrote: On Saturday, 23 July 2016 at 16:46:20 UTC, Jonathan Marler wrote: [...] Actually Im going to disagree with myself. This technique actually wouldn't work with virtual methods:) I don't think we have the big problems with

Re: Cannot compare object.opEquals is not nogc

2016-07-23 Thread Marco Leise via Digitalmars-d-learn
Am Sat, 23 Jul 2016 13:18:03 + schrieb Rufus Smith : > Trying to compare a *ptr value with a value in nogc code results > in the error: > > Error: @nogc function '...' cannot call non-@nogc function > 'object.opEquals' > > Shouldn't object opEquals be

Re: DConf Videos

2016-07-23 Thread Marco Leise via Digitalmars-d
Am Thu, 21 Jul 2016 23:04:11 + schrieb sarn : > On Thursday, 21 July 2016 at 13:45:28 UTC, Steven Schveighoffer > wrote: > > On 6/6/16 6:40 AM, sarn wrote: > >> What's the best source of DConf videos at the moment? Are > >> there are any > >> edited versions

Re: Cannot compare object.opEquals is not nogc

2016-07-23 Thread Jonathan Marler via Digitalmars-d-learn
On Saturday, 23 July 2016 at 16:46:20 UTC, Jonathan Marler wrote: [...] Actually Im going to disagree with myself. This technique actually wouldn't work with virtual methods:)

Re: Terminix Stable 1.2.0 Released

2016-07-23 Thread Iain Buclaw via Digitalmars-d-announce
On 23 July 2016 at 16:24, Matthias Klumpp via Digitalmars-d-announce wrote: > > 3) Making LDC available for more architectures, or making GDC support a > higher version of the Phobos standard library and build shared libraries. > At time, LDC is the better

Re: Cannot compare object.opEquals is not nogc

2016-07-23 Thread Jonathan Marler via Digitalmars-d-learn
On Saturday, 23 July 2016 at 15:25:02 UTC, Steven Schveighoffer wrote: On 7/23/16 10:53 AM, Rufus Smith wrote: On Saturday, 23 July 2016 at 14:15:03 UTC, Lodovico Giaretta wrote: On Saturday, 23 July 2016 at 13:18:03 UTC, Rufus Smith wrote: Trying to compare a *ptr value with a value in nogc

[Issue 16312] "Error: Overlapping fields" caused by use of deprecated features in referred to fields

2016-07-23 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16312 Marco Leise changed: What|Removed |Added Keywords|rejects-valid | --- Comment #2 from

Re: Cannot compare object.opEquals is not nogc

2016-07-23 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/23/16 10:53 AM, Rufus Smith wrote: On Saturday, 23 July 2016 at 14:15:03 UTC, Lodovico Giaretta wrote: On Saturday, 23 July 2016 at 13:18:03 UTC, Rufus Smith wrote: Trying to compare a *ptr value with a value in nogc code results in the error: Error: @nogc function '...' cannot call

Re: Cannot compare object.opEquals is not nogc

2016-07-23 Thread Lodovico Giaretta via Digitalmars-d-learn
On Saturday, 23 July 2016 at 14:53:49 UTC, Rufus Smith wrote: Um, this isn't right. GC code can always call non-gc code. If you mark opEquals nogc, it breaks nothing except implementations of opEquals that use the GC. GC code can still call it nogc opequals, it only enforces opEquals code to

Re: Cannot compare object.opEquals is not nogc

2016-07-23 Thread Rufus Smith via Digitalmars-d-learn
On Saturday, 23 July 2016 at 14:15:03 UTC, Lodovico Giaretta wrote: On Saturday, 23 July 2016 at 13:18:03 UTC, Rufus Smith wrote: Trying to compare a *ptr value with a value in nogc code results in the error: Error: @nogc function '...' cannot call non-@nogc function 'object.opEquals'

[Issue 16314] New: private copyBackwards is broken

2016-07-23 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16314 Issue ID: 16314 Summary: private copyBackwards is broken Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: major Priority: P1

Re: Terminix Stable 1.2.0 Released

2016-07-23 Thread qsdjlf via Digitalmars-d-announce
On Saturday, 23 July 2016 at 14:24:08 UTC, Matthias Klumpp wrote: On Saturday, 23 July 2016 at 11:40:20 UTC, qsdjlf wrote: [...] integration in distribution could be a good signal, what a say, Excellent signal, for the D language. I know that some people here are mostly starving at commercial

Re: Terminix Stable 1.2.0 Released

2016-07-23 Thread Matthias Klumpp via Digitalmars-d-announce
On Saturday, 23 July 2016 at 11:40:20 UTC, qsdjlf wrote: [...] integration in distribution could be a good signal, what a say, Excellent signal, for the D language. I know that some people here are mostly starving at commercial usage...but for me such tools written in D and available in linux

Re: Cannot compare object.opEquals is not nogc

2016-07-23 Thread Lodovico Giaretta via Digitalmars-d-learn
On Saturday, 23 July 2016 at 13:18:03 UTC, Rufus Smith wrote: Trying to compare a *ptr value with a value in nogc code results in the error: Error: @nogc function '...' cannot call non-@nogc function 'object.opEquals' Shouldn't object opEquals be marked? If object.opEquals is marked

Cannot compare object.opEquals is not nogc

2016-07-23 Thread Rufus Smith via Digitalmars-d-learn
Trying to compare a *ptr value with a value in nogc code results in the error: Error: @nogc function '...' cannot call non-@nogc function 'object.opEquals' Shouldn't object opEquals be marked?

Re: Terminix Stable 1.2.0 Released

2016-07-23 Thread Gerald via Digitalmars-d-announce
On Saturday, 23 July 2016 at 09:27:14 UTC, phant0m wrote: Nice work! By the way, Terminix is present in the Arch Linux AUR. But it seems that it's very inconvenient for me. I don't use gnome and I don't like the fat titlebars (client side decorations). Moreover, the Terminix window doesn't

Re: Expression template

2016-07-23 Thread Etranger via Digitalmars-d-learn
On Saturday, 23 July 2016 at 12:27:39 UTC, rikki cattermole wrote: If you evaluate it as v = a + b + c instead of v = a + (b + c) you will still have a temporary value. Remember structs are just the values they carry and are basically optimized out. Either way I recommend you not worry about

Re: Transform/Compile to C/CPP as a target

2016-07-23 Thread ParticlePeter via Digitalmars-d-learn
On Saturday, 23 July 2016 at 12:29:45 UTC, rikki cattermole wrote: On 24/07/2016 12:27 AM, ParticlePeter wrote: Is there any kind of project or workflow that converts D (subset) to C/CPP ? This probably will interest you for ldc:

Re: Transform/Compile to C/CPP as a target

2016-07-23 Thread rikki cattermole via Digitalmars-d-learn
On 24/07/2016 12:27 AM, ParticlePeter wrote: Is there any kind of project or workflow that converts D (subset) to C/CPP ? This probably will interest you for ldc: http://stackoverflow.com/questions/5180914/llvm-ir-back-to-human-readable-source-language

Re: Expression template

2016-07-23 Thread rikki cattermole via Digitalmars-d-learn
On 24/07/2016 12:09 AM, Etranger wrote: On Saturday, 23 July 2016 at 11:19:34 UTC, rikki cattermole wrote: On 23/07/2016 11:05 PM, Etranger wrote: [snip] * start of code ** import std.stdio; import std.traits; import std.conv; struct VecExpression(alias

Transform/Compile to C/CPP as a target

2016-07-23 Thread ParticlePeter via Digitalmars-d-learn
Is there any kind of project or workflow that converts D (subset) to C/CPP ?

Re: Expression template

2016-07-23 Thread Etranger via Digitalmars-d-learn
On Saturday, 23 July 2016 at 11:19:34 UTC, rikki cattermole wrote: On 23/07/2016 11:05 PM, Etranger wrote: [snip] * start of code ** import std.stdio; import std.traits; import std.conv; struct VecExpression(alias mixins) { mixin (mixins);

Re: Terminix Stable 1.2.0 Released

2016-07-23 Thread qsdjlf via Digitalmars-d-announce
On Friday, 22 July 2016 at 19:24:58 UTC, Gerald wrote: On Friday, 22 July 2016 at 17:30:30 UTC, sdhdfhed wrote: On Friday, 22 July 2016 at 13:54:41 UTC, Gerald wrote: I've pushed out the latest stable version of Terminix, a tiling terminal emulator for Linux written in D using GtkD. The

Re: DConf 2016 on YouTube

2016-07-23 Thread qsdjlf via Digitalmars-d-announce
On Thursday, 21 July 2016 at 16:35:44 UTC, Ali Çehreli wrote: Stealing the opportunity to announce this news... :) https://www.youtube.com/playlist?list=PL3jwVPmk_PRyTWWtTAZyvmjDF4pm6EX6z Reddit: https://www.reddit.com/r/programming/comments/4txf9w/dconf_2016_video_playlist/ Ali

Re: Expression template

2016-07-23 Thread rikki cattermole via Digitalmars-d-learn
On 23/07/2016 11:05 PM, Etranger wrote: [snip] * start of code ** import std.stdio; import std.traits; import std.conv; struct VecExpression(alias mixins) { mixin (mixins); VecSum!(typeof(this), VecExpression!(RHS)) opBinary(string op, alias RHS)(ref

Expression template

2016-07-23 Thread Etranger via Digitalmars-d-learn
Hello all, I will greatly appreciate if you could help me with my first step in the D land. *YOU CAN SKIP DIRECTLY TO THE QUESTION BELLOW*: Please allow me to introduce myself and give you my feelings about the D language then I'll ask my question. I'm a mathematician that works mainly on

Re: Terminix Stable 1.2.0 Released

2016-07-23 Thread Martin Tschierschke via Digitalmars-d-announce
On Friday, 22 July 2016 at 13:54:41 UTC, Gerald wrote: I've pushed out the latest stable version of Terminix, a tiling terminal emulator for Linux written in D using GtkD. The following new features have been added: Design changes as per discussion in #372 Support for background images

Re: DConf 2016 on YouTube

2016-07-23 Thread lobo via Digitalmars-d-announce
On Thursday, 21 July 2016 at 16:35:44 UTC, Ali Çehreli wrote: Stealing the opportunity to announce this news... :) https://www.youtube.com/playlist?list=PL3jwVPmk_PRyTWWtTAZyvmjDF4pm6EX6z Reddit: https://www.reddit.com/r/programming/comments/4txf9w/dconf_2016_video_playlist/ Ali

Re: full path to source file __FILE__

2016-07-23 Thread Martin Tschierschke via Digitalmars-d-learn
On Thursday, 21 July 2016 at 19:54:34 UTC, Jonathan Marler wrote: Is there a way to get the full path of the current source file? Something like: __FILE_FULL_PATH__ I'm asking because I'm rewriting a batch script in D, meant to be ran with rdmd. However, the script needs to know it's own

Re: Terminix Stable 1.2.0 Released

2016-07-23 Thread phant0m via Digitalmars-d-announce
On Friday, 22 July 2016 at 13:54:41 UTC, Gerald wrote: I've pushed out the latest stable version of Terminix, a tiling terminal emulator for Linux written in D using GtkD. The following new features have been added: Design changes as per discussion in #372 Support for background images

Re: DConf Videos

2016-07-23 Thread Walter Bright via Digitalmars-d
On 7/23/2016 12:42 AM, Dmitry wrote: I added DConf 2016 Thanks!

Re: DConf Videos

2016-07-23 Thread Dmitry via Digitalmars-d
On Saturday, 23 July 2016 at 02:32:49 UTC, Walter Bright wrote: http://wiki.dlang.org/Videos (though it needs updating) I added DConf 2016

[Issue 16313] New: Duplicate symbol generated

2016-07-23 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16313 Issue ID: 16313 Summary: Duplicate symbol generated Product: D Version: D2 Hardware: x86_64 OS: Mac OS X Status: NEW Severity: major Priority: P1