Re: isAllocator

2015-12-01 Thread BBaz via Digitalmars-d-learn
On Tuesday, 1 December 2015 at 03:05:34 UTC, Rikki Cattermole wrote: On 01/12/15 3:23 AM, Tofu Ninja wrote: On Monday, 30 November 2015 at 14:21:49 UTC, Tofu Ninja wrote: Is there something like isInputRange for allocators, I tried looking for something but couldn't find anything? If not, why

Re: vibe.d-example illustrating Dynamic Textual Web-Interface

2015-12-01 Thread Sebastiaan Koppe via Digitalmars-d-learn
On Tuesday, 1 December 2015 at 07:04:25 UTC, Sönke Ludwig wrote: Am 30.11.2015 um 11:08 schrieb Nordlöw: Does anybody have a similar vibe.d-project to be inspired from, in this regard? This would be more targeted to the web interface generator (vibe.web.web), which is not affected by the cha

Using enums as function parameters (in a minimized way)

2015-12-01 Thread Ozan via Digitalmars-d-learn
Hi Let's say we have an enum like enum SomethingAboutChristmas { SantaClaus, Angel, Tree } and want to use it in a function like void goingChristmas(SomethingAboutChristmas enumvalue) it works fine like following goingChristmas(SomethingAboutChristmas.Tree) I prefer to use a short

Re: Using enums as function parameters (in a minimized way)

2015-12-01 Thread Rikki Cattermole via Digitalmars-d-learn
On 01/12/15 11:44 PM, Ozan wrote: Hi Let's say we have an enum like enum SomethingAboutChristmas { SantaClaus, Angel, Tree } and want to use it in a function like void goingChristmas(SomethingAboutChristmas enumvalue) it works fine like following goingChristmas(SomethingAbout

Re: Using enums as function parameters (in a minimized way)

2015-12-01 Thread Daniel Kozak via Digitalmars-d-learn
V Tue, 01 Dec 2015 10:44:06 + Ozan via Digitalmars-d-learn napsáno: > Hi > > Let's say we have an enum like > > enum SomethingAboutChristmas { >SantaClaus, >Angel, >Tree > } > > and want to use it in a function like > >void goingChristmas(SomethingAboutChristmas enumvalue)

Re: isAllocator

2015-12-01 Thread Tofu Ninja via Digitalmars-d-learn
On Tuesday, 1 December 2015 at 08:58:56 UTC, BBaz wrote: I think that `is(CAllocatorImpl!Alloc)` should work too then. According to the 'is' version, int is an allocator. No idea why it thinks this works... enum isAllocator(Alloc) = is(CAllocatorImpl!Alloc); static assert(isAllocator!int);

Re: isAllocator

2015-12-01 Thread BBaz via Digitalmars-d-learn
On Tuesday, 1 December 2015 at 12:37:12 UTC, Tofu Ninja wrote: On Tuesday, 1 December 2015 at 08:58:56 UTC, BBaz wrote: I think that `is(CAllocatorImpl!Alloc)` should work too then. According to the 'is' version, int is an allocator. No idea why it thinks this works... Me neither, actually,

Re: Using enums as function parameters (in a minimized way)

2015-12-01 Thread tcak via Digitalmars-d-learn
On Tuesday, 1 December 2015 at 10:50:04 UTC, Rikki Cattermole wrote: On 01/12/15 11:44 PM, Ozan wrote: Hi Let's say we have an enum like enum SomethingAboutChristmas { SantaClaus, Angel, Tree } and want to use it in a function like void goingChristmas(SomethingAboutChristmas enum

Re: Using enums as function parameters (in a minimized way)

2015-12-01 Thread tcak via Digitalmars-d-learn
On Tuesday, 1 December 2015 at 13:03:37 UTC, tcak wrote: On Tuesday, 1 December 2015 at 10:50:04 UTC, Rikki Cattermole wrote: [...] This is like: Q) I want to write an OS. How? A) Write in assembly. What Ozan says is logical. Compiler should assume it in that way normally. I have thorough

Re: need help with Windows CreateNamedPipe Security attributes process with undefined symbols at compile time

2015-12-01 Thread Jonathan Villa via Digitalmars-d-learn
On Tuesday, 1 December 2015 at 05:26:25 UTC, Nicholas Wilson wrote: What is causing this: Is this a compile or a linker error? this is the real output of the error: Building Debug\ASI.exe... OPTLINK (R) for Win32 Release 8.00.17 Copyright (C) Digital Mars 1989-2013 All rights reserved. http:

Re: need help with Windows CreateNamedPipe Security attributes process with undefined symbols at compile time

2015-12-01 Thread Rikki Cattermole via Digitalmars-d-learn
On 02/12/15 3:40 AM, Jonathan Villa wrote: On Tuesday, 1 December 2015 at 05:26:25 UTC, Nicholas Wilson wrote: What is causing this: Is this a compile or a linker error? this is the real output of the error: Building Debug\ASI.exe... OPTLINK (R) for Win32 Release 8.00.17 Copyright (C) Digital

Re: need help with Windows CreateNamedPipe Security attributes process with undefined symbols at compile time

2015-12-01 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 1 December 2015 at 14:40:38 UTC, Jonathan Villa wrote: MAN! what the heck? I changed the build from x86 to x64 and there's no more errors. Even without the new pragma line. Either way I would prefer x64 over x86. 64 bit should work better because then it uses the linker and dll de

DDOC adds emphasis on symbols, so how to use $(LINK a) properly?

2015-12-01 Thread kraybit via Digitalmars-d-learn
Hello! Just trying out the built-in ddoc, and it's great! But is there any way to link to other packages/modules, without adding "_" everywhere? Consider: // mylib/package.d /** * Also see $(LINK mylib.image.pixel.html) */ module mylib; ... This will generate a l

Re: DDOC adds emphasis on symbols, so how to use $(LINK a) properly?

2015-12-01 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 1 December 2015 at 15:15:50 UTC, kraybit wrote: But is there any way to link to other packages/modules, without adding "_" everywhere? Consider: sort of. You could define a custom macro DDOC_PSYMBOL=$0 I think anyway... to make it just emit the original text without the tag.

Re: DDOC adds emphasis on symbols, so how to use $(LINK a) properly?

2015-12-01 Thread anonymous via Digitalmars-d-learn
On 01.12.2015 16:15, kraybit wrote: /** * Also see $(LINK mylib.image.pixel.html) */ module mylib; ... This will generate a link, but the href will be "mylib.image.pixel.html", which won't work in my browser at least (Chromium). This can be fixed with: $(LINK _m

Re: DDOC adds emphasis on symbols, so how to use $(LINK a) properly?

2015-12-01 Thread kraybit via Digitalmars-d-learn
On Tuesday, 1 December 2015 at 15:32:56 UTC, Adam D. Ruppe wrote: On Tuesday, 1 December 2015 at 15:15:50 UTC, kraybit wrote: But is there any way to link to other packages/modules, without adding "_" everywhere? Consider: sort of. You could define a custom macro DDOC_PSYMBOL=$0 I think anyw

Re: DDOC adds emphasis on symbols, so how to use $(LINK a) properly?

2015-12-01 Thread kraybit via Digitalmars-d-learn
On Tuesday, 1 December 2015 at 15:33:59 UTC, anonymous wrote: On 01.12.2015 16:15, kraybit wrote: /** * Also see $(LINK mylib.image.pixel.html) */ module mylib; ... This will generate a link, but the href will be "mylib.image.pixel.html", which won't work in my brows

Re: DDOC adds emphasis on symbols, so how to use $(LINK a) properly?

2015-12-01 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 1 December 2015 at 15:52:04 UTC, kraybit wrote: Hm, I see, so it's contextual? Would 'pixel' then be emphasized if I'm in the documentation of void pixel()? Yes. It underlines whatever the currently documented symbol is. So at the top level, it is the module/package name. On a clas

Re: DDOC adds emphasis on symbols, so how to use $(LINK a) properly?

2015-12-01 Thread anonymous via Digitalmars-d-learn
On 01.12.2015 16:52, kraybit wrote: Hm, I see, so it's contextual? Would 'pixel' then be emphasized if I'm in the documentation of void pixel()? Yes and yes. I just get the feeling I need to think before using LINK. I'd like to not think, too much. It's a clever feature for sure. Maybe too

Re: need help with Windows CreateNamedPipe Security attributes process with undefined symbols at compile time

2015-12-01 Thread Jonathan Villa via Digitalmars-d-learn
On Tuesday, 1 December 2015 at 14:48:37 UTC, Adam D. Ruppe wrote: On Tuesday, 1 December 2015 at 14:40:38 UTC, Jonathan Villa wrote: MAN! what the heck? I changed the build from x86 to x64 and there's no more errors. Even without the new pragma line. Either way I would prefer x64 over x86. 64

Re: Something about Chinese Disorder Code

2015-12-01 Thread Daniel Murphy via Digitalmars-d-learn
On 25/11/2015 2:16 PM, Rikki Cattermole wrote: On 25/11/15 1:47 AM, Meta wrote: I'm pretty sure you can just do: wstring text = "my string"; Or auto text = "my string"w; The second one is correct yes. I'm just assuming that it isn't compiled into the executable. Either is fine. Non-suffi

Re: Can someone check this on win32 ?

2015-12-01 Thread Daniel Murphy via Digitalmars-d-learn
On 21/11/2015 10:46 PM, BBaz wrote: Seems to be fixed: __ import std.math; void main() {real function(real) c = &sin;} __ https://issues.dlang.org/show_bug.cgi?id=4541 At least it works on linux x86_64. It works because of https://github.com/D-Prog

utils.toBulkString is not accesible from utils

2015-12-01 Thread Andre via Digitalmars-d-learn
Hi, for following coding there is an error during compilation: module utils; package string toBulkString(string s) { import std.string: format; return "$%s\r\n%s\r\n".format(s.length, s); } unittest { string actual = "foobar".toBulkString();