Re: Using template mixin, with or without mixin ?

2017-04-08 Thread Meta via Digitalmars-d-learn
On Saturday, 8 April 2017 at 22:37:18 UTC, ag0aep6g wrote: On 04/08/2017 11:59 PM, Meta wrote: enum a = 0; template test1() { enum b1 = a; //Okay, a is in scope at the declaration site //enum c = d1; Error: undefined identifier d1 This line works just fine, actually. There's really

Does the CTFE engine reuse variables?

2017-04-08 Thread Jethro via Digitalmars-d-learn
Suppose one has a function that will be used in CTFE and it uses a lot of local variables. Does each call of the function end up allocating space for these without ever releasing them or are they reused? or used on the stack like normal?

Re:dmd Backend converted to Boost License

2017-04-08 Thread jollie via Digitalmars-d-announce
Walter Bright Wrote in message: > https://github.com/dlang/dmd/pull/6680 > > Yes, this is for real! Symantec has given their permission to relicense it. > Thank you, Symantec! > Another long term goal met. Congratulations! Will this change in licensing pave the

Re: Proposal 2: Exceptions and @nogc

2017-04-08 Thread Nicholas Wilson via Digitalmars-d
On Sunday, 9 April 2017 at 03:26:14 UTC, Walter Bright wrote: My previous version did not survive implementation. Here's the revised version. I have submitted it as a DIP, and there's a trial implementation up: https://github.com/dlang/dmd/pull/6681 [ . . . ] Pardon my ignorance but it

tour.dlang.org is down

2017-04-08 Thread Abhishek via Digitalmars-d
tour.dlang.org is down

Re: Proposal 2: Exceptions and @nogc

2017-04-08 Thread Joakim via Digitalmars-d
On Sunday, 9 April 2017 at 03:26:14 UTC, Walter Bright wrote: My previous version did not survive implementation. Here's the revised version. I have submitted it as a DIP, and there's a trial implementation up: https://github.com/dlang/dmd/pull/6681 Two small procedural notes - I don't

Proposal 2: Exceptions and @nogc

2017-04-08 Thread Walter Bright via Digitalmars-d
My previous version did not survive implementation. Here's the revised version. I have submitted it as a DIP, and there's a trial implementation up: https://github.com/dlang/dmd/pull/6681 - Exceptions and @nogc version 2 Problem ===

BinaryHeap crashes upon insertion if heapified with an array of length 1?

2017-04-08 Thread TheGag96 via Digitalmars-d-learn
I'm trying to use a binary heap initialized with one element. However, this always seems to cause a range violation for some reason. This small example will do it: import std.stdio, std.container; void main() { auto pq = heapify([5]); pq.insert(8); } ...And it produces this error:

Re: CTFE Status 2

2017-04-08 Thread Stefan Koch via Digitalmars-d
On Saturday, 8 April 2017 at 19:03:52 UTC, crimaniak wrote: On Saturday, 8 April 2017 at 09:14:17 UTC, Stefan Koch wrote: This is a question for D.Learn. please post there. Yes, I did it already and know, it is not possible for now:

Re: Time from timestamp?

2017-04-08 Thread timotheecour via Digitalmars-d-learn
Might I suggest that you simply define an enum for UnixEpoch that's a SysTime. Then you can do whatever you want. ping on this.

Re: dmd Backend converted to Boost License

2017-04-08 Thread Walter Bright via Digitalmars-d-announce
On 4/8/2017 4:24 PM, Jethro wrote: Does this mean that we can now embed the D compiler in to a commercial D app to be used as a scripting like engine(D app compiles D code then dynamically links in code while running)? Yes.

[Issue 17313] New: more Phobos Ddoc warnings when compiling

2017-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17313 Issue ID: 17313 Summary: more Phobos Ddoc warnings when compiling Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: minor Priority:

[Issue 17312] New: std.range.package has Ddoc warnings when compiled

2017-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17312 Issue ID: 17312 Summary: std.range.package has Ddoc warnings when compiled Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: minor

Re: dmd Backend converted to Boost License

2017-04-08 Thread Jethro via Digitalmars-d-announce
On Friday, 7 April 2017 at 15:14:40 UTC, Walter Bright wrote: https://github.com/dlang/dmd/pull/6680 Yes, this is for real! Symantec has given their permission to relicense it. Thank you, Symantec! Does this mean that we can now embed the D compiler in to a commercial D app to be used as a

Re: Using template mixin, with or without mixin ?

2017-04-08 Thread ag0aep6g via Digitalmars-d-learn
On 04/08/2017 11:59 PM, Meta wrote: enum a = 0; template test1() { enum b1 = a; //Okay, a is in scope at the declaration site //enum c = d1; Error: undefined identifier d1 This line works just fine, actually. There's really no difference between a normal template and a mixin template

Re: Using template mixin, with or without mixin ?

2017-04-08 Thread Meta via Digitalmars-d-learn
On Saturday, 8 April 2017 at 09:47:07 UTC, biocyberman wrote: On Friday, 7 April 2017 at 23:53:12 UTC, Ali Çehreli wrote: The difference is that you can't use funcgen as a regular template: funcgen!(void, void); Error: template instance funcgen!(void, void) mixin templates are not

Re: GNU Guile D language interop

2017-04-08 Thread bachmeier via Digitalmars-d-learn
On Saturday, 8 April 2017 at 21:29:58 UTC, new2d wrote: Can someone experienced in D port the GNU Guile embedding tutorial over? It would be great if Guile can be used to embed in D Thank you https://www.gnu.org/software/guile/docs/guile-tut/tutorial.html#Fundamentals I have embedded Guile

Re: Exceptions in @nogc code

2017-04-08 Thread Christophe via Digitalmars-d
On Saturday, 8 April 2017 at 20:09:49 UTC, Walter Bright wrote: On 4/7/2017 9:30 AM, deadalnix wrote: On Thursday, 6 April 2017 at 22:11:55 UTC, Walter Bright wrote: On 4/6/2017 2:18 PM, H. S. Teoh via Digitalmars-d wrote: You were asking for a link to deadalnix's original discussion, and

Re: Convert this C macro kroundup32 to D mixin?

2017-04-08 Thread Ali Çehreli via Digitalmars-d-learn
On 04/08/2017 03:11 AM, biocyberman wrote: > On Saturday, 8 April 2017 at 10:02:01 UTC, Mike Parker wrote: >> >> I would expect if you implement it as a function the compiler will >> inline it. You can always use the pragma(inline, true) [1] with >> -inline to verify. >> >> [1]

-fPIC and 32-bit dmd.conf settings

2017-04-08 Thread Joseph Rushton Wakeling via Digitalmars-d-learn
Hello folks, The default dmd.conf settings for 64-bit environments include the -fPIC flag (for good reason), but the settings for 32-bit environments do not. Any particular reason for this? Thanks & best wishes, -- Joe

GNU Guile D language interop

2017-04-08 Thread new2d via Digitalmars-d-learn
Can someone experienced in D port the GNU Guile embedding tutorial over? It would be great if Guile can be used to embed in D Thank you https://www.gnu.org/software/guile/docs/guile-tut/tutorial.html#Fundamentals

Re: Whole source-tree statefull preprocessing, notion of a whole program

2017-04-08 Thread Boris-Barboris via Digitalmars-d
On Saturday, 8 April 2017 at 17:57:11 UTC, Vladimir Panteleev wrote: Yes; in my opinion, I think that's desirable because it is aligned with the unidirectional flow of information from higher-level components to lower-level ones, and does not impose a particular configuration framework onto

DMD crash, LDC crash, out of memory, no error display, etc

2017-04-08 Thread Nierjerson via Digitalmars-d
The project I am working on, which is near completion: https://github.com/IllusionSoftware/COM2D Automates COM wrapping almost completely. That is, it takes a converted COM idl file and generates a D wrapper which handles all the marshaling, invoking, creation, etc. The problem is that DMD

Re: dmd Backend converted to Boost License

2017-04-08 Thread Walter Bright via Digitalmars-d-announce
On 4/8/2017 12:07 PM, Martin Tschierschke wrote: May be we can talk about pr strategy for D in general at Dconf. I expect that how to best take advantage of this development will be a hot topic at DConf.

Re: Exceptions in @nogc code

2017-04-08 Thread Walter Bright via Digitalmars-d
On 4/7/2017 9:30 AM, deadalnix wrote: On Thursday, 6 April 2017 at 22:11:55 UTC, Walter Bright wrote: On 4/6/2017 2:18 PM, H. S. Teoh via Digitalmars-d wrote: You were asking for a link to deadalnix's original discussion, and that's the link I found (somebody else also posted a link to the

[Issue 17303] type error in the href url under the link Systems Programming

2017-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17303 --- Comment #5 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dlang.org https://github.com/dlang/dlang.org/commit/f3f173bce3b27e7c81ee8a73383e052f593bf889 Fix Issue 17303 - type error in the href url

Re: Exceptions in @nogc code

2017-04-08 Thread Martin Nowak via Digitalmars-d
On Sunday, 2 April 2017 at 21:05:39 UTC, ketmar wrote: no, it won't. it is completely safe to free non-GC-owned memory with GC[0]. [0] http://dpldocs.info/experimental-docs/core.memory.GC.free.html At the cost of a GC mutex lock and metadata lookup, not too horrible, but not free either.

Re: D support for the Meson build system

2017-04-08 Thread Martin Nowak via Digitalmars-d-announce
On Friday, 7 April 2017 at 07:57:02 UTC, kinke wrote: So while compiling each file separately in parallel is potentially much much faster, the produced release binary may be slower due to less/no cross-module inlining (e.g., LDC's option is still experimental and known to have issues). In

[Issue 17309] [REG 2.073.2] constructor template doesn't infer `pure`

2017-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17309 Jack Stouffer changed: What|Removed |Added CC||j...@jackstouffer.com

Re: dmd Backend converted to Boost License

2017-04-08 Thread Martin Tschierschke via Digitalmars-d-announce
On Friday, 7 April 2017 at 15:14:40 UTC, Walter Bright wrote: https://github.com/dlang/dmd/pull/6680 Yes, this is for real! Symantec has given their permission to relicense it. Thank you, Symantec! Good news! Thank you! I gave a hint of this - additionally mentioning Dconf - to heise.de,

Re: CTFE Status 2

2017-04-08 Thread crimaniak via Digitalmars-d
On Saturday, 8 April 2017 at 09:14:17 UTC, Stefan Koch wrote: This is a question for D.Learn. please post there. Yes, I did it already and know, it is not possible for now: https://forum.dlang.org/post/crkxlbtfhsplxfila...@forum.dlang.org This is exact reason why I asked, how hard _to

Re: dmd Backend converted to Boost License

2017-04-08 Thread Walter Bright via Digitalmars-d-announce
On 4/8/2017 10:16 AM, Iain Buclaw via Digitalmars-d-announce wrote: To make sure you have your history correct. GDC wrote the work-alike x86 assembler, and later dual-licensed it to share with LDC. A little while later I dropped it from GDC as it was not really fit for purpose, and rather

Re: Whole source-tree statefull preprocessing, notion of a whole program

2017-04-08 Thread Vladimir Panteleev via Digitalmars-d
On Saturday, 8 April 2017 at 14:20:49 UTC, Boris-Barboris wrote: Looks like your current implementation does not go in that direction, seeing as it uses properties for field access. Am i mistaken in assumption that such simple getter property will be optimized to direct field access? Anyways,

Re: dmd Backend converted to Boost License

2017-04-08 Thread Iain Buclaw via Digitalmars-d-announce
On 8 April 2017 at 18:48, Walter Bright via Digitalmars-d-announce wrote: > On 4/8/2017 1:36 AM, Iain Buclaw via Digitalmars-d-announce wrote: >> >> On 7 April 2017 at 23:49, Walter Bright via Digitalmars-d-announce >>

Re: dmd Backend converted to Boost License

2017-04-08 Thread Walter Bright via Digitalmars-d-announce
On 4/8/2017 1:33 AM, Nick Sabalausky (Abscissa) wrote: AFAIK, Symantec were under no particular obligation here, but none-the-less chose the consumer/developer-friendly route, and I for one couldn't be more appreciative. I'm one who can be very critical of, well, everything, but the fine folks

Re: dmd Backend converted to Boost License

2017-04-08 Thread Walter Bright via Digitalmars-d-announce
On 4/8/2017 1:36 AM, Iain Buclaw via Digitalmars-d-announce wrote: On 7 April 2017 at 23:49, Walter Bright via Digitalmars-d-announce wrote: Note that this also resolves the long-standing legal issue with D's inline assembler being backend licensed, and so

Re: dmd Backend converted to Boost License

2017-04-08 Thread Walter Bright via Digitalmars-d-announce
On 4/8/2017 1:19 AM, Nick Sabalausky (Abscissa) wrote: Anyone "in the know" have a any "inside scoop" regarding the such organization's perspective on the "zlib/libpng" license? I tend to favor it for my own OSS projects, since it's (in my perspective) at least as liberal as Boost, but very,

Re: Exceptions in @nogc code

2017-04-08 Thread Jacob Carlborg via Digitalmars-d
On 2017-04-07 18:30, deadalnix wrote: Because it is in a ML, I cannot post a link. Is it this mailing list: http://forum.dlang.org/group/study ? -- /Jacob Carlborg

[Issue 17302] [SPEC] QualifiedName mangling does not match compiler.

2017-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17302 --- Comment #3 from Rainer Schuetze --- see https://github.com/dlang/dlang.org/pull/1626 --

Re: Function names and lambdas

2017-04-08 Thread Jacob Carlborg via Digitalmars-d-learn
On 2017-04-07 23:05, Ali Çehreli wrote: Main reason for D not supporting the name-to-pointer mapping? I don't think so because as far as I know this has been the case since very early on but UFCS came very much later. More likely due to properties, i.e. calling functions without parentheses.

Re: Is DMD breaking BigInt?

2017-04-08 Thread Meta via Digitalmars-d-learn
On Saturday, 8 April 2017 at 12:14:31 UTC, Russel Winder wrote: On Fri, 2017-04-07 at 22:47 +, Meta via Digitalmars-d-learn wrote: […] Do you have the -dip1000 switch enabled? Not as far as I know. Why would I want to do that? You wouldn't as the std lib doesn't work with it yet.

[Issue 17302] [SPEC] QualifiedName mangling does not match compiler.

2017-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17302 Rainer Schuetze changed: What|Removed |Added CC||r.sagita...@gmx.de

Re: dmd Backend converted to Boost License

2017-04-08 Thread Jacob Carlborg via Digitalmars-d-announce
On 2017-04-07 17:14, Walter Bright wrote: https://github.com/dlang/dmd/pull/6680 Yes, this is for real! Symantec has given their permission to relicense it. Thank you, Symantec! This is some amazing news!! :) -- /Jacob Carlborg

[Issue 17310] New: [SPEC] Ambiguous mangling for 'Y', Objective-C function or variadic arguments?

2017-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17310 Issue ID: 17310 Summary: [SPEC] Ambiguous mangling for 'Y', Objective-C function or variadic arguments? Product: D Version: D2 Hardware: x86_64 OS: Windows

Re: Whole source-tree statefull preprocessing, notion of a whole program

2017-04-08 Thread Boris-Barboris via Digitalmars-d
On Saturday, 8 April 2017 at 13:09:59 UTC, Vladimir Panteleev wrote: On Saturday, 8 April 2017 at 10:11:11 UTC, Boris-Barboris wrote: 2). After preprocessing I wish to have fully-typed, safe and fast Config class, that contains all the groups I defined for it in it's body, and not as

[Issue 17303] type error in the href url under the link Systems Programming

2017-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17303 a.louan...@gmail.com changed: What|Removed |Added Status|ASSIGNED|RESOLVED URL|

[Issue 17303] type error in the href url under the link Systems Programming

2017-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17303 a.louan...@gmail.com changed: What|Removed |Added Status|NEW |ASSIGNED

Release Candidate 2.074.0-rc1

2017-04-08 Thread Martin Nowak via Digitalmars-d-announce
First release candidate for 2.074.0. http://dlang.org/download.html#dmd_beta http://dlang.org/changelog/2.074.0.html Please report any bugs at https://issues.dlang.org -Martin

Re: Whole source-tree statefull preprocessing, notion of a whole program

2017-04-08 Thread Vladimir Panteleev via Digitalmars-d
On Saturday, 8 April 2017 at 10:11:11 UTC, Boris-Barboris wrote: 1). I had to save template parameter group_name_par into group_name. Looks like template mixin doesn't support closures. A minor inconvenience, I would say, and it's not what I would like to talk about. Template mixins' scope

Re: Is DMD breaking BigInt?

2017-04-08 Thread ag0aep6g via Digitalmars-d-learn
On 04/07/2017 07:06 PM, Russel Winder via Digitalmars-d-learn wrote: factorial.d(71,15): Error: template std.bigint.BigInt.__ctor cannot deduce function from argument types !()(string) immutable On 04/08/2017 02:18 PM, Russel Winder via Digitalmars-d-learn wrote:

[Issue 17306] dmd segfault on package imports

2017-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17306 ag0ae...@gmail.com changed: What|Removed |Added Keywords||ice CC|

[Issue 17309] New: constructor template doesn't infer `pure`

2017-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17309 Issue ID: 17309 Summary: constructor template doesn't infer `pure` Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Keywords: rejects-valid

Re: Is DMD breaking BigInt?

2017-04-08 Thread Johan Engelen via Digitalmars-d-learn
On Saturday, 8 April 2017 at 12:16:10 UTC, Russel Winder wrote: Fedora Rawhide is now on LLVM 4.0 is that going to be a problem building LDC? Of course not! ;-) -Johan

[Issue 17308] [TEST/PROCESS] Beta releases should not be built with -release

2017-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17308 Iain Buclaw changed: What|Removed |Added CC||ibuc...@gdcproject.org

[Issue 17308] New: [TEST/PROCESS] Beta releases should not be built with -release

2017-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17308 Issue ID: 17308 Summary: [TEST/PROCESS] Beta releases should not be built with -release Product: D Version: D2 Hardware: All OS: All Status: NEW

Re: Dlang forum: some feature requests

2017-04-08 Thread Vladimir Panteleev via Digitalmars-d
On Saturday, 8 April 2017 at 12:15:45 UTC, biocyberman wrote: @Admins: Please move to the right place for me if this is not the right one. 1. Code formatting seems to be support in all other parts of dlang.org, but not in the forum. It would be nice to be able to format code for readability.

Dlang forum: some feature requests

2017-04-08 Thread biocyberman via Digitalmars-d
@Admins: Please move to the right place for me if this is not the right one. 1. Code formatting seems to be support in all other parts of dlang.org, but not in the forum. It would be nice to be able to format code for readability. 2. Automatic exclude ones own text to avoid 'overquoting'.

Re: Is DMD breaking BigInt?

2017-04-08 Thread Russel Winder via Digitalmars-d-learn
On Fri, 2017-04-07 at 20:29 +, Jack Stouffer via Digitalmars-d- learn wrote: > On Friday, 7 April 2017 at 17:06:31 UTC, Russel Winder wrote: > > Simple Dub build of a Factorial example using Unit-Threaded for  > > testing. Works fine with ldc2 breaks with dmd. > > Can you post the code your

[Issue 17307] [ICE] TypeBasic::implicitConvTo: After error "anonymous struct can only be a part of an aggregate"

2017-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17307 Iain Buclaw changed: What|Removed |Added CC||ibuc...@gdcproject.org

[Issue 17307] New: [ICE] TypeBasic::implicitConvTo: After error "anonymous struct can only be a part of an aggregate"

2017-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17307 Issue ID: 17307 Summary: [ICE] TypeBasic::implicitConvTo: After error "anonymous struct can only be a part of an aggregate" Product: D Version: D2 Hardware: All

Re: Is DMD breaking BigInt?

2017-04-08 Thread Russel Winder via Digitalmars-d-learn
On Fri, 2017-04-07 at 20:38 +, David Nadlinger via Digitalmars-d- learn wrote: > […] > > You might want to check with LDC from Git master first to see  > whether it is in fact a 2.073-related problem. — David Rats, I thought I'd got away from manually building LDC. Fedora Rawhide is now on

Re: Is DMD breaking BigInt?

2017-04-08 Thread Russel Winder via Digitalmars-d-learn
On Fri, 2017-04-07 at 22:47 +, Meta via Digitalmars-d-learn wrote: > […] > > Do you have the -dip1000 switch enabled? Not as far as I know. Why would I want to do that? -- Russel. = Dr Russel Winder t: +44 20

Re: Convert this C macro kroundup32 to D mixin?

2017-04-08 Thread biocyberman via Digitalmars-d-learn
On Saturday, 8 April 2017 at 11:24:02 UTC, Nicholas Wilson wrote: The ':' means that it applies to everything that follows it, so while it doesn't matters in this example if you had pragma( inline, true ): int kroundup32( int x) { ... } auto someVeryLargeFunction( Args args) { // ... }

[Issue 17306] New: dmd segfault on package imports

2017-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17306 Issue ID: 17306 Summary: dmd segfault on package imports Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: normal Priority: P1

[Issue 17303] type error in the href url under the link Systems Programming

2017-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17303 ag0ae...@gmail.com changed: What|Removed |Added Keywords||pull CC|

Re: Convert this C macro kroundup32 to D mixin?

2017-04-08 Thread Nicholas Wilson via Digitalmars-d-learn
On Saturday, 8 April 2017 at 11:01:34 UTC, biocyberman wrote: On Saturday, 8 April 2017 at 10:09:47 UTC, Mike Parker wrote: T kroundup32(T)(T x) { pragma(inline, true); --(x); (x)|=(x)>>1; (x)|=(x)>>2; (x)|=(x)>>4; (x)|=(x)>>8; (x)|=(x)>>16; return ++(x); } I

Re: Convert this C macro kroundup32 to D mixin?

2017-04-08 Thread biocyberman via Digitalmars-d-learn
On Saturday, 8 April 2017 at 10:09:47 UTC, Mike Parker wrote: T kroundup32(T)(T x) { pragma(inline, true); --(x); (x)|=(x)>>1; (x)|=(x)>>2; (x)|=(x)>>4; (x)|=(x)>>8; (x)|=(x)>>16; return ++(x); } I also came up with this: import std.stdio; pragma( inline, true

Whole source-tree statefull preprocessing, notion of a whole program

2017-04-08 Thread Boris-Barboris via Digitalmars-d
Hello! It's a bit long one, I guess, but I'd like to have some discussion of topic. I'll start with a concrete use case: For the sake of entertainment, I tried to wrote generic configuration management class. I was inspired by oslo_config python package that I have to deal with on work. I

Re: Convert this C macro kroundup32 to D mixin?

2017-04-08 Thread biocyberman via Digitalmars-d-learn
On Saturday, 8 April 2017 at 10:02:01 UTC, Mike Parker wrote: I would expect if you implement it as a function the compiler will inline it. You can always use the pragma(inline, true) [1] with -inline to verify. [1] https://dlang.org/spec/pragma.html#inline Thanks for mentioning pragma.

Re: Convert this C macro kroundup32 to D mixin?

2017-04-08 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 8 April 2017 at 10:02:01 UTC, Mike Parker wrote: I would expect if you implement it as a function the compiler will inline it. You can always use the pragma(inline, true) [1] with -inline to verify. [1] https://dlang.org/spec/pragma.html#inline This gives me no error, so it

Re: Convert this C macro kroundup32 to D mixin?

2017-04-08 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 8 April 2017 at 09:53:47 UTC, biocyberman wrote: What is the D mixin version equivalent to this macro: #define kroundup32(x) (--(x), (x)|=(x)>>1, (x)|=(x)>>2, (x)|=(x)>>4, (x)|=(x)>>8, (x)|=(x)>>16, ++(x)) The macro looks cryptic. What the macro does has been explained here:

[Issue 17305] [SPEC] ABI page still has references to D1 Phobos

2017-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17305 Iain Buclaw changed: What|Removed |Added CC||ibuc...@gdcproject.org

[Issue 17305] New: [SPEC] ABI page still has references to D1 Phobos

2017-04-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17305 Issue ID: 17305 Summary: [SPEC] ABI page still has references to D1 Phobos Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal

Convert this C macro kroundup32 to D mixin?

2017-04-08 Thread biocyberman via Digitalmars-d-learn
What is the D mixin version equivalent to this macro: #define kroundup32(x) (--(x), (x)|=(x)>>1, (x)|=(x)>>2, (x)|=(x)>>4, (x)|=(x)>>8, (x)|=(x)>>16, ++(x)) The macro looks cryptic. What the macro does has been explained here:

Re: Using template mixin, with or without mixin ?

2017-04-08 Thread biocyberman via Digitalmars-d-learn
On Friday, 7 April 2017 at 23:53:12 UTC, Ali Çehreli wrote: The difference is that you can't use funcgen as a regular template: funcgen!(void, void); Error: template instance funcgen!(void, void) mixin templates are not regular templates I think it's good practice to use 'mixin

Re: CTFE Status 2

2017-04-08 Thread Stefan Koch via Digitalmars-d
On Saturday, 8 April 2017 at 09:19:03 UTC, rikki cattermole wrote: Nope, not valid for D.learn as it is not currently possible. perfectly valid in D.learn. You could have given the answer that is it not possible there.

Re: CTFE Status 2

2017-04-08 Thread rikki cattermole via Digitalmars-d
On 08/04/2017 10:14 AM, Stefan Koch wrote: On Saturday, 8 April 2017 at 08:50:27 UTC, crimaniak wrote: Hi! Is it hard to implement some way to access symbol from UDA constructor of symbol? ``` class uda { this() { // Iterate by Foo members foreach (member;

Re: CTFE Status 2

2017-04-08 Thread Stefan Koch via Digitalmars-d
On Saturday, 8 April 2017 at 08:50:27 UTC, crimaniak wrote: Hi! Is it hard to implement some way to access symbol from UDA constructor of symbol? ``` class uda { this() { // Iterate by Foo members foreach (member; __traits(allMembers, __SYMBOL__)) ...

Re: CTFE Status 2

2017-04-08 Thread crimaniak via Digitalmars-d
Hi! Is it hard to implement some way to access symbol from UDA constructor of symbol? ``` class uda { this() { // Iterate by Foo members foreach (member; __traits(allMembers, __SYMBOL__)) ... } } @uda struct Foo { } ```

Re: dmd Backend converted to Boost License

2017-04-08 Thread Iain Buclaw via Digitalmars-d-announce
On 7 April 2017 at 23:49, Walter Bright via Digitalmars-d-announce wrote: > Note that this also resolves the long-standing legal issue with D's inline > assembler being backend licensed, and so not portable to gdc/ldc. > That makes the assumption that

Re: dmd Backend converted to Boost License

2017-04-08 Thread Nick Sabalausky (Abscissa) via Digitalmars-d-announce
On 04/07/2017 11:14 AM, Walter Bright wrote: https://github.com/dlang/dmd/pull/6680 Yes, this is for real! Symantec has given their permission to relicense it. Thank you, Symantec! Wow! This is HUGE news for D, and may I say, I think some *major* respect (and "props, j00!") are

Re: dmd Backend converted to Boost License

2017-04-08 Thread Nick Sabalausky (Abscissa) via Digitalmars-d-announce
On 04/07/2017 05:44 PM, Walter Bright wrote: 2. It's on all of the "Accepted OSS Licenses" lists that major corps have because of Boost itself being used in those companies. If your license isn't on the list, your project isn't being used. Yup. We figured every corporation that uses C++ has

Re: pointer not aligned

2017-04-08 Thread Mogaki via Digitalmars-d-learn
On Sunday, 2 April 2017 at 19:00:30 UTC, Jon Degenhardt wrote: On Friday, 31 March 2017 at 04:41:10 UTC, Joel wrote: Linking... ld: warning: pointer not aligned at address 0x10017A4C9 (_D30TypeInfo_AxS3std4file8DirEntry6__initZ + 16 from

Re: [OT] ISO C++ 17 changes

2017-04-08 Thread Martin Nowak via Digitalmars-d
On Tuesday, 4 April 2017 at 13:45:47 UTC, Meta wrote: I mean what goes on inside fold. If you look at the C++ example it's very concise and IMO beautiful: auto f(Args ...args) { return (0 + ... + args); } It's special syntax for a very limited (only infix operators) and rather obscure

Re: overring binary

2017-04-08 Thread rikki cattermole via Digitalmars-d-learn
On 08/04/2017 7:46 AM, Jethro wrote: I have a custom type and I'm trying to do things like x~1 and 1~x. I can get x~1 no problem by overriding the op "~" but how to I get 1~x to convert 1 in to typeof(x)? instead of x in to typeof(1) so to speak? I really want D to realize that 1~x is suppose

overring binary

2017-04-08 Thread Jethro via Digitalmars-d-learn
I have a custom type and I'm trying to do things like x~1 and 1~x. I can get x~1 no problem by overriding the op "~" but how to I get 1~x to convert 1 in to typeof(x)? instead of x in to typeof(1) so to speak? I really want D to realize that 1~x is suppose to use ~ of x, not 1.