Re: Cost of .dup vs. instantiation

2014-05-29 Thread Chris via Digitalmars-d-learn
On Thursday, 29 May 2014 at 12:04:35 UTC, monarch_dodra wrote: On Thursday, 29 May 2014 at 08:49:10 UTC, Chris wrote: monarch_dodra: Hm. This last point might be an issue. If I process a large input (text in this case) then I might run into trouble with append as a class variable. I also had

Is this a bug or illegal code?

2014-05-29 Thread safety0ff via Digitalmars-d-learn
//*** CODE ** mixin(version = foo;); version(foo) { void main(){} } //** END CODE *** If it's illegal in D, what is the reason where is documented? The reason I was considering such a construct is the following: Some C libraries have an associated config.h header that

Re: Is this a bug or illegal code?

2014-05-29 Thread Steven Schveighoffer via Digitalmars-d-learn
On Thu, 29 May 2014 10:45:28 -0400, safety0ff safety0ff@gmail.com wrote: //*** CODE ** mixin(version = foo;); version(foo) { void main(){} } //** END CODE *** If it's illegal in D, what is the reason where is documented? The reason I was considering such a

Re: Is this a bug or illegal code?

2014-05-29 Thread safety0ff via Digitalmars-d-learn
On Thursday, 29 May 2014 at 15:02:48 UTC, Steven Schveighoffer wrote: Even if that is valid code, you are much better off using enums and static if. enum includeSomeFeature = ... static if(includeSomeFeature) { ... } These work much more like #defines, and can be seen outside the module.

Vance Miller Kitchens

2014-05-29 Thread semarmesem via Digitalmars-d-learn
Vance Miller Kitchens really do represent excellent value for money. No wonder Big kitchen stores hate Vance Miller Kitchens so much.

Building 32bit program with MSVC?

2014-05-29 Thread Jeremy DeHaan via Digitalmars-d-learn
I know that we can use MSVC to build a 64 bit program, but is it also possible to use it to build a 32 bit program as well?

Re: Building 32bit program with MSVC?

2014-05-29 Thread Remo via Digitalmars-d-learn
On Thursday, 29 May 2014 at 18:25:19 UTC, Jeremy DeHaan wrote: I know that we can use MSVC to build a 64 bit program, but is it also possible to use it to build a 32 bit program as well? Yes of course it is possible. It you are talking about Visual-D then it is possible there too.

Read file on compiler time.

2014-05-29 Thread Remo via Digitalmars-d-learn
Is there a way to read a text file into a sting at compile time in D2 ? It would be great to read for example some JSON file and then parse it using CTFU and create some D code based on it.

Re: Read file on compiler time.

2014-05-29 Thread Adam D. Ruppe via Digitalmars-d-learn
string a = import(file.txt); dmd yourprogram.d -Jlocation_of_file so for example dmd yourprogram.d -J. if file.txt is in the same directory as the .d file.

Re: Read file on compiler time.

2014-05-29 Thread Remo via Digitalmars-d-learn
On Thursday, 29 May 2014 at 20:21:32 UTC, Adam D. Ruppe wrote: string a = import(file.txt); dmd yourprogram.d -Jlocation_of_file so for example dmd yourprogram.d -J. if file.txt is in the same directory as the .d file. Excellent, thank you Adam! Now another question is it also possible

Re: Read file on compiler time.

2014-05-29 Thread bearophile via Digitalmars-d-learn
Remo: is it also possible to save/write string at compile time? There is pragma(msg, ...) but it's a little crappy. There are plans and a pull request for a good _ctWrite, but it's stalled for reasons unknown to me. Bye, bearophile

Re: Read file on compiler time.

2014-05-29 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 29 May 2014 at 20:38:30 UTC, Remo wrote: Now another question is it also possible to save/write string at compile time? Sort of, use pragma(msg, some string); and it will be printed out when that code is compiled. Important that it is when the code is compiled, NOT when the

Re: Read file on compiler time.

2014-05-29 Thread Remo via Digitalmars-d-learn
On Thursday, 29 May 2014 at 20:44:09 UTC, bearophile wrote: Remo: is it also possible to save/write string at compile time? There is pragma(msg, ...) but it's a little crappy. There are plans and a pull request for a good _ctWrite, but it's stalled for reasons unknown to me. Bye,

Re: Building 32bit program with MSVC?

2014-05-29 Thread Jonathan M Davis via Digitalmars-d-learn
On Thu, 29 May 2014 20:12:52 + Remo via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Thursday, 29 May 2014 at 18:25:19 UTC, Jeremy DeHaan wrote: I know that we can use MSVC to build a 64 bit program, but is it also possible to use it to build a 32 bit program as well?

Examining Members of a module at Compile Time

2014-05-29 Thread Meta via Digitalmars-d-learn
I'd like to get a list of all classes in the current module, so I came up with this code: class Test {} class TestChild: Test {} class TestChildChild: TestChild {} void main() { foreach (item; __traits(allMembers, mixin(__MODULE__))) { static if

Re: Examining Members of a module at Compile Time

2014-05-29 Thread Dicebot via Digitalmars-d-learn
class Test {} class TestChild: Test {} class TestChildChild: TestChild {} alias Alias(alias Symbol) = Symbol; // this does the trick void main() { foreach (item; __traits(allMembers, mixin(__MODULE__))) { alias sym = Alias!(__traits(getMember, mixin(__MODULE__), item));

Re: Examining Members of a module at Compile Time

2014-05-29 Thread Meta via Digitalmars-d-learn
On Thursday, 29 May 2014 at 23:18:32 UTC, Dicebot wrote: class Test {} class TestChild: Test {} class TestChildChild: TestChild {} alias Alias(alias Symbol) = Symbol; // this does the trick void main() { foreach (item; __traits(allMembers, mixin(__MODULE__))) { alias sym =

Question about wrapping raw C pointers from D

2014-05-29 Thread Rusty D. Shackleford via Digitalmars-d-learn
Hi, in C++ I can use smart pointers to wrap raw pointers with custom deleter to automatically manage C resources. Is there anything like this in D?

[Issue 12819] New: Refused purity conversion of immutable array of arrays

2014-05-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12819 Issue ID: 12819 Summary: Refused purity conversion of immutable array of arrays Product: D Version: D2 Hardware: All OS: All Status: NEW Keywords:

[Issue 12816] Increment (++) operator on a BigInt array item

2014-05-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12816 hst...@quickfur.ath.cx changed: What|Removed |Added CC||hst...@quickfur.ath.cx --

[Issue 12813] Parser is confused between float and UFC syntax

2014-05-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12813 hst...@quickfur.ath.cx changed: What|Removed |Added CC||hst...@quickfur.ath.cx --

[Issue 12699] Possibly wrong code in object_.d

2014-05-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12699 hst...@quickfur.ath.cx changed: What|Removed |Added CC||hst...@quickfur.ath.cx --

[Issue 1452] std.cstream doc incorrect - imports of stream and stdio are not public

2014-05-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=1452 Blake Anderton rbander...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 12820] New: DMD can inline calls to functions that use alloca, allocating the memory in the caller function instead.

2014-05-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12820 Issue ID: 12820 Summary: DMD can inline calls to functions that use alloca, allocating the memory in the caller function instead. Product: D Version: unspecified Hardware: All

[Issue 6474] aliasing type tuple elements' members is onerous

2014-05-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6474 monkeywork...@hotmail.com changed: What|Removed |Added CC||monkeywork...@hotmail.com ---

[Issue 5030] Operators don't work with AssociativeArray!(T1,T2)

2014-05-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=5030 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 5810] Struct postincrement generates 'no effect' error if used on struct member

2014-05-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=5810 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added Keywords||pull Hardware|x86

[Issue 11084] std.algorithm.scan

2014-05-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11084 Vlad Levenfeld vlevenf...@gmail.com changed: What|Removed |Added CC||vlevenf...@gmail.com

[Issue 12821] New: Missed redundant storage class / protection errors.

2014-05-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12821 Issue ID: 12821 Summary: Missed redundant storage class / protection errors. Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity:

[Issue 12821] Missed redundant storage class / protection errors.

2014-05-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12821 Iain Buclaw ibuc...@gdcproject.org changed: What|Removed |Added Keywords||accepts-invalid, spec

[Issue 12821] Missed redundant storage class / protection errors.

2014-05-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12821 Iain Buclaw ibuc...@gdcproject.org changed: What|Removed |Added CC||ibuc...@gdcproject.org

<    1   2   3