Re: ElementType of MapResult is a delegate??

2018-12-09 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/8/18 8:19 AM, John Chapman wrote: On Saturday, 8 December 2018 at 13:02:00 UTC, Yuxuan Shui wrote: This surprised me A LOT: https://d.godbolt.org/z/82a_GZ So if I call something.map!().array, I get an array of delegates? That makes no sense to me. But in your example, "(a) =>"

Re: Working with ranges

2018-12-09 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/7/18 11:16 PM, Adam D. Ruppe wrote: On Saturday, 8 December 2018 at 04:11:03 UTC, Murilo wrote: What is the difference between declaring "int[3] a = [1,2,3];" and declaring "int[] a = [1,2,3];"? Is the first an array and the second a range? They are both arrays, just the former one has

Calling function explicitly from mixin template results in recursive call instead

2018-12-09 Thread Dennis via Digitalmars-d-learn
I'm using Adam's workaround from https://issues.dlang.org/show_bug.cgi?id=19365, but now I have endless recursion. Reduced code: ``` mixin template operators() { S opBinary(string op: "+")(S rhs) { return rhs; } // (A) auto opBinary(string op, T)(T rhs) if (false) {

Re: dmd -unittest works poorly with executables

2018-12-09 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/8/18 3:16 PM, Andrew Pennebaker wrote: I think it's lame to have to use magical code like `version(unittest) {} else` to guard our main functions, when we run unit tests. Could D go ahead and do the right thing, automatically shadowing our main functions when the unit tests are run?

Re: Why pow() won't go beyond 2^31?

2018-12-09 Thread Murilo via Digitalmars-d-learn
Hi guys, thank you for helping me out here, there is this facebook group for the D language, here we can help and teach each other. It is called Programming in D. Please join. https://www.facebook.com/groups/662119670846705/?ref=bookmarks

How may I tell dub where to find a C library for linking?

2018-12-09 Thread Pablo De Nápoli via Digitalmars-d-learn
Hi, I was playing with the example in https://github.com/MoritzMaxeiner/llvm-d/tree/master/examples/fibonacci When I try to build it using dub, the linker cannot find the LLVM library $ dub build Performing "debug" build using /usr/bin/dmd for x86_64. llvm-d 2.4.1: target for configuration

Re: How to get a function name (string) @ compile time

2018-12-09 Thread Arun Chandrasekaran via Digitalmars-d-learn
On Sunday, 9 December 2018 at 03:29:27 UTC, Andrew Pennebaker wrote: On Monday, 3 November 2008 at 12:29:16 UTC, Simen Kjaeraas wrote: On Mon, 03 Nov 2008 12:33:05 +0100, Denis Koroskin <2kor...@gmail.com> wrote: [...] That's not the only error here. Your template function also calls foo

Re: Working with ranges

2018-12-09 Thread Murilo via Digitalmars-d-learn
Hi guys, thank you for helping me out here, there is this facebook group for the D language, here we can help and teach each other. It is called Programming in D. Please join. https://www.facebook.com/groups/662119670846705/?ref=bookmarks

Re: How may I tell dub where to find a C library for linking?

2018-12-09 Thread evilrat via Digitalmars-d-learn
On Monday, 10 December 2018 at 02:59:21 UTC, Pablo De Nápoli wrote: On my system (Debian GNU/Linux 9, 64 bits) the library is in the directory /usr/lib/llvm-6.0/lib/ $ ls -l /usr/lib/llvm-6.0/lib/libLLVM.so lrwxrwxrwx 1 root root 14 oct 24 19:44 /usr/lib/llvm-6.0/lib/libLLVM.so ->

Re: How do I install a library?

2018-12-09 Thread Murilo via Digitalmars-d-learn
Hi guys, thank you for helping me out here, there is this facebook group for the D language, here we can help and teach each other. It is called Programming in D. Please join. https://www.facebook.com/groups/662119670846705/?ref=bookmarks

Re: Which character set does D use?

2018-12-09 Thread Murilo via Digitalmars-d-learn
Hi guys, thank you for helping me out here, there is this facebook group for the D language, here we can help and teach each other. It is called Programming in D. Please join. https://www.facebook.com/groups/662119670846705/?ref=bookmarks

Re: cant run unittests

2018-12-09 Thread Andre Pany via Digitalmars-d-learn
On Saturday, 8 December 2018 at 19:25:41 UTC, Andrew Pennebaker wrote: On Saturday, 16 July 2016 at 20:22:15 UTC, Seb wrote: On Thursday, 14 July 2016 at 10:13:38 UTC, dom wrote: On Thursday, 14 July 2016 at 00:33:50 UTC, ethgeh wrote: On Wednesday, 13 July 2016 at 19:41:53 UTC, dom wrote:

Re: How to get a function name (string) @ compile time

2018-12-09 Thread Stanislav Blinov via Digitalmars-d-learn
On Sunday, 9 December 2018 at 03:29:27 UTC, Andrew Pennebaker wrote: Er, when I try to use either foo.stringof, or __trait(identifier, foo), I always get that binding name, rather than the original function name, sad panda. I can only print out the current variable name, but I want to

Re: Imports and Subfolders and Links (Oh, My!)

2018-12-09 Thread Ron Tarrant via Digitalmars-d-learn
Thanks everyone.