Re: Digger 2.3 verstr.h problem

2015-08-23 Thread John Colvin via Digitalmars-d-learn
On Sunday, 23 August 2015 at 11:27:32 UTC, Robert M. Münch wrote: Hi, just trying to build the latest DMD with Digger 2.3 and get this: uffer.d root/port.d root/response.d root/rmem.d root/rootobject.d root/speller.d root/stringtable.d newdelete.o glue.a backend.a globals.d(293): Error: file

Re: Trying to compile weather program

2015-08-23 Thread Gerald Jansen via Digitalmars-d-learn
On Sunday, 23 August 2015 at 16:00:19 UTC, Tony wrote: /usr/bin/ld: cannot find -lcurl Just the other day I had a similar problem (compiling vibenews, ld complained of missing -levent and -lssl), which I managed to solve simply by installing the development versions of the libraries (i.e.

Re: How to use ranges?

2015-08-23 Thread Gary Willoughby via Digitalmars-d-learn
On Sunday, 23 August 2015 at 17:58:44 UTC, Doolan wrote: ... Read this for a nice introduction: http://ddili.org/ders/d.en/ranges.html Then watch this: https://www.youtube.com/watch?v=A8Btr8TPJ8c

Re: How to use ranges?

2015-08-23 Thread John Colvin via Digitalmars-d-learn
Generally, dynamic arrays / slices are random-access ranges. Narrow strings (string/wstring/char[]/wchar[]/...) are a notable exception to this. They are dynamic arrays of UTF-8/UTF-16 code units. But they're not random-access ranges of Unicode code units. Instead, they're _forward_ ranges of

Re: Trying to compile weather program

2015-08-23 Thread Tony via Digitalmars-d-learn
On Sunday, 23 August 2015 at 16:00:19 UTC, Tony wrote: Thanks for the replies. It compiles OK with just. However, it isn't linking: /usr/bin/ld: cannot find -lcurl I do have some versions of libcurl on my system: /usr/lib/x86_64-linux-gnu/libcurl.so.3

Re: post on using go 1.5 and GC latency

2015-08-23 Thread Atila Neves via Digitalmars-d-learn
On Saturday, 22 August 2015 at 06:54:43 UTC, Ola Fosheim Grøstad wrote: On Saturday, 22 August 2015 at 06:48:48 UTC, Russel Winder wrote: But one that Google are entirely happy to fully fund. Yes, they have made Go fully supported on Google Cloud now, so I think it is safe to say that Google

Re: How to use ranges?

2015-08-23 Thread anonymous via Digitalmars-d-learn
On Sunday 23 August 2015 19:58, Doolan wrote: You can use typeof to get the type of a range expression when typing it out is impractical/impossible. What if I want to save a range in a struct? Or is a range more of a verb than a noun..? Can still use typeof then: struct S { import

Re: post on using go 1.5 and GC latency

2015-08-23 Thread via Digitalmars-d-learn
On Sunday, 23 August 2015 at 12:49:35 UTC, Russel Winder wrote: You are mixing too many factors here. General purpose has nothing to do with performance, it is to do with can the language describe most if not all forms of computation. Go is a general purpose programming language just like C,

Re: Trying to compile weather program

2015-08-23 Thread anonymous via Digitalmars-d-learn
On Sunday 23 August 2015 11:54, Tony wrote: weather_report.d(32): Error: undefined identifier centerJustifier `centerJustifier` is new in 2.068. You're probably using an older version of D. You can replace `centerJustifier` with `center` here.

Re: Trying to compile weather program

2015-08-23 Thread BBasile via Digitalmars-d-learn
On Sunday, 23 August 2015 at 09:54:37 UTC, Tony wrote: I found this weather program on the main page (it seems to rotate what it here): [...] try with `center()` or update the compiler. centerJustifier() was added on 25 Apr 2015 so after 2.066.1 release:

Re: Trying to compile weather program

2015-08-23 Thread Tony via Digitalmars-d-learn
Thanks for the replies. It compiles OK with just. However, it isn't linking: /usr/bin/ld: cannot find -lcurl I do have some versions of libcurl on my system: /usr/lib/x86_64-linux-gnu/libcurl.so.3 /usr/lib/x86_64-linux-gnu/libcurl.so.4.3.0 /usr/lib/x86_64-linux-gnu/libcurl.so.4 I see there

Re: How to use ranges?

2015-08-23 Thread Doolan via Digitalmars-d-learn
On Sunday, 23 August 2015 at 13:46:30 UTC, anonymous wrote: On Sunday 23 August 2015 12:17, Doolan wrote: And the use of auto everywhere makes it really hard to tell what types I should be using for anything. My compiler talks about RangeT!(whatever) but you try to use RangeT!(whatever) and

Re: How to use ranges?

2015-08-23 Thread ZombineDev via Digitalmars-d-learn
On Sunday, 23 August 2015 at 17:58:44 UTC, Doolan wrote: ... Ali's book has a very nice chapter about ranges: http://ddili.org/ders/d.en/ranges.html

Re: Digger 2.3 verstr.h problem

2015-08-23 Thread Vladimir Panteleev via Digitalmars-d-learn
On Sunday, 23 August 2015 at 20:07:39 UTC, Robert M. Münch wrote: On 2015-08-23 17:01:07 +, Vladimir Panteleev said: [...] Ok, good. So it should be fixable on my side. [...] Not really sure what's going on there... If I could reproduce it, I'd try building DMD manually - if it still

Re: Digger 2.3 verstr.h problem

2015-08-23 Thread Vladimir Panteleev via Digitalmars-d-learn
On Sunday, 23 August 2015 at 11:27:32 UTC, Robert M. Münch wrote: Hi, just trying to build the latest DMD with Digger 2.3 and get this: uffer.d root/port.d root/response.d root/rmem.d root/rootobject.d root/speller.d root/stringtable.d newdelete.o glue.a backend.a globals.d(293): Error: file

Re: Digger 2.3 verstr.h problem

2015-08-23 Thread Robert M. Münch via Digitalmars-d-learn
On 2015-08-23 17:01:07 +, Vladimir Panteleev said: Can't reproduce this on Windows, Linux or OS X 10.10.3. Ok, good. So it should be fixable on my side. Can you include more of the build log (specifically, the entire failing command line)? It should have a -J. in it. CC=g++

Re: (De)Serializing interfaces

2015-08-23 Thread nims via Digitalmars-d-learn
On Sunday, 23 August 2015 at 03:09:03 UTC, Rikki Cattermole wrote: Anyway to summise why D doesn't yet have something akin to Java or C#. Simply put, we generally work with the actual type not an interface. So libraries like Orange can serialize/deserialize with great certainty that it got

How to use ranges?

2015-08-23 Thread Doolan via Digitalmars-d-learn
I keep running into areas of my code where it looks like I'd benefit from using ranges, and then I try to do some range stuff and my compiler tells me I'm using the wrong types, or there's this problem, or that problem... so I'm scared off and I just figure ways to work around using ranges.

Re: (De)Serializing interfaces

2015-08-23 Thread nims via Digitalmars-d-learn
On Sunday, 23 August 2015 at 08:38:14 UTC, Rikki Cattermole wrote: What I was thinking was having a serialize method take an output range which you will just pass in a value. I'm not really sure what you mean. Replacing the operator by a range function or serializing everything automatically?

Re: (De)Serializing interfaces

2015-08-23 Thread nims via Digitalmars-d-learn
On Sunday, 23 August 2015 at 03:25:27 UTC, Kapps wrote: I've never used Orange, but one thing you could try is casting your object from MyInterface to Object, and registering the type Foobar like in http://dsource.org/projects/orange/wiki/Tutorials/SerializeBase, then serializing/deserializing

Re: post on using go 1.5 and GC latency

2015-08-23 Thread Russel Winder via Digitalmars-d-learn
On Sun, 2015-08-23 at 11:26 +, rsw0x via Digitalmars-d-learn wrote: […] https://groups.google.com/forum/#!msg/golang -dev/pIuOcqAlvKU/C0wooVzXLZwJ 25-50% performance decrease across the board in 1.4 with the addition of write barriers, to an already slow language. Garbage collection

Re: (De)Serializing interfaces

2015-08-23 Thread Rikki Cattermole via Digitalmars-d-learn
On 8/23/2015 10:17 PM, nims wrote: On Sunday, 23 August 2015 at 08:38:14 UTC, Rikki Cattermole wrote: What I was thinking was having a serialize method take an output range which you will just pass in a value. I'm not really sure what you mean. Replacing the operator by a range function or

Re: How to use ranges?

2015-08-23 Thread Rikki Cattermole via Digitalmars-d-learn
On 8/23/2015 10:17 PM, Doolan wrote: I keep running into areas of my code where it looks like I'd benefit from using ranges, and then I try to do some range stuff and my compiler tells me I'm using the wrong types, or there's this problem, or that problem... so I'm scared off and I just figure

Re: (De)Serializing interfaces

2015-08-23 Thread Rikki Cattermole via Digitalmars-d-learn
On 8/23/2015 8:15 PM, nims wrote: On Sunday, 23 August 2015 at 03:09:03 UTC, Rikki Cattermole wrote: Anyway to summise why D doesn't yet have something akin to Java or C#. Simply put, we generally work with the actual type not an interface. So libraries like Orange can serialize/deserialize

Re: post on using go 1.5 and GC latency

2015-08-23 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-08-22 at 11:06 +, Laeeth Isharc via Digitalmars-d -learn wrote: […] Builds in Go 1.5 will be slower by a factor of about two. The automatic translation of the compiler and linker from C to Go resulted in unidiomatic Go code that performs poorly compared to well-written

Re: post on using go 1.5 and GC latency

2015-08-23 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-08-22 at 09:27 +, rsw0x via Digitalmars-d-learn wrote: […] The performance decrease has been there since 1.4 and there is no way to remove it - write barriers are the cost you pay for concurrent collection. Go was already much slower than other compiled languages, now it

Re: (De)Serializing interfaces

2015-08-23 Thread Rikki Cattermole via Digitalmars-d-learn
On Sunday, 23 August 2015 at 10:37:11 UTC, Rikki Cattermole wrote: On 8/23/2015 10:17 PM, nims wrote: On Sunday, 23 August 2015 at 08:38:14 UTC, Rikki Cattermole wrote: What I was thinking was having a serialize method take an output range which you will just pass in a value. I'm not really

Re: How to use ranges?

2015-08-23 Thread anonymous via Digitalmars-d-learn
On Sunday 23 August 2015 12:17, Doolan wrote: And the use of auto everywhere makes it really hard to tell what types I should be using for anything. My compiler talks about RangeT!(whatever) but you try to use RangeT!(whatever) and you find out RangeT is private... You can use typeof to get

Re: How to use ranges?

2015-08-23 Thread welkam via Digitalmars-d-learn
There was a talk on ranges in Dconf 2015 https://www.youtube.com/watch?v=A8Btr8TPJ8clist=PLEDeq48KhndP-mlE-0Bfb_qPIMA4RrrKoindex=10

Re: post on using go 1.5 and GC latency

2015-08-23 Thread via Digitalmars-d-learn
On Saturday, 22 August 2015 at 12:48:31 UTC, rsw0x wrote: The problem with D's GC is that there's no scaffolding there for it, so you can't really improve it. At best you could make the collector parallel. If I had the runtime hooks and language guarantees I needed I'd begin work on a

Trying to compile weather program

2015-08-23 Thread Tony via Digitalmars-d-learn
I found this weather program on the main page (it seems to rotate what it here): // Get your local weather report pragma(lib, curl); import std.functional, std.json, std.net.curl, std.stdio, std.string; alias getJSON = pipe!(get, parseJSON); auto K2C = (float f) = f - 273.15; auto K2F =

Digger 2.3 verstr.h problem

2015-08-23 Thread Robert M. Münch via Digitalmars-d-learn
Hi, just trying to build the latest DMD with Digger 2.3 and get this: uffer.d root/port.d root/response.d root/rmem.d root/rootobject.d root/speller.d root/stringtable.d newdelete.o glue.a backend.a globals.d(293): Error: file verstr.h cannot be found or not in a path specified with -J make:

Re: post on using go 1.5 and GC latency

2015-08-23 Thread rsw0x via Digitalmars-d-learn
On Sunday, 23 August 2015 at 11:06:20 UTC, Russel Winder wrote: On Sat, 2015-08-22 at 09:27 +, rsw0x via Digitalmars-d-learn wrote: […] The performance decrease has been there since 1.4 and there is no way to remove it - write barriers are the cost you pay for concurrent collection. Go

Re: How to use ranges?

2015-08-23 Thread Rikki Cattermole via Digitalmars-d-learn
On 8/24/2015 12:52 AM, Doolan wrote: On Sunday, 23 August 2015 at 10:38:53 UTC, Rikki Cattermole wrote: On 8/23/2015 10:17 PM, Doolan wrote: Have a read of: https://github.com/rikkimax/twp-d/blob/master/manuscript/content/idioms/ranges.md Let me know what you think :) I think I'm a little

Re: How to use ranges?

2015-08-23 Thread Doolan via Digitalmars-d-learn
On Sunday, 23 August 2015 at 10:38:53 UTC, Rikki Cattermole wrote: On 8/23/2015 10:17 PM, Doolan wrote: Have a read of: https://github.com/rikkimax/twp-d/blob/master/manuscript/content/idioms/ranges.md Let me know what you think :) I think I'm a little more confused than before... this says

order of declaration/definition

2015-08-23 Thread John Colvin via Digitalmars-d-learn
enum A = 1; enum B = C; //Error static if(A) enum C = 0; enum D = C; //OK Is order supposed to matter here?

Templates and writing variable number of arguments

2015-08-23 Thread Andre Polykanine via Digitalmars-d-learn
Hi everyone, It's me again. Now I'm struggling with the `output` member function which should output a string either to stdout or to a file, depending on the parameter. However, I would like it to work like `writefln` with variable number of arguments: output(Hello %s!, world); //

Re: Templates and writing variable number of arguments

2015-08-23 Thread ted via Digitalmars-d-learn
try replacing: final void output(T)(string text, T params...) const { with final void output(T...)(string text, T params) const { Andre Polykanine via Digitalmars-d-learn wrote: Hi everyone, It's me again. Now I'm struggling with the `output` member function which should