Re: dub should be more command-line oriented

2018-01-10 Thread Computermatronic via Digitalmars-d

On Wednesday, 10 January 2018 at 15:07:40 UTC, Luís Marques wrote:
I often feel that dub relies too much on dub.[json|sdl] and too 
little on command-line switches. Here's the latest example:


[...]


You could just make a refactoring configuration and use the 
--config flag to specify it when necessary. (see: 
https://code.dlang.org/package-format?lang=json#configurations)


[Issue 18223] New: std.experimental.allocator uninitializedFillDefault could use memset

2018-01-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18223

  Issue ID: 18223
   Summary: std.experimental.allocator uninitializedFillDefault
could use memset
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: n8sh.second...@hotmail.com

Current function in std.experimental.allocator.package:
```
private T[] uninitializedFillDefault(T)(T[] array) nothrow
{
T t = T.init;
fillWithMemcpy(array, t);
return array;
}
```

When we can statically determine that the representation of T.init consists of
nothing but zeroes we could instead use memset. char and wchar could also be
special-cased.

--


[Issue 18222] New: Illegal instruction for test_cdvecfill_1

2018-01-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18222

  Issue ID: 18222
   Summary: Illegal instruction for test_cdvecfill_1
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: thomas.ma...@gmail.com

I get the following when I run the dmd-testsuite of ldc 1.7.0 on NixOS:

> 790: sh: line 1: 36610 Illegal instruction 
> /build/ldc-1.7.0-src/build/dmd-testsuite/runnable/test_cdvecfill_1 > 
> /build/ldc-1.7.0-src/build/dmd-testsuite/a0519aad7a20f86b87a15113f878a3d1815937849f5527e5ac5dbbdc24e22f05
>  2>&1
790:  ... runnable/test_cdvecfill.d  -O (-mcpu=avx -mcpu=avx2)
-conf=/build/ldc-1.7.0-src/build/bin/ldc2.conf -O 
790: Test failed.  The logged output:
790: /build/ldc-1.7.0-src/build/bin/ldmd2 -conf= -m64 -Irunnable -O 
-od/build/ldc-1.7.0-src/build/dmd-testsuite/runnable
-of/build/ldc-1.7.0-src/build/dmd-testsuite/runnable/test_cdvecfill_0
runnable/test_cdvecfill.d
790: /build/ldc-1.7.0-src/build/dmd-testsuite/runnable/test_cdvecfill_0
790: 
790: /build/ldc-1.7.0-src/build/bin/ldmd2 -conf= -m64 -Irunnable -O -mcpu=avx
-od/build/ldc-1.7.0-src/build/dmd-testsuite/runnable
-of/build/ldc-1.7.0-src/build/dmd-testsuite/runnable/test_cdvecfill_1
runnable/test_cdvecfill.d
790: /build/ldc-1.7.0-src/build/dmd-testsuite/runnable/test_cdvecfill_1
790: 
790: 
790: ==
790: Test failed: expected rc == 0, exited with rc == 132

See https://hydra.nixos.org/build/67414474/nixlog/1 for the full log.
I built this package yesterday on my system without any problems though it only
happens on these hydra builds.
It works on MacOS X.

--


Re: Dll support: testers needed

2018-01-10 Thread Domain via Digitalmars-d
On Wednesday, 10 January 2018 at 13:14:10 UTC, Benjamin Thaut 
wrote:

Am 10.01.2018 um 13:39 schrieb Domain:


Sorry, my mistake. But I cannot use your binary:

D:\>dmd -m64 -shared dll.d -ofdll.dll
Error: unrecognized file extension dll




This works just fine for me. What is the output when you 
execute "dmd --version"?


D:\git\testdll\source>dmd --version
DMD64 D Compiler v2.078.0

Copyright (C) 1999-2018 by The D Language Foundation, All Rights 
Reserved written by Walter Bright


Re: Dll support: testers needed

2018-01-10 Thread Domain via Digitalmars-d
On Wednesday, 10 January 2018 at 13:14:10 UTC, Benjamin Thaut 
wrote:

Am 10.01.2018 um 13:39 schrieb Domain:


Sorry, my mistake. But I cannot use your binary:

D:\>dmd -m64 -shared dll.d -ofdll.dll
Error: unrecognized file extension dll




This works just fine for me. What is the output when you 
execute "dmd --version"?


I restart my computer, and it can produce dll now. But when I 
compile exe:

dmd -m64 -useshared app.d -ofapp.exe

app.obj : error LNK2019: 无法解析的外部符号 
_D3std12experimental6logger4core17stdThreadLocalLogFNdNfZCQCeQCdQBsQBo6Logger,该符号在函数 _D3std12experimental6logger4core__T18defaultLogFunctionVEQCdQCcQBrQBn8LogLeveli64Z__TQByVii9VAyaa5_6170702e64VQra8_6170702e6d61696eVQBna15_766f6964206170702e6d61696e2829VQCza3_617070TQDmZQFwFNfLQDxZv 中被引用
app.obj : error LNK2019: 无法解析的外部符号 
_D6object__T8__equalsTxaTxaZQqFNaNbNiNfAxaQdZb,该符号在函数 
_D3std5array__T8AppenderTAyaZQo4Data11__xopEqualsFKxSQBzQBy__TQBvTQBpZQCdQBqKxQBaZb 中被引用
app.obj : error LNK2019: 无法解析的外部符号 
_D3std12experimental6logger4core14globalLogLevelFNdNiNfZEQCdQCcQBrQBn8LogLevel,该符号在函数 _D3std12experimental6logger4core6Logger__T15memLogFunctionsVEQChQCgQBvQBr8LogLeveli64Z__T7logImplVii9VAyaa5_6170702e64VQra8_6170702e6d61696eVQBna15_766f6964206170702e6d61696e2829VQCza3_617070TQDmZQEdMFNfLQDyZv 中被引用
app.obj : error LNK2019: 无法解析的外部符号 
_D3std11concurrency7thisTidFNdNfZSQBgQBf3Tid,该符号在函数 
_D3std12experimental6logger4core6Logger__T15memLogFunctionsVEQChQCgQBvQBr8LogLeveli64Z__T7logImplVii9VAyaa5_6170702e64VQra8_6170702e6d61696eVQBna15_766f6964206170702e6d61696e2829VQCza3_617070TQDmZQEdMFNfLQDyZv 中被引用
app.obj : error LNK2019: 无法解析的外部符号 
_D3std8datetime8timezone9LocalTime6opCallFNaNbNeZyCQBxQBwQBqQBk,该符号在函 数 _D3std12experimental6logger4core6Logger__T15memLogFunctionsVEQChQCgQBvQBr8LogLeveli64Z__T7logImplVii9VAyaa5_6170702e64VQra8_6170702e6d61696eVQBna15_766f6964206170702e6d61696e2829VQCza3_617070TQDmZQEdMFNfLQDyZv 中被引用
app.obj : error LNK2019: 无法解析的外部符号 
_D3std12experimental6logger4core8MsgRange6__ctorMFNcNfCQCbQCaQBpQBl6LoggerZSQCwQCvQCkQCgQCe,该符号在函数 _D3std12experimental6logger4core6Logger__T15memLogFunctionsVEQChQCgQBvQBr8LogLeveli64Z__T7logImplVii9VAyaa5_6170702e64VQra8_6170702e6d61696eVQBna15_766f6964206170702e6d61696e2829VQCza3_617070TQDmZQEdMFNfLQDyZv 中被引用
app.obj : error LNK2019: 无法解析的外部符号 
_D3std8datetime7systime7SysTime6__ctorMFNaNbNcNflyCQBxQBw8timezone8TimeZoneZSQCxQCwQCqQCl,该符号在函数 _D3std8datetime7systime5Clock__T8currTimeVE4core4time9ClockTypei0ZQBiFNfyCQCuQCt8timezone8TimeZoneZSQDuQDtQDn7SysTime 中被引用
app.obj : error LNK2019: 无法解析的外部符号 
_D3std8datetime7systime17FILETIMEToStdTimeFNfMxPS4core3sys7windows7winbase8FILETIMEZl,该符号在函数 _D3std8datetime7systime5Clock__T11currStdTimeVE4core4time9ClockTypei0ZQBmFNdNeZl 中被引用
app.obj : error LNK2019: 无法解析的外部符号 
_D3std12experimental6logger4core8MsgRange3putMFNfwZv,该符号在函数 
_D3std5range10primitives__T5doPutTSQBh12experimental6logger4core8MsgRangeTaZQBxFNfKQBxKaZv 中被引用
app.obj : error LNK2001: 无法解析的外部符号 
_D3std8datetime7systime7SysTime6toHashMxFNaNbNiNfZm
app.obj : error LNK2001: 无法解析的外部符号 
_D3std8datetime7systime7SysTime8opEqualsMxFNaNbNfKxSQByQBxQBrQBmZb
app.obj : error LNK2001: 无法解析的外部符号 
_D3std8datetime7systime7SysTime8__xopCmpFKxSQBqQBpQBjQBeKxQpZi
app.obj : error LNK2001: 无法解析的外部符号 
_D3std8datetime7systime7SysTime8toStringMxFNbNfZAya

app.exe : fatal error LNK1120: 13 个无法解析的外部命令
Error: linker exited with status 1120


Sources:

///app.d:

import std.experimental.logger;
import core.sys.windows.windows;
import core.runtime;
extern(C) alias void function() startFn;
void main()
{
info("Loading dll1.dll");
auto handle1 = cast(HMODULE)Runtime.loadLibrary("dll1.dll");
auto fp1 = GetProcAddress(handle1, "start");
(cast(startFn)fp1)();

info("Loading dll2.dll");
auto handle2 = cast(HMODULE)Runtime.loadLibrary("dll2.dll");
auto fp2 = GetProcAddress(handle2, "start");
(cast(startFn)fp2)();
}

///dll1.d

import std.stdio;
import std.experimental.logger;
import core.sys.windows.dll;
mixin SimpleDllMain!(DllIsUsedFromC.no);
class MyLogger : Logger
{
this(LogLevel lv) @safe
{
super(lv);
}
override protected void writeLogMsg(ref LogEntry entry) 
@trusted

{
writefln("MyLogger: %s", entry.msg);
}
}
export extern(C) void start()
{
info("dll1 starting");
sharedLog = new MyLogger(LogLevel.info);
info("dll1 started");
}

///dll2.d

import std.stdio;
import std.experimental.logger;
import core.sys.windows.dll;
mixin SimpleDllMain!(DllIsUsedFromC.no);
export extern(C) void start()
{
info("dll2 started");
}

dmd -m64 app.d -ofapp.exe
dmd -m64 -shared dll1.d -ofdll1.dll
dmd -m64 -shared dll2.d -ofdll2.dll

output:

2018-01-11T12:04:51.635:app.d:main:9 Loading dll1.dll
2018-01-11T12:04:51.894:dll1.d:start:22 dll1 starting
MyLogger: dll1 started
2018-01-11T12:04:51.897:app.d:main:14 Loading dll2.dll
2018-01-11T12:04:52.164:dll2.d:start:9 dll2 started

I expected:
2018-01-11T12:04:51.635:app.d:main:9 Loading dll1.dll

[Issue 18188] rdmd ignores dependency in 'static this()'

2018-01-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18188

Seb  changed:

   What|Removed |Added

 CC||greensunn...@gmail.com

--- Comment #2 from Seb  ---
BTW are you aware of https://github.com/dlang/dmd/pull/7099 and
https://github.com/dlang/tools/pull/271 ?
It could as a side-effect fix your bug.

--


Re: !Alert! code.dlang.org down

2018-01-10 Thread Guillaume Piolat via Digitalmars-d
On Wednesday, 10 January 2018 at 10:10:22 UTC, Martin 
Tschierschke wrote:
In the moment I don't have access, hopefully this is only 
temporal problem and the rescue team for fixing is already on 
the way...


Tips from the folks on Discord, for DUB outages:

1. If you have all required dependencies in your cache, and just 
want to avoid the network:


dub --skip-registry=all

Very useful on slow networks. However this won't help if you 
don't have the libraries in your cache.



2. If you wish to use a mirror

dub --skip-registry=standard -v 
--registry=http://code-mirror.dlang.io



3. If you need to fetch packages and mirror are down too

- git clone every repositery you need from GitHub
- $ dub add-local in every of these repositery
You might want to checkout older tags if you are not using 
the latest version of these repositeries.





Re: new int[]

2018-01-10 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, January 10, 2018 22:50:22 Nathan S. via Digitalmars-d-learn 
wrote:
> On Wednesday, 10 January 2018 at 22:46:30 UTC, ag0aep6g wrote:
> > If I understand correctly, the goal is to have the `int[]`
> > itself on the GC heap.
>
> The code
> 
> void main(string[] args) @nogc
> {
>  int[] x = [1, 2, 3];
> }
> 
>
> won't compile, because "array literal in @nogc function 'D main'
> may cause GC allocation". But "may" isn't the same as "will".
> What determines it? That's a kind of goofy error message now that
> I think about it.

If there are cases where it doesn't allocate, it probably depends on
compiler optimizations. If it's able to determine that x doesn't escape the
function, it might allocate it on the stack. I don't know. But @nogc is
about guaranteeing that it _won't_ allocate using the GC, so "may" is enough
to make it illegal for @nogc. It's also possible that this particular case
will always allocate, but the error message is also used in other code where
it's not guaranteed to allocate. Recently, in a discussion on improving
error messages Walter did mention that there are cases in the compiler where
the same piece of code generates errors for a variety of cases and that it
would probably be better to make some of those less generic so that the
error messages can be more specific.

- Jonathan M Davis



Re: new int[]

2018-01-10 Thread Luís Marques via Digitalmars-d-learn

On Wednesday, 10 January 2018 at 22:46:30 UTC, ag0aep6g wrote:
If I understand correctly, the goal is to have the `int[]` 
itself on the GC heap.


That's correct.

You can make an `int[][]` with one element, and then take the 
address of that element:


void main()
{
int[]* x = &[[1, 2, 3]][0];
int[]* x2 = [[1, 2, 3]].ptr; /* same */
}


That's an interesting solution. I'm not sure which one I prefer, 
the wrapper or this one. Still... I feel like the language should 
just allow allocating an array itself on the GC heap :(


Re: new int[]

2018-01-10 Thread Luís Marques via Digitalmars-d-learn
On Wednesday, 10 January 2018 at 22:48:48 UTC, Adam D. Ruppe 
wrote:
General word of warning: if you pass it to C and the C function 
holds on to that pointer for any reason beyond its immediate 
execution, you could be looking at a problem because the D GC 
can't see C function memory and may free it after the function 
returns.


Thanks! I don't think it applies to me, because the void* pointer 
is reachable from a root pointer on the D side.


[Issue 18188] rdmd ignores dependency in 'static this()'

2018-01-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18188

--- Comment #1 from Dragos Carp  ---
The problem is caused by `dmd -v` output, that is parsed and used by rdmd.

$ dmd -v -o- foo.d
predefs   DigitalMars Posix linux ELFv1 LittleEndian D_Version2 all D_SIMD
D_InlineAsm_X86_64 X86_64 CRuntime_Glibc D_LP64 D_PIC assert D_HardFloat
binarydmd
version   v2.078.0
config/etc/dmd.conf
parse foo
importall foo
importobject(/usr/include/dmd/druntime/import/object.d)
semantic  foo
entry main  foo.d
semantic2 foo
semantic3 foo
importbar   (bar.d)

Calling dmd with -deps option fixes the problem:

$ dmd -v -o- foo.d -deps=/dev/null
predefs   DigitalMars Posix linux ELFv1 LittleEndian D_Version2 all D_SIMD
D_InlineAsm_X86_64 X86_64 CRuntime_Glibc D_LP64 D_PIC assert D_HardFloat
binarydmd
version   v2.078.0
config/etc/dmd.conf
parse foo
importall foo
importobject(/usr/include/dmd/druntime/import/object.d)
semantic  foo
entry main  foo.d
semantic2 foo
semantic3 foo
importbar   (bar.d)
importbaz   (baz.d)

Consequently rdmd command also functions when -deps option is added:

$ rdmd --build-only --chatty -deps=/dev/null foo.d
mkdirRecurse /tmp/.rdmd-500
mkdirRecurse /tmp/.rdmd-500/rdmd-foo.d-2D7BE73D8EB3145BDB8A563EF51C3756
lock /tmp/.rdmd-500/rdmd-foo.d-2D7BE73D8EB3145BDB8A563EF51C3756/rdmd.lock
mkdirRecurse /tmp/.rdmd-500/rdmd-foo.d-2D7BE73D8EB3145BDB8A563EF51C3756/objs
stat /tmp/.rdmd-500/rdmd-foo.d-2D7BE73D8EB3145BDB8A563EF51C3756/rdmd.deps
spawn ["/usr/bin/dmd", "-deps=/dev/null", "-v", "-o-", "foo.d", "-I."]
read /tmp/.rdmd-500/rdmd-foo.d-2D7BE73D8EB3145BDB8A563EF51C3756/rdmd.deps
which /usr/bin/dmd
stat /etc/dmd.conf
stat /tmp/.rdmd-500/rdmd-foo.d-2D7BE73D8EB3145BDB8A563EF51C3756/.built
stat ./foo
stat foo.d
stat foo.d
stat /etc/dmd.conf
stat baz.d
stat bar.d
stat /usr/bin/dmd
stat ./foo
spawn ["/usr/bin/dmd", "-deps=/dev/null", "-of./foo.tmp",
"-od/tmp/.rdmd-500/rdmd-foo.d-2D7BE73D8EB3145BDB8A563EF51C3756/objs", "-I.",
"foo.d", "baz.d", "bar.d"]
stat /tmp/.rdmd-500/rdmd-foo.d-2D7BE73D8EB3145BDB8A563EF51C3756/objs
rmdirRecurse /tmp/.rdmd-500/rdmd-foo.d-2D7BE73D8EB3145BDB8A563EF51C3756/objs
mv ./foo.tmp ./foo
touch /tmp/.rdmd-500/rdmd-foo.d-2D7BE73D8EB3145BDB8A563EF51C3756/.built

--


Re: new int[]

2018-01-10 Thread Ali Çehreli via Digitalmars-d-learn

On 01/10/2018 02:46 PM, ag0aep6g wrote:

On 01/10/2018 11:35 PM, Luís Marques wrote:

Due to compatibility with some C code, I basically need to do this:

 struct Wrapper
 {
 int[] x;
 }

 void main()
 {
 void* ctxptr = new Wrapper([1, 2, 3]);
 auto context = cast(Wrapper*) ctxptr;
 writeln(context.x);
 }

How can I do that without the wrapper? `new int[]` isn't supported, 
even though that's exactly what I want.


If I understand correctly, the goal is to have the `int[]` itself on the 
GC heap. You can make an `int[][]` with one element, and then take the 
address of that element:



void main()
{
     int[]* x = &[[1, 2, 3]][0];
     int[]* x2 = [[1, 2, 3]].ptr; /* same */
}



I was writing the same for a no-initial-value version:

void main() {
void *v = cast(void*)((new int[][](1)).ptr);
*(cast(int[]*)v) ~= 42;
}

I hope it's correct. :o)

Ali


Re: new int[]

2018-01-10 Thread Nathan S. via Digitalmars-d-learn

On Wednesday, 10 January 2018 at 22:46:30 UTC, ag0aep6g wrote:
If I understand correctly, the goal is to have the `int[]` 
itself on the GC heap.


The code

void main(string[] args) @nogc
{
int[] x = [1, 2, 3];
}


won't compile, because "array literal in @nogc function 'D main' 
may cause GC allocation". But "may" isn't the same as "will". 
What determines it? That's a kind of goofy error message now that 
I think about it.




Re: new int[]

2018-01-10 Thread Adam D. Ruppe via Digitalmars-d-learn

On Wednesday, 10 January 2018 at 22:46:30 UTC, ag0aep6g wrote:
If I understand correctly, the goal is to have the `int[]` 
itself on the GC heap.


General word of warning: if you pass it to C and the C function 
holds on to that pointer for any reason beyond its immediate 
execution, you could be looking at a problem because the D GC 
can't see C function memory and may free it after the function 
returns.


Re: new int[]

2018-01-10 Thread ag0aep6g via Digitalmars-d-learn

On 01/10/2018 11:35 PM, Luís Marques wrote:

Due to compatibility with some C code, I basically need to do this:

     struct Wrapper
     {
     int[] x;
     }

     void main()
     {
     void* ctxptr = new Wrapper([1, 2, 3]);
     auto context = cast(Wrapper*) ctxptr;
     writeln(context.x);
     }

How can I do that without the wrapper? `new int[]` isn't supported, even 
though that's exactly what I want.


If I understand correctly, the goal is to have the `int[]` itself on the 
GC heap. You can make an `int[][]` with one element, and then take the 
address of that element:



void main()
{
int[]* x = &[[1, 2, 3]][0];
int[]* x2 = [[1, 2, 3]].ptr; /* same */
}



Re: new int[]

2018-01-10 Thread Nathan S. via Digitalmars-d-learn

Is there any problem with:


import std.stdio;

void main(string[] args)
{
int[] x = [1, 2, 3];
writeln(x);
}

https://run.dlang.io/is/CliWcz


Re: new int[]

2018-01-10 Thread Luís Marques via Digitalmars-d-learn

On Wednesday, 10 January 2018 at 22:35:01 UTC, Luís Marques wrote:
How can I do that without the wrapper? `new int[]` isn't 
supported, even though that's exactly what I want.


Just to be extra clear: I really do want a normal D slice, it 
can't be a fixed-length array.


new int[]

2018-01-10 Thread Luís Marques via Digitalmars-d-learn
Due to compatibility with some C code, I basically need to do 
this:


struct Wrapper
{
int[] x;
}

void main()
{
void* ctxptr = new Wrapper([1, 2, 3]);
auto context = cast(Wrapper*) ctxptr;
writeln(context.x);
}

How can I do that without the wrapper? `new int[]` isn't 
supported, even though that's exactly what I want.


Re: Release D 2.078.0

2018-01-10 Thread timotheecour via Digitalmars-d-announce

On Wednesday, 10 January 2018 at 21:42:38 UTC, Nathan S. wrote:
When I remove the "inline" option the build + test time becomes 
<10 seconds. So the weirdly slow part is related to inlining.


filed so we don't forget: 
https://issues.dlang.org/show_bug.cgi?id=18221


[Issue 18221] New: DMD64 2.078.0 compile time explodes with -inline for mir-algorithm

2018-01-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18221

  Issue ID: 18221
   Summary: DMD64 2.078.0 compile time explodes with -inline for
mir-algorithm
   Product: D
   Version: D2
  Hardware: x86
OS: All
Status: NEW
  Severity: regression
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: timothee.co...@gmail.com

details: http://forum.dlang.org/post/gevcbtueeiscqipqm...@forum.dlang.org
as reported by Nathan S.

--


Re: Unable to run D program on mac system when using dependency.

2018-01-10 Thread Simen Kjærås via Digitalmars-d
On Wednesday, 10 January 2018 at 12:44:01 UTC, Harbeer Kadian 
wrote:
I am pretty new to D language. I am working on existing code 
developed by others. Previous developers were using linux 
environment to build and run the D Application.

I am trying to do the same in MAC as it is my local environment.

Here is how my jub.json file looks like
{
"name" : "dsmasher",
"description" : "Hello World - A minimal DUB bundle.",
"dependencies" : {
"d2sqlite3": "~>0.9.7",
"botan": "~>1.12.9"
}
}


This seems to be a bug in Botan - the GitHub page lists the build 
as failing, and a look[1] at the build shows the exact same error 
messages.


--
  Simen

[0]: https://github.com/etcimon/botan
[1]: https://travis-ci.org/etcimon/botan/jobs/308953168


[Issue 17819] static foreach segfaults on __traits(allMembers)

2018-01-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17819

Jean-Louis Leroy  changed:

   What|Removed |Added

 CC||j...@leroy.nyc

--


Re: Release D 2.078.0

2018-01-10 Thread Nathan S. via Digitalmars-d-announce

On Wednesday, 10 January 2018 at 21:32:55 UTC, Nathan S. wrote:
On my mac laptop running DMD 2.078.0, building and running the 
mir-algorithm unittests takes 8 seconds normally but takes ~3 
minutes 49 seconds with dub options "releaseMode", "optimize", 
"inline", "noBoundsCheck".


When I remove the "inline" option the build + test time becomes 
<10 seconds. So the weirdly slow part is related to inlining.


Re: Release D 2.078.0

2018-01-10 Thread Nathan S. via Digitalmars-d-announce
DMD64 2.078.0 on Linux and macOS is taking wildly longer to build 
and run unittests for mir-algorithm. The extra time appears to be 
related to release mode optimizations.


Build logs:
https://travis-ci.org/libmir/mir-algorithm/builds/324052159

DMD 2.077.1 for linux32: 3 min 20 sec
DMD 2.077.1 for linux64: 3 min 16 sec
DMD 2.077.1 for mac64: 5 min 4 sec

DMD 2.078.0-rc.1 for linux32: 13 min 30 sec
DMD 2.078.0-rc.1 for linux64: 9 min 39 sec
DMD 2.078.0-rc.1 for mac64: 10 min 56 sec, then the job was 
aborted


The above tests all include a non-release build and a release 
build. On my mac laptop running DMD 2.078.0, building and running 
the mir-algorithm unittests takes 8 seconds normally but takes ~3 
minutes 49 seconds with dub options "releaseMode", "optimize", 
"inline", "noBoundsCheck".


I don't see any new compiler optimizations in the changelog. Any 
idea of what could be causing this?


Re: invalid or corrupt file: duplicate COMDAT / Previous Definition Different

2018-01-10 Thread Anonymouse via Digitalmars-d-learn
On Wednesday, 10 January 2018 at 20:19:50 UTC, Benjamin Thaut 
wrote:

Am 10.01.2018 um 20:32 schrieb Anonymouse:


I don't have a reduced testcase yet. I figured I'd ask if it's 
something known before making the effort.


Are you by any chance mixing debug and release builds? Or are 
the -version specifiers different when compiling the various 
parts of your program? Check your compiler flags and ansure 
that they are the same over your entire build process. 
Especiall -debug -relase -inline -O -version


Admittedly I am alternating between building debug and unittest 
builds, but I'm only using dub, no separate compilation. I have 
limited control of the version specifiers other than through the 
build configurations, so there's not a whole lot to mix.


$ dub clean
Cleaning package at C:\cygwin\home\zorael\src\kameloso...

$ dub build -c cygwin -a x86_64
Performing "debug" build using dmd for x86_64.
kameloso 1.0.0-beta.2+commit.57.g90fdd1d: building 
configuration "cygwin"...

Linking...
kameloso.obj : fatal error LNK1179: invalid or corrupt file: 
duplicate COMDAT 
'_D8kameloso7plugins6common8BotRegex6__ctorMFNcxEQBuQBoQBj10NickPolicyS3std5regex8internal2ir__T5RegexTaZQjZSQEcQDwQDrQDn'

Error: linker exited with status 1179
dmd failed with exit code 1179.

None of the (version specifiers in the) build configurations I 
have touch upon the part of the fairly innocent code mentioned in 
the error message, if I'm reading it right. 
(https://github.com/zorael/kameloso/blob/c00ca4489e39348bd4b1678c95c1b12636df307c/source/kameloso/plugins/common.d#L424)


[Issue 17819] static foreach segfaults on __traits(allMembers)

2018-01-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17819

--- Comment #1 from Jean-Louis Leroy  ---
The bug is still present in 2.078.

--


Re: invalid or corrupt file: duplicate COMDAT / Previous Definition Different

2018-01-10 Thread Jesse Phillips via Digitalmars-d-learn

On Wednesday, 10 January 2018 at 19:32:28 UTC, Anonymouse wrote:

/usr/bin/ld: Warning: size of symbol


I think your case is this bug:
https://issues.dlang.org/show_bug.cgi?id=15324

Another COMDAT error is: 
https://issues.dlang.org/show_bug.cgi?id=16687


Re: TransitiveBaseTypeTuple doesn't seemed to print the symbols as well.

2018-01-10 Thread Adam D. Ruppe via Digitalmars-d-learn

On Wednesday, 10 January 2018 at 20:38:20 UTC, 12345swordy wrote:

You know a equivalent template that does that?


No, though you could just AliasSeq!(D, TransitiveBaseTypeTuple!D) 
and make it yourself.


Though note that __traits(allMembers, D) already includes all 
members, including those from base classes too, so you might just 
want to use that.


Re: TransitiveBaseTypeTuple doesn't seemed to print the symbols as well.

2018-01-10 Thread 12345swordy via Digitalmars-d-learn
On Wednesday, 10 January 2018 at 19:26:58 UTC, Adam D. Ruppe 
wrote:
On Wednesday, 10 January 2018 at 19:07:46 UTC, 12345swordy 
wrote:

I noticed, can't fix it cause it won't let me edit it.


OK, I'd just use foreach there anyway tho (then it actually 
builds!).


But, hopefully once you get it running, you'll see that the 
base type tuple just gives the bases: it will print two lines, 
one for the base class Object and one for your interface A. 
Neither of them have constructors!


It won't print the class D itself


You know a equivalent template that does that?


Re: invalid or corrupt file: duplicate COMDAT / Previous Definition Different

2018-01-10 Thread Benjamin Thaut via Digitalmars-d-learn

Am 10.01.2018 um 20:32 schrieb Anonymouse:


I don't have a reduced testcase yet. I figured I'd ask if it's something 
known before making the effort.


Are you by any chance mixing debug and release builds? Or are the 
-version specifiers different when compiling the various parts of your 
program? Check your compiler flags and ansure that they are the same 
over your entire build process. Especiall -debug -relase -inline -O -version


--
Kind Regards
Benjamin Thaut


Re: Error: out of memory

2018-01-10 Thread Paolo Invernizzi via Digitalmars-d-learn
On Wednesday, 10 January 2018 at 19:21:21 UTC, Adam D. Ruppe 
wrote:

On Wednesday, 10 January 2018 at 19:15:00 UTC, Anonymouse wrote:

I don't see a 64 bit release though... might have to try to 
build it yourself from source using visual studio.


It's a long time I don't understand why there's not a 64bit 
distribution...

(along with a debug build of rt/phobos, btw)

/Paolo


Re: Error: out of memory

2018-01-10 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Jan 10, 2018 at 07:21:21PM +, Adam D. Ruppe via Digitalmars-d-learn 
wrote:
[...]
> (and ugh dmd REALLY needs to get its memory consumption under control!
> maybe just enabling the GC would help sometimes.)

Yeah, no kidding!  Recently I also ran into trouble with dmd's memory
consumption competing with Firefox, another big, fat memory hog.  I had
to kill the Firefox process just so I have enough free RAM for dmd not
to bail out in the middle of compilation.

While the latest D motto seems to be fast, fast, and faster, fast does
you no good if you can't even finish compilation in the first place.  We
need to have an option to turn on the GC and/or otherwise push dmd
toward the memory end of the speed/memory tradeoff, instead of being
stuck up fast creek without a memory paddle.


T

-- 
Tell me and I forget. Teach me and I remember. Involve me and I understand. -- 
Benjamin Franklin


Re: Submit D Machine Learning libraries

2018-01-10 Thread aberba via Digitalmars-d

On Wednesday, 10 January 2018 at 12:41:09 UTC, angel wrote:

It is funny, there is 'DLib' under C++.

On Tuesday, 9 January 2018 at 20:39:25 UTC, aberba wrote:

On Tuesday, 9 January 2018 at 19:46:00 UTC, aberba wrote:

[...]


Also http://code.dlang.org/packages/dopt (A numerical 
optimisation and deep learning framework)


Yeah. I noticed.


Re: Error: out of memory

2018-01-10 Thread Anonymouse via Digitalmars-d-learn
On Wednesday, 10 January 2018 at 19:21:21 UTC, Adam D. Ruppe 
wrote:

On Wednesday, 10 January 2018 at 19:15:00 UTC, Anonymouse wrote:
I want to test it on a Windows 10 PC now but compilation with 
dmd (2.078.1) fails, both with --arch x86 and x86_64. LDC 
works, but it easily takes twice the time to build.


In both cases, it is running a 32 bit dmd, just generating 64 
bit code.


I don't see a 64 bit release though... might have to try to 
build it yourself from source using visual studio.


(and ugh dmd REALLY needs to get its memory consumption under 
control! maybe just enabling the GC would help sometimes.)


Ugh, okay. Thanks, I'll try that.


invalid or corrupt file: duplicate COMDAT / Previous Definition Different

2018-01-10 Thread Anonymouse via Digitalmars-d-learn
I haven't been testing my project on Windows for a while, and on 
top of having issues with out of memory errors when unittesting I 
see I can't build it normally either. dmd is 2.078.0.


$ dub build -c cygwin -a x86_64
Performing "debug" build using dmd for x86_64.
kameloso 1.0.0-beta.2+commit.57.g90fdd1d: building configuration 
"cygwin"...

Linking...
kameloso.obj : fatal error LNK1179: invalid or corrupt file: 
duplicate COMDAT 
'_D8kameloso7plugins6common8BotRegex6__ctorMFNcxEQBuQBoQBj10NickPolicyS3std5regex8internal2ir__T5RegexTaZQjZSQEcQDwQDrQDn'

Error: linker exited with status 1179
dmd failed with exit code 1179.

$ dub build -c cygwin
Performing "debug" build using dmd for x86.
kameloso 1.0.0-beta.2+commit.57.g90fdd1d: building configuration 
"cygwin"...

Linking...
OPTLINK (R) for Win32  Release 8.00.17
Copyright (C) Digital Mars 1989-2013  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
.dub\build\cygwin-debug-windows-x86-dmd_2078-270D5D6B34387418CFDA6A068E7A60D9\kameloso.obj(kameloso)
  Offset 7A92EH Record Type 00C3
 Error 1: Previous Definition Different : 
_D8kameloso7plugins6common8BotRegex6__ctorMFNcxEQBuQBoQBj10NickPolicyS3std5regex8internal2ir__T5RegexTaZQjZSQEcQDwQDrQDn

.dub\build\cygwin-debug-windows-x86-dmd_2078-270D5D6B34387418CFDA6A068E7A60D9\kameloso.obj(kameloso)
  Offset 7AE18H Record Type 00C3
 Error 1: Previous Definition Different : 
_D8kameloso7plugins6common8BotRegex6__ctorMFNcS3std5regex8internal2ir__T5RegexTaZQjZSQDfQCzQCuQCq

Error: linker exited with status 2
dmd failed with exit code 2.

LDC 1.7.0 builds just fine.

There are similar error messages when compiling on linux, but 
they don't error out (linking succeeds despite them).


/usr/bin/ld: Warning: size of symbol 
`_D8kameloso7plugins6common8BotRegex6__ctorMFNcxEQBuQBoQBj10NickPolicyS3std5regex8internal2ir__T5RegexTaZQjZSQEcQDwQDrQDn' changed from 46 in .dub/build/posix-debug-linux.posix-x86_64-dmd_2078-8E23DC2771FEB27EF0FE1CC8F3984CAA/kameloso.o to 49 in .dub/build/posix-debug-linux.posix-x86_64-dmd_2078-8E23DC2771FEB27EF0FE1CC8F3984CAA/kameloso.o
/usr/bin/ld: Warning: size of symbol 
`_D8kameloso7plugins6common8BotRegex6__ctorMFNcS3std5regex8internal2ir__T5RegexTaZQjZSQDfQCzQCuQCq' changed from 40 in .dub/build/posix-debug-linux.posix-x86_64-dmd_2078-8E23DC2771FEB27EF0FE1CC8F3984CAA/kameloso.o to 43 in .dub/build/posix-debug-linux.posix-x86_64-dmd_2078-8E23DC2771FEB27EF0FE1CC8F3984CAA/kameloso.o


I don't have a reduced testcase yet. I figured I'd ask if it's 
something known before making the effort.


Re: TransitiveBaseTypeTuple doesn't seemed to print the symbols as well.

2018-01-10 Thread Adam D. Ruppe via Digitalmars-d-learn

On Wednesday, 10 January 2018 at 19:07:46 UTC, 12345swordy wrote:

I noticed, can't fix it cause it won't let me edit it.


OK, I'd just use foreach there anyway tho (then it actually 
builds!).


But, hopefully once you get it running, you'll see that the base 
type tuple just gives the bases: it will print two lines, one for 
the base class Object and one for your interface A. Neither of 
them have constructors!


It won't print the class D itself


Re: Error: out of memory

2018-01-10 Thread Anonymouse via Digitalmars-d-learn

On Wednesday, 10 January 2018 at 19:15:00 UTC, Anonymouse wrote:
I've been building and testing my project on linux, juggling 
the ~5GB+ RAM needed to actually compile, but it's been working.


I want to test it on a Windows 10 PC now but compilation with 
dmd (2.078.1)


That's naturally supposed to be 2.078.0.


Re: Error: out of memory

2018-01-10 Thread Adam D. Ruppe via Digitalmars-d-learn

On Wednesday, 10 January 2018 at 19:15:00 UTC, Anonymouse wrote:
I want to test it on a Windows 10 PC now but compilation with 
dmd (2.078.1) fails, both with --arch x86 and x86_64. LDC 
works, but it easily takes twice the time to build.


In both cases, it is running a 32 bit dmd, just generating 64 bit 
code.


I don't see a 64 bit release though... might have to try to build 
it yourself from source using visual studio.


(and ugh dmd REALLY needs to get its memory consumption under 
control! maybe just enabling the GC would help sometimes.)


Error: out of memory

2018-01-10 Thread Anonymouse via Digitalmars-d-learn
I've been building and testing my project on linux, juggling the 
~5GB+ RAM needed to actually compile, but it's been working.


I want to test it on a Windows 10 PC now but compilation with dmd 
(2.078.1) fails, both with --arch x86 and x86_64. LDC works, but 
it easily takes twice the time to build.


$ dub test
Running custom 'unittest' configuration.
Performing "unittest" build using dmd for x86.
requests 0.6.0: target for configuration "std" is up to date.
kameloso 1.0.0-beta.2+commit.56.g8ecd737: building 
configuration "unittest"...

[... deprecation spam ...]
Error: out of memory
dmd failed with exit code 1.

The machine has 32 gigabytes of memory[1], so I don't believe 
that for a second.


Any ideas?


[1]: https://i.imgur.com/l5L6BIF.png


Re: TransitiveBaseTypeTuple doesn't seemed to print the symbols as well.

2018-01-10 Thread 12345swordy via Digitalmars-d-learn
On Wednesday, 10 January 2018 at 18:45:17 UTC, Adam D. Ruppe 
wrote:
On Wednesday, 10 January 2018 at 18:31:17 UTC, 12345swordy 
wrote:

for(int x = 0; x < TL.length; x++)
{
  auto b = [__traits(allMembers, TL[0])];



Simple mistake there...


I noticed, can't fix it cause it won't let me edit it.

This auto b = [__traits(allMembers, TL[0])];
is meant to be auto b = [__traits(allMembers, TL[x])];


Re: Rvalue references

2018-01-10 Thread Steven Schveighoffer via Digitalmars-d-learn

On 1/10/18 12:59 PM, Dgame wrote:

On Wednesday, 10 January 2018 at 14:41:21 UTC, Steven Schveighoffer wrote:

On 1/10/18 3:08 AM, Dgame wrote:
On Wednesday, 10 January 2018 at 01:56:02 UTC, Steven Schveighoffer 
wrote:

But current auto ref is what we have, so I would recommend using it.


I would recommend to ignore auto ref for rvalue references. It 
generates 2^N functions where N is the amount of auto ref parameters. 
That the most awful template bloat I've ever seen.


It only generates 2^N functions if you call it 2^N different ways. 
Most of the time you call it the same way.




If that would be true we wouldn't need auto ref at all.


The author of the function may not be the one calling it, so he doesn't 
know the way you like to call it.


All I'm saying is to think about that your 2^N prediction requires 2^N 
lines of code, all calling it different ways. It's not likely to happen.


-Steve


Re: TransitiveBaseTypeTuple doesn't seemed to print the symbols as well.

2018-01-10 Thread Adam D. Ruppe via Digitalmars-d-learn

On Wednesday, 10 January 2018 at 18:31:17 UTC, 12345swordy wrote:

for(int x = 0; x < TL.length; x++)
{
  auto b = [__traits(allMembers, TL[0])];



Simple mistake there...


TransitiveBaseTypeTuple doesn't seemed to print the symbols as well.

2018-01-10 Thread 12345swordy via Digitalmars-d-learn
I expect ["__ctor", "__dtor", "toString", "toHash", "opCmp", 
"opEquals"], instead I got ["toString", "toHash", "opCmp", 
"opEquals", "Monitor", "factory"]

Care anyone explain why it is?

Source is the following:

import std.stdio;
import std.traits;

interface A
{
}


class D : A
{
this()
{
}
~this()
{
}
}




void main()
{
alias TL = TransitiveBaseTypeTuple!D;
for(int x = 0; x < TL.length; x++)
{
  auto b = [__traits(allMembers, TL[0])];
  writeln(b);
}
}




Re: Storing struct in a array

2018-01-10 Thread Vino via Digitalmars-d-learn

On Tuesday, 9 January 2018 at 19:05:48 UTC, thedeemon wrote:

On Tuesday, 9 January 2018 at 18:09:58 UTC, Vino wrote:
 It is possible to store struct in a array ans use the same 
in csvReader


Sure, you can just pass the type of your struct to csvReader:



Array!T1 T1s;
reader(fName, T1s); // pass the array Type as a function 
parameter


First you write a template function that takes an array of some 
generic type and fills it with records from CSV file:


void readData(DataType)(string fname, ref Array!DataType arr) {
foreach (record; fname.readText.csvReader!DataType('\t')) {
arr ~= record;
}
}

Then you can use it in your main program with different types:

struct S1 { string name; string value; int other; }
struct S2 { int a; string b; }

void main () {
...
if (someCondition) {
Array!S1 arr1;
readData("data1.csv", arr1);
} else {
Array!S2 arr2;
readData("data2.csv", arr2);
}
}

A little advice. Kindly pause and spend an evening reading this 
book:

http://ddili.org/ders/d.en/

Currently your code pieces look like a soup produced by someone 
who still confuses variables and types, and lacks basic 
programming skills. Read the book, don't rush with writing 
broken code.


Hi Deemon,

 I agree that my code is broken code and I am a Newbie in the 
world of programming, the confusion begin when i started writing 
the second module, and now i was able to find the issue, and the 
real requirement. The requirement is as below.


Program: The below program works.
auto reader(MyStruct) (File fname, auto ref MyStruct st) {
alias ColumnTypes = AliasSeq!(MyStruct);
foreach (record; 
fname.byLineCopy().joiner("\n").csvReader!(Tuple!ColumnTypes)(null)) {

writeln(record[0], record[1], record[2]);
}

void main () {
auto fname = 
File("C:\\Users\\bheev1\\Desktop\\Current\\Script\\Others\\Table2.csv");

auto Table = baseName(stripExtension(fname));
struct S1 { string Name; string Country; int Age; }
S1 Table1s;
reader(File(fname), join([Table, "1s"]));
}

The requirement is as below
The function reader should store the data in column wise Array 
and return the same.


Array!has to be taken from the header data as the CSV file has header 
Name, Country, Age using records.header)

e.g
Array!string Name; (records.header[0]);
Array!string Country;(records.header[1]);
Array!string Age;(records.header[2]);

and return the above arrays

From,
Vino.B





Re: Is there a way to get this associative array initialization to work?

2018-01-10 Thread Jacob Carlborg via Digitalmars-d-learn

On 2018-01-10 17:29, Steven Schveighoffer wrote:

Right, but it doesn't work in variable declarations if that variable is 
part of an associative array.


In other words:

struct S
{
    int x;
}

struct T
{
    S s;
}

T t = {s: {x: 1}}; // nesting works here
S[] arr = [{x: 1}, {x:2}]; // and here
S[string] aa = ["first": {x: 1}, "second": {x: 2}]; // but not here???


Aha, I see. Didn't expect any of those to work.

--
/Jacob Carlborg


Re: Rvalue references

2018-01-10 Thread Dgame via Digitalmars-d-learn
On Wednesday, 10 January 2018 at 14:41:21 UTC, Steven 
Schveighoffer wrote:

On 1/10/18 3:08 AM, Dgame wrote:
On Wednesday, 10 January 2018 at 01:56:02 UTC, Steven 
Schveighoffer wrote:
But current auto ref is what we have, so I would recommend 
using it.


I would recommend to ignore auto ref for rvalue references. It 
generates 2^N functions where N is the amount of auto ref 
parameters. That the most awful template bloat I've ever seen.


It only generates 2^N functions if you call it 2^N different 
ways. Most of the time you call it the same way.


-Steve


If that would be true we wouldn't need auto ref at all.


[Issue 18220] Allow rt_trapexceptions to be set from the CLI

2018-01-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18220

Seb  changed:

   What|Removed |Added

Summary|Allow trapexception to be   |Allow rt_trapexceptions to
   |set from the CLI|be set from the CLI

--


Re: Unable to run D program on mac system when using dependency.

2018-01-10 Thread Colin via Digitalmars-d
On Wednesday, 10 January 2018 at 12:44:01 UTC, Harbeer Kadian 
wrote:
I am pretty new to D language. I am working on existing code 
developed by others. Previous developers were using linux 
environment to build and run the D Application.

I am trying to do the same in MAC as it is my local environment.

[...]


What version of DMD are you using?


[Issue 18220] New: Allow trapexception to be set from the CLI

2018-01-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18220

  Issue ID: 18220
   Summary: Allow trapexception to be set from the CLI
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: druntime
  Assignee: nob...@puremagic.com
  Reporter: greensunn...@gmail.com

http://arsdnet.net/this-week-in-d/2016-aug-07.html

> Hopefully, druntime will expose this variable in a more easier way in the 
> future. Currently, on Windows, it is automatically set if a debugger is 
> detected, but on Linux, debugger detection is quite a bit harder and hackier, 
> so it might not happen any time soon. Druntime could (and should!) also 
> potentially offer it as a command line switch, like it does with GC profiling 
> now.

> DRUNTIME DEVS: if you read this, make it happen!

--


Re: Is there a way to get this associative array initialization to work?

2018-01-10 Thread Steven Schveighoffer via Digitalmars-d-learn

On 1/10/18 10:11 AM, Jacob Carlborg wrote:

On 2018-01-10 00:19, Steven Schveighoffer wrote:

https://issues.dlang.org/buglist.cgi?list_id=218715=not%20an%20associative%20array%20initializer_type=allwordssubstr_format=advanced=--- 



Note, I think you need at least Sound.SOUND_EFFECT, etc.

This bug looks particularly relevant: 
https://issues.dlang.org/show_bug.cgi?id=11221


I think it should really work.


It's not just in associative arrays it doesn't work. It basically only 
works in variables declarations:


https://issues.dlang.org/show_bug.cgi?id=15692



Right, but it doesn't work in variable declarations if that variable is 
part of an associative array.


In other words:

struct S
{
   int x;
}

struct T
{
   S s;
}

T t = {s: {x: 1}}; // nesting works here
S[] arr = [{x: 1}, {x:2}]; // and here
S[string] aa = ["first": {x: 1}, "second": {x: 2}]; // but not here???

-Steve


Re: dub should be more command-line oriented

2018-01-10 Thread Joakim via Digitalmars-d

On Wednesday, 10 January 2018 at 15:07:40 UTC, Luís Marques wrote:
I often feel that dub relies too much on dub.[json|sdl] and too 
little on command-line switches. Here's the latest example:


[...]


You're welcome to submit a pull for a command-line flag or a new 
build mode or however you best envision this fixed:


https://github.com/dlang/dub/pulls


Re: Is there a way to get this associative array initialization to work?

2018-01-10 Thread Jacob Carlborg via Digitalmars-d-learn

On 2018-01-10 00:19, Steven Schveighoffer wrote:

https://issues.dlang.org/buglist.cgi?list_id=218715=not%20an%20associative%20array%20initializer_type=allwordssubstr_format=advanced=--- 



Note, I think you need at least Sound.SOUND_EFFECT, etc.

This bug looks particularly relevant: 
https://issues.dlang.org/show_bug.cgi?id=11221


I think it should really work.


It's not just in associative arrays it doesn't work. It basically only 
works in variables declarations:


https://issues.dlang.org/show_bug.cgi?id=15692

--
/Jacob Carlborg


dub should be more command-line oriented

2018-01-10 Thread Luís Marques via Digitalmars-d
I often feel that dub relies too much on dub.[json|sdl] and too 
little on command-line switches. Here's the latest example:


1) Write code
2) Start refactoring code
3) Compile and run to check the partially implemented change
4) dub gives a warning; the warning is expected due to the 
incomplete change; I don't care about it right now, I just want 
to check that something related to that change works
5) Because of the warning, dub doesn't even finish building the 
project

6) I want to force dub to build it, but there's no switch for that
7) I have to go check the docs for what is the dub.json setting 
that allows warnings (it's "buildRequirements": ["allowWarnings"])

8) I change dub.json
9) I compile it again

universe 1:
10) I finish the refactoring
11) I forget to remove the new setting

universe 2:
10) I remove "allowWarnings" immediately
11) while trying to do another intermediate testing step, I get 
another warning

12) goto 7 or 8


Re: Rvalue references

2018-01-10 Thread Steven Schveighoffer via Digitalmars-d-learn

On 1/10/18 3:08 AM, Dgame wrote:

On Wednesday, 10 January 2018 at 01:56:02 UTC, Steven Schveighoffer wrote:

But current auto ref is what we have, so I would recommend using it.


I would recommend to ignore auto ref for rvalue references. It generates 
2^N functions where N is the amount of auto ref parameters. That the 
most awful template bloat I've ever seen.


It only generates 2^N functions if you call it 2^N different ways. Most 
of the time you call it the same way.


-Steve



Vibe-d issue with timer in separate thread on debug builds

2018-01-10 Thread Andres Clari via Digitalmars-d-learn
Hi, I have an app that uses vibe tasks, fibers and timers 
extensively, and I found an issue only for debug builds, when 
canceling a timer. However the code in question works just fine 
in the release build.


But having this here makes testing certain things in my program a 
pain, since it'll crash on the assert in question:


vibe-d-0.8.2/vibe-d/core/vibe/core/drivers/libevent2.d:474
debug assert(m_ownerThread is () @trusted { return 
Thread.getThis(); } ());



Also, not sure I understand that assert properly... Is it 
checking the stop timer call is fired from the main thread the 
event loop is running? That would be bad, since basically that 
timer run from a child thread.


need help with vibe.d receive()

2018-01-10 Thread crimaniak via Digitalmars-d-learn

Hi!

I make multi-task event bus, but there is a problem with the task 
stops.

Please see end of file
https://github.com/crimaniak/d-vision/blob/master/src/vision/eventbus.d

Expected behavior: After sending the StopEvent message in line 
244 it is must be detected in listeners (line 147), so all 
listeners must set exit flag to 'true' and quit immediately.
De-facto behavior: StopEvent() message is not detected by the 
first delegate in line 147 (logger task logs this message by the 
handler in line 185), so subscribed tasks never exit and test 
stops on line 248.


I tried to play with yield() and sleep(), with 'shared' 
attributes and so on, but without result. Can you say please what 
I am doing wrong here?


'dub test' can be used to play with tests.


[Issue 13632] Second argument for std.string.strip

2018-01-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13632

--- Comment #2 from Aravinda  ---
(In reply to Seb from comment #1)
> @Aravinda VK: thanks a lot for taking this. Please don't forget to add a
> link to your PR here. Otherwise people in the future will have a hard time
> finding or even being aware of it:
> 
> https://github.com/dlang/phobos/pull/6023

Noted. This is my first patch/bug in D lang community. I will make sure to add
PR link in future. Thanks.

--


[Issue 13632] Second argument for std.string.strip

2018-01-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13632

Seb  changed:

   What|Removed |Added

   Keywords||pull
 CC||greensunn...@gmail.com

--- Comment #1 from Seb  ---
@Aravinda VK: thanks a lot for taking this. Please don't forget to add a link
to your PR here. Otherwise people in the future will have a hard time finding
or even being aware of it:

https://github.com/dlang/phobos/pull/6023

--


Re: Dll support: testers needed

2018-01-10 Thread Benjamin Thaut via Digitalmars-d

Am 10.01.2018 um 13:39 schrieb Domain:


Sorry, my mistake. But I cannot use your binary:

D:\>dmd -m64 -shared dll.d -ofdll.dll
Error: unrecognized file extension dll




This works just fine for me. What is the output when you execute "dmd 
--version"?


--
Kind Regards
Benjamin Thaut


Unable to run D program on mac system when using dependency.

2018-01-10 Thread Harbeer Kadian via Digitalmars-d
I am pretty new to D language. I am working on existing code 
developed by others. Previous developers were using linux 
environment to build and run the D Application.

I am trying to do the same in MAC as it is my local environment.

Here is how my jub.json file looks like
{
"name" : "dsmasher",
"description" : "Hello World - A minimal DUB bundle.",
"dependencies" : {
"d2sqlite3": "~>0.9.7",
"botan": "~>1.12.9"
}
}

The program is very simple
import std.stdio;

int main () {
   return 0;
}

But when I build it throws following errors.

/Library/D/dmd/src/druntime/import/object.d(3440,23): Error: 
template memutils.refcounted.RefCounted!(X509CertificateImpl, 
ThreadMem).RefCounted.opCast does not match any template 
declaration
/Library/D/dmd/src/druntime/import/object.d(3440,49): Error: 
template memutils.refcounted.RefCounted!(X509CertificateImpl, 
ThreadMem).RefCounted.opCast does not match any template 
declaration
/Library/D/dmd/src/druntime/import/object.d(3441,39): Error: 
template memutils.refcounted.RefCounted!(X509CertificateImpl, 
ThreadMem).RefCounted.opCast does not match any template 
declaration

../../../.dub/packages/memutils-0.4.9/memutils/source/memutils/vector.d(790,10):
 Error: template instance 
object.__equals!(const(RefCounted!(X509CertificateImpl, ThreadMem)), 
const(RefCounted!(X509CertificateImpl, ThreadMem))) error instantiating
../../../.dub/packages/memutils-0.4.9/memutils/source/memutils/helpers.d(71,27):
instantiated from here: opEquals!()
../../../.dub/packages/botan-1.12.9/botan/source/botan/tls/server.d(689,38):
instantiated from here: 
opEquals!(RefCounted!(Vector!(RefCounted!(X509CertificateImpl, ThreadMem), 
ThreadMem), ThreadMem))
/Library/D/dmd/bin/dmd failed with exit code 1.
  ^^^ Terminated, exit code: 2 ^^^
  Build terminated.  

I am using dmd compiler for this.
Please help if you have any idea.



Re: Submit D Machine Learning libraries

2018-01-10 Thread angel via Digitalmars-d

It is funny, there is 'DLib' under C++.

On Tuesday, 9 January 2018 at 20:39:25 UTC, aberba wrote:

On Tuesday, 9 January 2018 at 19:46:00 UTC, aberba wrote:
[1] is a curated list of machine learning libraries for 
several programming languages (no D library in list). I don't 
know much about ML that much to suggest any of those in the 
Dub registry. I know we have Vectorflow from Netflix 
(http://code.dlang.org/packages/vectorflow), D computer Vision 
(https://code.dlang.org/packages/dcv), and all these MIR 
related libs (http://code.dlang.org/search?q=mir)


Please make pull request for D at 
https://github.com/josephmisiti/awesome-machine-learning


[1] https://github.com/josephmisiti/awesome-machine-learning


Might win some people over.


Also http://code.dlang.org/packages/dopt (A numerical 
optimisation and deep learning framework)




Re: Dll support: testers needed

2018-01-10 Thread Domain via Digitalmars-d
On Wednesday, 10 January 2018 at 11:30:47 UTC, Benjamin Thaut 
wrote:

Am 10.01.2018 um 05:18 schrieb Domain:
On Saturday, 6 January 2018 at 19:32:51 UTC, Benjamin Thaut 
wrote:
I'm currently back on dll support and I'm applying finishing 
touches to my dll support PR. Now I want to know if I missed 
any corner cases and it would be great if a few more people 
gave the dll support a try.


[...]


I am glad to see this happen. But my use case is not working:
http://forum.dlang.org/post/giywzmvfeuddvmvkr...@forum.dlang.org


Hi Domain,

what your describing is a very simple use case and should 
definitly work. Did you try it using my binary distribution? 
Please post a repro-case. I don't have the time to rebuild 
everyones use case and saying "My use case is not working" does 
not help at all.


Sorry, my mistake. But I cannot use your binary:

D:\>dmd -m64 -shared dll.d -ofdll.dll
Error: unrecognized file extension dll




Re: !Alert! code.dlang.org down

2018-01-10 Thread Daniel Kozak via Digitalmars-d
OK, I am unable to compile dub-registry :D, I have only 4GB free RAM and it
seems it is not enought LOL

On Wed, Jan 10, 2018 at 12:03 PM, Daniel Kozak  wrote:

> Thank you :)
>
> On Wed, Jan 10, 2018 at 11:53 AM, Seb via Digitalmars-d <
> digitalmars-d@puremagic.com> wrote:
>
>> On Wednesday, 10 January 2018 at 10:36:57 UTC, Daniel Kozak wrote:
>>
>>> I am able to provide my VPS for mirroring too. Is there a tutorial how
>>> to do it?
>>>
>>
>> The dub-registry binary can be started with `--mirror=
>> https://code.dlang.org`
>> Martin even an Ansible script for dub-mirror.dlang.io:
>>
>> https://github.com/dlang/ci/blob/master/ansible/roles/dub_re
>> gistry_mirror/tasks/main.yml
>>
>> It boils down to these tasks:
>>
>> 1) git clone https://github.com/dlang/dub-registry
>> 2) dub #  <- maybe -b release
>> 3) Install mongo and start
>>
>> sudo apt-get install mongodb && sudo systemctl enable mongodb && sudo
>> systemctl start mongodb
>>
>> 4) Configure a systemd service
>>
>> Here's my systemd service:
>>
>> /etc/systemd/system/dub-registry.service
>>>
>>
>> -
>> [Unit]
>> Description=DUB registry
>> OnFailure=unit-status-mail@%n.service
>>
>> [Service]
>> Environment="PORT=9001"
>> ExecStart=/opt/projects/dub-registry/dub-registry --port 8005 --mirror=
>> https://code.dlang.org --hostname=code-mirror2.dlang.org --vv
>> WorkingDirectory=/opt/projects/dub-registry
>> Restart=always
>> RestartSec=30
>> User=dub-registry
>>
>> [Install]
>> WantedBy=multi-user.target
>> --
>>
>>
>> [Unit]
>>>
>> Description=Unit Status Mailer Service
>> After=network.target
>>
>> [Service]
>> Type=simple
>> ExecStart=/opt/bin/unit-status-mail.sh "%I" "Hostname: %H" "Machine ID:
>> %m" "Boot ID: %b"
>> 
>>
>>
>> /opt/bin/unit-status-mail.sh
>>>
>>
>> 
>> #!/bin/bash
>> MAILTO="root"
>> MAILFROM="unit-status-mailer"
>> UNIT=$1
>>
>> EXTRA=""
>> for e in "${@:2}"; do
>>   EXTRA+="$e"$'\n'
>> done
>>
>> UNITSTATUS=$(systemctl status $UNIT)
>> UNITLOG=$(journalctl -u $UNIT -r | head -n 100)
>>
>> sendmail $MAILTO <> From:$MAILFROM
>> To:$MAILTO
>> Subject:Status of: $UNIT
>>
>> Status report for unit: $UNIT
>> $EXTRA
>>
>> $UNITSTATUS
>>
>> $UNITLOG
>> EOF
>>
>> echo -e "Status mail sent to: $MAILTO for unit: $UNIT"
>> ---
>>
>> 5) Configure Nginx
>>
>> /etc/nginx/sites-available/dub-mirror
>>>
>> ---
>>
>> server {
>> listen 80;
>> listen [::]:80;
>> server_name code-mirror2.dlang.io;
>>
>> location / {
>> proxy_pass http://localhost:8005;
>> }
>> }
>> ---
>>
>> 6) Configure Letsencrypt for SSL (optional)
>> 7) Add yourself to this list:
>>
>> https://github.com/dlang/dub/blob/master/source/dub/dub.d#L64
>>
>> Note that with a few tweaks it's possible to run the dub-registry on
>> Heroku:
>>
>> https://github.com/dlang/dub-registry/pull/231
>>
>
>


Re: Dll support: testers needed

2018-01-10 Thread Benjamin Thaut via Digitalmars-d

Am 10.01.2018 um 05:18 schrieb Domain:

On Saturday, 6 January 2018 at 19:32:51 UTC, Benjamin Thaut wrote:
I'm currently back on dll support and I'm applying finishing touches 
to my dll support PR. Now I want to know if I missed any corner cases 
and it would be great if a few more people gave the dll support a try.


[...]


I am glad to see this happen. But my use case is not working:
http://forum.dlang.org/post/giywzmvfeuddvmvkr...@forum.dlang.org


Hi Domain,

what your describing is a very simple use case and should definitly 
work. Did you try it using my binary distribution? Please post a 
repro-case. I don't have the time to rebuild everyones use case and 
saying "My use case is not working" does not help at all.


--
Kind Regards
Benjamin Thaut


Re: [howto] Serve ddox documentation on github.io deployed by Travis CI

2018-01-10 Thread Bastiaan Veelo via Digitalmars-d-announce

On Wednesday, 10 January 2018 at 02:59:38 UTC, Martin Nowak wrote:
I've changed my blueprint project accordingly 
https://github.com/MartinNowak/bloom/blob/1e2c2729a2618962e596d68635c5e7e46def2189/.travis.yml.


I included a link to bloom at the bottom of the howto.


Re: !Alert! code.dlang.org down

2018-01-10 Thread Daniel Kozak via Digitalmars-d
Thank you :)

On Wed, Jan 10, 2018 at 11:53 AM, Seb via Digitalmars-d <
digitalmars-d@puremagic.com> wrote:

> On Wednesday, 10 January 2018 at 10:36:57 UTC, Daniel Kozak wrote:
>
>> I am able to provide my VPS for mirroring too. Is there a tutorial how to
>> do it?
>>
>
> The dub-registry binary can be started with `--mirror=https://code.dlang.o
> rg`
> Martin even an Ansible script for dub-mirror.dlang.io:
>
> https://github.com/dlang/ci/blob/master/ansible/roles/dub_re
> gistry_mirror/tasks/main.yml
>
> It boils down to these tasks:
>
> 1) git clone https://github.com/dlang/dub-registry
> 2) dub #  <- maybe -b release
> 3) Install mongo and start
>
> sudo apt-get install mongodb && sudo systemctl enable mongodb && sudo
> systemctl start mongodb
>
> 4) Configure a systemd service
>
> Here's my systemd service:
>
> /etc/systemd/system/dub-registry.service
>>
>
> -
> [Unit]
> Description=DUB registry
> OnFailure=unit-status-mail@%n.service
>
> [Service]
> Environment="PORT=9001"
> ExecStart=/opt/projects/dub-registry/dub-registry --port 8005 --mirror=
> https://code.dlang.org --hostname=code-mirror2.dlang.org --vv
> WorkingDirectory=/opt/projects/dub-registry
> Restart=always
> RestartSec=30
> User=dub-registry
>
> [Install]
> WantedBy=multi-user.target
> --
>
>
> [Unit]
>>
> Description=Unit Status Mailer Service
> After=network.target
>
> [Service]
> Type=simple
> ExecStart=/opt/bin/unit-status-mail.sh "%I" "Hostname: %H" "Machine ID:
> %m" "Boot ID: %b"
> 
>
>
> /opt/bin/unit-status-mail.sh
>>
>
> 
> #!/bin/bash
> MAILTO="root"
> MAILFROM="unit-status-mailer"
> UNIT=$1
>
> EXTRA=""
> for e in "${@:2}"; do
>   EXTRA+="$e"$'\n'
> done
>
> UNITSTATUS=$(systemctl status $UNIT)
> UNITLOG=$(journalctl -u $UNIT -r | head -n 100)
>
> sendmail $MAILTO < From:$MAILFROM
> To:$MAILTO
> Subject:Status of: $UNIT
>
> Status report for unit: $UNIT
> $EXTRA
>
> $UNITSTATUS
>
> $UNITLOG
> EOF
>
> echo -e "Status mail sent to: $MAILTO for unit: $UNIT"
> ---
>
> 5) Configure Nginx
>
> /etc/nginx/sites-available/dub-mirror
>>
> ---
>
> server {
> listen 80;
> listen [::]:80;
> server_name code-mirror2.dlang.io;
>
> location / {
> proxy_pass http://localhost:8005;
> }
> }
> ---
>
> 6) Configure Letsencrypt for SSL (optional)
> 7) Add yourself to this list:
>
> https://github.com/dlang/dub/blob/master/source/dub/dub.d#L64
>
> Note that with a few tweaks it's possible to run the dub-registry on
> Heroku:
>
> https://github.com/dlang/dub-registry/pull/231
>


Re: !Alert! code.dlang.org down

2018-01-10 Thread Seb via Digitalmars-d

On Wednesday, 10 January 2018 at 10:36:57 UTC, Daniel Kozak wrote:
I am able to provide my VPS for mirroring too. Is there a 
tutorial how to do it?


The dub-registry binary can be started with 
`--mirror=https://code.dlang.org`

Martin even an Ansible script for dub-mirror.dlang.io:

https://github.com/dlang/ci/blob/master/ansible/roles/dub_registry_mirror/tasks/main.yml

It boils down to these tasks:

1) git clone https://github.com/dlang/dub-registry
2) dub #  <- maybe -b release
3) Install mongo and start

sudo apt-get install mongodb && sudo systemctl enable mongodb && 
sudo systemctl start mongodb


4) Configure a systemd service

Here's my systemd service:


/etc/systemd/system/dub-registry.service


-
[Unit]
Description=DUB registry
OnFailure=unit-status-mail@%n.service

[Service]
Environment="PORT=9001"
ExecStart=/opt/projects/dub-registry/dub-registry --port 8005 
--mirror=https://code.dlang.org --hostname=code-mirror2.dlang.org 
--vv

WorkingDirectory=/opt/projects/dub-registry
Restart=always
RestartSec=30
User=dub-registry

[Install]
WantedBy=multi-user.target
--



[Unit]

Description=Unit Status Mailer Service
After=network.target

[Service]
Type=simple
ExecStart=/opt/bin/unit-status-mail.sh "%I" "Hostname: %H" 
"Machine ID: %m" "Boot ID: %b"





/opt/bin/unit-status-mail.sh



#!/bin/bash
MAILTO="root"
MAILFROM="unit-status-mailer"
UNIT=$1

EXTRA=""
for e in "${@:2}"; do
  EXTRA+="$e"$'\n'
done

UNITSTATUS=$(systemctl status $UNIT)
UNITLOG=$(journalctl -u $UNIT -r | head -n 100)

sendmail $MAILTO <
/etc/nginx/sites-available/dub-mirror

---

server {
listen 80;
listen [::]:80;
server_name code-mirror2.dlang.io;

location / {
proxy_pass http://localhost:8005;
}
}
---

6) Configure Letsencrypt for SSL (optional)
7) Add yourself to this list:

https://github.com/dlang/dub/blob/master/source/dub/dub.d#L64

Note that with a few tweaks it's possible to run the dub-registry 
on Heroku:


https://github.com/dlang/dub-registry/pull/231


How to pass --DRT-covopt to dub test?

2018-01-10 Thread Andre Pany via Digitalmars-d-learn

Hi,

I have some issues to find out how I can pass --DRT-covopt to dub 
test.

I am pretty sure this should work, but dub doesn't like it:

dub test --coverage -- --DRT-covopt "dstpath:./cov"
...
Running .\cov-sample.exe dstpath:./cov
...

Is there s.th. I miss?

Kind regards
André




Re: !Alert! code.dlang.org down

2018-01-10 Thread Daniel Kozak via Digitalmars-d
I am able to provide my VPS for mirroring too. Is there a tutorial how to
do it?

On Wed, Jan 10, 2018 at 11:27 AM, Seb via Digitalmars-d <
digitalmars-d@puremagic.com> wrote:

> On Wednesday, 10 January 2018 at 10:10:22 UTC, Martin Tschierschke wrote:
>
>> In the moment I don't have access, hopefully this is only temporal
>> problem and the rescue team for fixing is already on the way...
>>
>
> Hehe, I'm working on adding more stability to our CI infrastructure, e.g.
>
> https://github.com/travis-ci/travis-build/pull/1282
> https://github.com/dlang/installer/pull/214
> https://github.com/dlang/installer/pull/291
>
> DUB >= 1.6.0 comes with a couple of mirrors and should softly fallback to
> them:
>
> https://code-mirror.dlang.io
> http://code-mirror3.dlang.io
>
> code-mirror2 seems to be down too. I will have a look into that.
>


Re: !Alert! code.dlang.org down

2018-01-10 Thread Seb via Digitalmars-d
On Wednesday, 10 January 2018 at 10:10:22 UTC, Martin 
Tschierschke wrote:
In the moment I don't have access, hopefully this is only 
temporal problem and the rescue team for fixing is already on 
the way...


Hehe, I'm working on adding more stability to our CI 
infrastructure, e.g.


https://github.com/travis-ci/travis-build/pull/1282
https://github.com/dlang/installer/pull/214
https://github.com/dlang/installer/pull/291

DUB >= 1.6.0 comes with a couple of mirrors and should softly 
fallback to them:


https://code-mirror.dlang.io
http://code-mirror3.dlang.io

code-mirror2 seems to be down too. I will have a look into that.


[Issue 18219] Private import inside struct leaks symbols when used as VarDeclaration types

2018-01-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18219

--- Comment #1 from RazvanN  ---
PR: https://github.com/dlang/dmd/pull/7668

--


!Alert! code.dlang.org down

2018-01-10 Thread Martin Tschierschke via Digitalmars-d
In the moment I don't have access, hopefully this is only 
temporal problem and the rescue team for fixing is already on the 
way...




[Issue 17961] std.uni does not compile with -unittest -dip1000

2018-01-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17961

Carsten Blüggel  changed:

   What|Removed |Added

 CC||chi...@posteo.net

--- Comment #7 from Carsten Blüggel  ---
Although -dip1000 is not ready, it's complaint seems to be justified in at
least 1 of 2 spots here:
The complaints originate in the function immediately preceding the reported
error line:  ref intersect()(dchar ch)
(1) There are 2 assignments to this: this = This.init...
that raise the error, IMO legitimately: reference to local variable __tmp...
assigned to non-scope parameter this.
This could be calmed down using instead: data.length(0); I hope it's an
equivalent for This.init in this case.
(2) The other one (same error msg) stems from this.byInterval in the foreach
loop and seems to be questionable.

In the end, this works with -dip1000 enabled:

ref intersect()(dchar ch)
{
scope arr = data;
foreach (i; Intervals!(typeof(data))(arr))
if (i.a <= ch && ch < i.b)
{
data.length(0);
return this.add(ch, ch+1);
}
data.length(0);
return this;
}

If there are no objections, I'll file a PR Fix issue 17961 - ...

--


[Issue 13632] Second argument for std.string.strip

2018-01-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13632

Aravinda  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||hallimanearav...@gmail.com
   Assignee|nob...@puremagic.com|hallimanearav...@gmail.com

--


Re: [howto] Serve ddox documentation on github.io deployed by Travis CI

2018-01-10 Thread Bastiaan Veelo via Digitalmars-d-announce
On Wednesday, 10 January 2018 at 08:50:37 UTC, Bastiaan Veelo 
wrote:
I don't know if I am being paranoid but it's been said that 
GitHub tokens give access to all repositories and just pasting 
an unencrypted token in some web interface is a security risk. 
For a howto I figured the safer route is better.


[1] https://gist.github.com/vidavidorra/548ffbcdae99d752da02


For clarity: following the howto [2] you do the encryption 
locally and limit access to the repository in question.


[2] https://gist.github.com/veelo/f7668510bad2e8c9212ab66104541fcc


Re: [howto] Serve ddox documentation on github.io deployed by Travis CI

2018-01-10 Thread Bastiaan Veelo via Digitalmars-d-announce

On Wednesday, 10 January 2018 at 02:59:38 UTC, Martin Nowak wrote:
[...]
Also adding the token in Travis' settings page instead in the 
yaml makes things easier.


Yes it does make it easier. But I chose not to because of 
comments on [1] (notably by ilg-ul). I don't know if I am being 
paranoid but it's been said that GitHub tokens give access to all 
repositories and just pasting an unencrypted token in some web 
interface is a security risk. For a howto I figured the safer 
route is better.


[1] https://gist.github.com/vidavidorra/548ffbcdae99d752da02

Maybe worthwile to add this scaffolding to dub or some other 
tool? Anyone volunteering?


This could be a good idea. Probably even better is to let 
code.dlang.org take care of it, which would make the whole token 
issue and setup obsolete.


[Issue 18219] New: Private import inside struct leaks symbols when used as VarDeclaration types

2018-01-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18219

  Issue ID: 18219
   Summary: Private import inside struct leaks symbols when used
as VarDeclaration types
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: razvan.nitu1...@gmail.com

// a.d
class Foobar
{
int a;
this(int a)
{   
this.a = a;
}   
static int smeth()
{   
return 1;
}   
}
void fun() {}

// b.d
struct AST 
{
import a;
}

// c.d
void main()
{
import b;
AST.Foobar t;// compiles
AST.Foobar.smeth();  // does not compile
AST.fun();   // does not compile   
}

`AST.Foobar t` should not compile.

--


Re: Rvalue references

2018-01-10 Thread Dgame via Digitalmars-d-learn
On Wednesday, 10 January 2018 at 01:56:02 UTC, Steven 
Schveighoffer wrote:
But current auto ref is what we have, so I would recommend 
using it.


I would recommend to ignore auto ref for rvalue references. It 
generates 2^N functions where N is the amount of auto ref 
parameters. That the most awful template bloat I've ever seen.