Re: nested enum

2016-08-24 Thread Daniel Kozak via Digitalmars-d-learn
And if you need more levels: struct MyEnum { static struct AnotherEnum { enum X { Y = 10, Z = 20 } } } void main() { import std.stdio; int y = MyEnum.AnotherEnum.X.Y; writeln(y); } Dne 25.8.2016 v 03:37 Mike Parker via Digitalmars-d-learn napsal(a): On

Re: nested enum

2016-08-24 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 24 August 2016 at 23:04:25 UTC, Illuminati wrote: How can I create nested enum like structures? instead of Enum.X_Y I would like to access like Enum.X.Y Yet I want it to behave exactly as an enum. I just want to not use _ as .'s are better as they express more clearly what I

nested enum

2016-08-24 Thread Illuminati via Digitalmars-d-learn
How can I create nested enum like structures? instead of Enum.X_Y I would like to access like Enum.X.Y Yet I want it to behave exactly as an enum. I just want to not use _ as .'s are better as they express more clearly what I want.

Re: pow exponent type issue

2016-08-24 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 24 August 2016 at 19:41:35 UTC, ag0aep6g wrote: -y1 is -1. But -y2 is uint.max, i.e. a pretty large positive number. The 'u' in "uint" stands for "unsigned". That is, it doesn't know negative numbers. Dont' use uint when you need negative numbers. Ahh, doh.

Re: pow exponent type issue

2016-08-24 Thread ag0aep6g via Digitalmars-d-learn
On Wednesday, 24 August 2016 at 19:16:56 UTC, jmh530 wrote: I'm a little confused on why pow behaves so differently when switching from an int to a uint for the exponent. import std.math : pow; import std.stdio : writeln; void main() { float x = 2; int y1 = 1; uint y2

Re: Hosting a vibe.d website

2016-08-24 Thread Seb via Digitalmars-d-learn
On Wednesday, 24 August 2016 at 19:19:33 UTC, Karabuta wrote: Hello community, I usually host PHP websites for clients using shared hosting services but I'm not familiar with hosting compiled programming language websites. What processes are involved hosting a vibe.d website developed

pow exponent type issue

2016-08-24 Thread jmh530 via Digitalmars-d-learn
I'm a little confused on why pow behaves so differently when switching from an int to a uint for the exponent. import std.math : pow; import std.stdio : writeln; void main() { float x = 2; int y1 = 1; uint y2 = 1; writeln(pow(x, -y1)); //prints 0.5

Hosting a vibe.d website

2016-08-24 Thread Karabuta via Digitalmars-d-learn
Hello community, I usually host PHP websites for clients using shared hosting services but I'm not familiar with hosting compiled programming language websites. What processes are involved hosting a vibe.d website developed locally on a web server (shared hosting plan). And what hosting

Re: How to avoid ctRegex (solved)

2016-08-24 Thread Seb via Digitalmars-d-learn
On Wednesday, 24 August 2016 at 05:29:57 UTC, ag0aep6g wrote: On 08/24/2016 03:07 AM, cy wrote: Then what's ctRegex in there for at all...? Optimization. ctRegex requires that the pattern is available as a compile time constant. It uses that property to "generate optimized native machine

Re: Metaprogramming, generate argument list.

2016-08-24 Thread Jack Applegame via Digitalmars-d-learn
On Tuesday, 23 August 2016 at 21:14:01 UTC, ciechowoj wrote: This is a bit strange, as the local variables aren't known either and they seem to work. I do not want to get the address, rather an alias to `` expression. D doesn't accept aliases to expressions, only symbols and literals. Spec: