Re: Create mixins from a list of strings

2014-01-10 Thread Jakob Ovrum
On Saturday, 11 January 2014 at 07:45:31 UTC, Casper Færgemand wrote: Have: enum (or is immutable array better?) array = ["derp", "lala"]; Want: mixin("some syntax" ~ array[0]); mixin("some syntax" ~ array[1]); You can use template argument lists for indexable compile-time lists: --- import

Create mixins from a list of strings

2014-01-10 Thread Casper Færgemand
Have: enum (or is immutable array better?) array = ["derp", "lala"]; Want: mixin("some syntax" ~ array[0]); mixin("some syntax" ~ array[1]); Basically, to specify a number of similar functions based on a list of strings. Why? Pegged's semantic actions allows only calling a function by name, no

Re: inout type constructor applied to this-reference

2014-01-10 Thread Jakob Ovrum
On Friday, 10 January 2014 at 11:03:58 UTC, Matthias Walter wrote: Since the documentation only talks about marking arguments inout, can I nevertheless rely on its behavior? Anyways, I think it is worth to be included in the docs. The implicit this-reference parameter is just that - another

Re: When creating a binding package in the dub repository do you specify the link flags?

2014-01-10 Thread Kelet
On Friday, 10 January 2014 at 18:44:22 UTC, Gary Willoughby wrote: When creating a binding package in the dub repository do you specify the link flags or leave that up to the developer using the library? For example, each package in the dub repository has a package.json which describes exactl

Re: Compile/link Win64

2014-01-10 Thread Nick Sabalausky
On 1/10/2014 3:56 PM, Rainer Schuetze wrote: On 10.01.2014 21:34, Nick Sabalausky wrote: On 1/10/2014 3:26 PM, Nick Sabalausky wrote: On 1/10/2014 3:19 PM, Brad Anderson wrote: I don't have VC2008 so I unfortunately could not test while I was working on the installer/sc.ini update. Rainer s

Re: Compile/link Win64

2014-01-10 Thread Rainer Schuetze
On 10.01.2014 21:34, Nick Sabalausky wrote: On 1/10/2014 3:26 PM, Nick Sabalausky wrote: On 1/10/2014 3:19 PM, Brad Anderson wrote: I don't have VC2008 so I unfortunately could not test while I was working on the installer/sc.ini update. Rainer says 2008 does work though. With modern VC ther

Re: Compile/link Win64

2014-01-10 Thread Brad Anderson
On Friday, 10 January 2014 at 20:26:35 UTC, Nick Sabalausky wrote: On 1/10/2014 3:19 PM, Brad Anderson wrote: I don't have VC2008 so I unfortunately could not test while I was working on the installer/sc.ini update. Rainer says 2008 does work though. With modern VC there is a vcvars32.bat and

Re: Compile/link Win64

2014-01-10 Thread Nick Sabalausky
On 1/10/2014 3:26 PM, Nick Sabalausky wrote: On 1/10/2014 3:19 PM, Brad Anderson wrote: I don't have VC2008 so I unfortunately could not test while I was working on the installer/sc.ini update. Rainer says 2008 does work though. With modern VC there is a vcvars32.bat and vcvars64.bat to choose

Re: Compile/link Win64

2014-01-10 Thread Nick Sabalausky
On 1/10/2014 3:19 PM, Brad Anderson wrote: I don't have VC2008 so I unfortunately could not test while I was working on the installer/sc.ini update. Rainer says 2008 does work though. With modern VC there is a vcvars32.bat and vcvars64.bat to choose whether to use the 32-bit or 64-bit toolchain.

Re: Compile/link Win64

2014-01-10 Thread Brad Anderson
On Friday, 10 January 2014 at 20:02:49 UTC, Nick Sabalausky wrote: I never seem to be able to remember how to get 64-bit going on windows. I've extracted the zip for DMD 2.064.2, I ran the "vcvarsall.bat", but trying to compile this trivial hello world: import std.stdio; void main() {

Re: Compile/link Win64

2014-01-10 Thread Nick Sabalausky
On 1/10/2014 3:06 PM, Vladimir Panteleev wrote: On Friday, 10 January 2014 at 20:02:49 UTC, Nick Sabalausky wrote: LINK : fatal error LNK1104: cannot open file 'shell32.lib' What are your LIB and LIBPATH environment variables set to? >echo %LIB% C:\Program Files (x86)\Microsoft Visual Studio

Re: Compile/link Win64

2014-01-10 Thread Vladimir Panteleev
On Friday, 10 January 2014 at 20:02:49 UTC, Nick Sabalausky wrote: LINK : fatal error LNK1104: cannot open file 'shell32.lib' What are your LIB and LIBPATH environment variables set to?

Compile/link Win64

2014-01-10 Thread Nick Sabalausky
I never seem to be able to remember how to get 64-bit going on windows. I've extracted the zip for DMD 2.064.2, I ran the "vcvarsall.bat", but trying to compile this trivial hello world: import std.stdio; void main() { writeln("Hello"); } > [path_to]dmd.2.064.2\dmd2\windows\bin\dmd -m

When creating a binding package in the dub repository do you specify the link flags?

2014-01-10 Thread Gary Willoughby
When creating a binding package in the dub repository do you specify the link flags or leave that up to the developer using the library? For example, each package in the dub repository has a package.json which describes exactly how the package should build and link, etc. If the package only c

Re: Learning D as main systems programming language

2014-01-10 Thread Dejan Lekic
On Friday, 10 January 2014 at 00:05:35 UTC, Goran Petrevski wrote: You might want to look into XOmB: https://github.com/xomboverlord/xomb Isn't it written in D1? Not sure about that... So what if it is written in D1? :) It should not be a big problem to "port" it to D2. Second interesting pr

Re: std.xml

2014-01-10 Thread Dejan Lekic
On Friday, 10 January 2014 at 00:02:14 UTC, Ola Fosheim Grøstad wrote: The std.xml documentation states "This module is considered out-dated and not up to Phobos' current standards." Does this mean that there is some other module I should use for xml parsing? Maybe one that is not in the stand

Re: deh_beg and deh_end linker error

2014-01-10 Thread Jacob Carlborg
On 2014-01-10 12:21, tivadj wrote: To resolve the problem (unresolved _deh_beg/_deh_end when linking), put the 'main' declaration into the D library. As below void main(string[]) { } You don't need any arguments for the "main" function if you don't need them. It's enough with: void main ()

Re: deh_beg and deh_end linker error

2014-01-10 Thread tivadj
To resolve the problem (unresolved _deh_beg/_deh_end when linking), put the 'main' declaration into the D library. As below void main(string[]) { }

inout type constructor applied to this-reference

2014-01-10 Thread Matthias Walter
Hi, I read about inout functions in the language documentation which allows to use inout in order to set the constness of the return type based on the constness of some argument. What is not mentioned is that this also works for the this-reference by marking the function itself inout: So instead

Re: dub and ddox

2014-01-10 Thread Sönke Ludwig
Am 08.01.2014 16:34, schrieb Kelet: On Wednesday, 8 January 2014 at 09:47:03 UTC, Sönke Ludwig wrote: In that particular case (dub build --build=ddox), you can just have your own versions of the style files in your docs/styles/ folder (copy and modify from ddox/public/styles). That won't work fo

Re: singleton with "momento"

2014-01-10 Thread FreeSlave
On Thursday, 9 January 2014 at 21:51:46 UTC, Frustrated wrote: Lets suppose I have setup some code to use a singleton object. Now lets suppose I want to duplicate that code(say to run multiple times simultaneously). The singleton pattern itself prevents multiple copies. One would need multipl