Re: Strong typing and physical units

2020-07-28 Thread Paolo Invernizzi via Digitalmars-d-learn
On Tuesday, 28 July 2020 at 11:04:00 UTC, Cecil Ward wrote: Of course, in C I used to do something like strong typing with an opaque type achieved by using something like typedef struct _something {} * type1; and then I had to do casting to get back the real type, which was unchecked but it

Re: D and Async I/O

2020-05-12 Thread Paolo Invernizzi via Digitalmars-d-learn
On Monday, 11 May 2020 at 15:02:59 UTC, bauss wrote: On Monday, 11 May 2020 at 14:02:54 UTC, Russel Winder wrote: OK, so I need to create an asynchronous TCP server (not HTTP or HTTPS, this is a real server ;-) ). I think the normal response is "Use Vibe.d". However, recently I see Hunt is

Re: Pattern matching via switch?

2020-03-17 Thread Paolo Invernizzi via Digitalmars-d-learn
On Sunday, 15 March 2020 at 18:52:01 UTC, Steven Schveighoffer wrote: D doesn't support this natively. The closest you can get is something akin to what aliak wrote (you would need to write something, not sure if Phobos or some package has implemented the feature), or use cascaded if

Re: Cool name for Dub packages?

2020-03-07 Thread Paolo Invernizzi via Digitalmars-d-learn
On Saturday, 7 March 2020 at 09:31:27 UTC, JN wrote: Do we have any cool name for Dub packages? Rust has 'crates' Crystal has 'shards' Python has 'wheels' Ruby has 'gems' Frankly, I simply hate all that shuffle around names ... it's so difficult to understand people when it's referring to

Re: Meta question - what about moving the D - Learn Forum to a seperate StackExchange platform?

2019-10-18 Thread Paolo Invernizzi via Digitalmars-d-learn
On Friday, 18 October 2019 at 11:45:33 UTC, Seb wrote: On Friday, 18 October 2019 at 10:55:59 UTC, Martin Tschierschke wrote: [...] In the state of the D survey, there were more people in favor of StackOverflow than D.learn, but to be fair the majority voted for "I don't care"

Re: Vibe.d Error

2019-10-18 Thread Paolo Invernizzi via Digitalmars-d-learn
On Friday, 18 October 2019 at 08:06:30 UTC, Vino wrote: On Thursday, 17 October 2019 at 19:02:14 UTC, Vino wrote: [...] Hi Andre, I tried install vibe.d in SUSE linux 12 SP2 and facing the below error, tried the options as per the link https://github.com/vibe-d/vibe.d/issues/1748, still

Re: Undefined symbol: _dyld_enumerate_tlv_storage (OSX)

2019-10-14 Thread Paolo Invernizzi via Digitalmars-d-learn
On Monday, 14 October 2019 at 05:36:44 UTC, Joel wrote: On Friday, 11 October 2019 at 11:38:27 UTC, Jacob Carlborg wrote: [...] I get this since Catalina: Joel-Computer:VacSpace joelchristensen$ dub Failed to invoke the compiler dmd to determine the build platform: dyld: lazy symbol binding

Re: ld errors in osx Catalina

2019-10-09 Thread Paolo Invernizzi via Digitalmars-d-learn
On Wednesday, 9 October 2019 at 16:08:41 UTC, rikki cattermole wrote: On 09/10/2019 11:33 PM, David Briant wrote: [...] D as a native language links against libc, so using the system c compiler as the linker is a viable method to prevent having to look things up. Perhaps try ldc? That

Re: D on ARM laptops?

2019-07-04 Thread Paolo Invernizzi via Digitalmars-d-learn
On Thursday, 4 July 2019 at 01:01:03 UTC, Nicholas Wilson wrote: On Wednesday, 3 July 2019 at 20:49:20 UTC, JN wrote: Does anyone know if and how well D works on ARM laptops (such as Chromebooks and similar)? For example this one https://www.pine64.org/pinebook/ . Can it compile D? Obviously

Re: I really don't understand DUB

2019-04-15 Thread Paolo Invernizzi via Digitalmars-d-learn
On Sunday, 14 April 2019 at 20:51:10 UTC, Andre Pany wrote: On Sunday, 14 April 2019 at 19:46:41 UTC, Ron Tarrant wrote: [...] You are totally right, it should be more intuitive how to use dub. As far as I know if you do not specify in dub.json/dub.sdl what type of package you have

Error: non-shared method core.sync.condition.Condition.notify is not callable using a shared object

2018-10-18 Thread Paolo Invernizzi via Digitalmars-d-learn
There's a rational behind the fact that there's not a 'shared' version of notify/wait method in Condition? Thanks, Paolo

Re: Convert output range to input range

2018-03-18 Thread Paolo Invernizzi via Digitalmars-d-learn
On Saturday, 17 March 2018 at 17:51:50 UTC, John Chapman wrote: I'm trying to replace the old std.streams in my app with ranges. I'm interfacing with a networking library to which I supply a callback that when invoked provides the requested data. I write that data to an output range, but

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

Re: private keyword dont appear to do anything

2017-11-04 Thread Paolo Invernizzi via Digitalmars-d-learn
On Friday, 3 November 2017 at 23:32:52 UTC, H. S. Teoh wrote: [...] What's wrong with the introduction of another visibility attribute that behave like the C++ private? Just curious... --- Paolo

Re: Is it possible to specify the address returned by the address of operator?

2017-09-30 Thread Paolo Invernizzi via Digitalmars-d-learn
On Friday, 29 September 2017 at 22:15:44 UTC, Mengu wrote: On Friday, 29 September 2017 at 02:34:08 UTC, DreadKyller wrote: [...] +1 for forum issue. +1 please...

Re: Accessing part of a struct in an easy way

2017-07-03 Thread Paolo Invernizzi via Digitalmars-d-learn
On Monday, 3 July 2017 at 17:30:51 UTC, Ali Çehreli wrote: hOn 07/03/2017 10:13 AM, Paolo Invernizzi wrote: > [...] struct with > [...] I had difficulty understanding the requirements. For example, it's not clear whether you want the literal "first" and "second" names. [...] Thanks Ali,

Re: Accessing part of a struct in an easy way

2017-07-03 Thread Paolo Invernizzi via Digitalmars-d-learn
On Monday, 3 July 2017 at 16:41:51 UTC, vit wrote: On Monday, 3 July 2017 at 13:53:45 UTC, Paolo Invernizzi wrote: [...] //https://dpaste.dzfl.pl/d59469c264b2 import std.algorithm : map, copy, equal; import std.range : iota; struct Foo { int[3] a; string[2] b; } ref T first(R :

Accessing part of a struct in an easy way

2017-07-03 Thread Paolo Invernizzi via Digitalmars-d-learn
I've struct like that: struct Foo { int a_1; float a_2; string a_3; string b_1; double b_2; } I would like to transparently access that like: foo.a.first foo.b.second = "baz"; with an helper like: auto a(...) { ... } auto b(...) { ... } that can be used also in functions that are

Re: The reason for SIGSEGV function pointer problem

2017-06-07 Thread Paolo Invernizzi via Digitalmars-d-learn
On Wednesday, 7 June 2017 at 16:50:26 UTC, Russel Winder wrote: In the constructor of an object to abstract the result of a call to the C library code, the parameter is: check_frontend_t* cf You should remove the pointer here... /Paolo

Re: D and GDB

2017-06-04 Thread Paolo Invernizzi via Digitalmars-d-learn
On Sunday, 4 June 2017 at 19:24:17 UTC, Basile B. wrote: On Sunday, 4 June 2017 at 18:13:41 UTC, Russel Winder wrote: [...] you have to pipe the output to ddemangle. Personally i don't know how to do this by hand since my IDE does the task automatically

Re: What is PostgreSQL driver is most stable?

2017-03-15 Thread Paolo Invernizzi via Digitalmars-d-learn
On Wednesday, 15 March 2017 at 09:18:16 UTC, Suliman wrote: On Tuesday, 14 March 2017 at 13:36:04 UTC, Daniel Kozak wrote: Dne 14.3.2017 v 14:21 Daniel Kozak napsal(a): Dne 14.3.2017 v 14:13 Suliman via Digitalmars-d-learn napsal(a): I need to develop App that should work on Linux and

Re: What is PostgreSQL driver is most stable?

2017-03-15 Thread Paolo Invernizzi via Digitalmars-d-learn
On Wednesday, 15 March 2017 at 08:50:11 UTC, Dsby wrote: On Tuesday, 14 March 2017 at 16:24:31 UTC, Paolo Invernizzi wrote: On Tuesday, 14 March 2017 at 13:32:31 UTC, Suliman wrote: On Tuesday, 14 March 2017 at 13:21:39 UTC, Paolo Invernizzi wrote: On Tuesday, 14 March 2017 at 13:13:31 UTC,

Re: What is PostgreSQL driver is most stable?

2017-03-14 Thread Paolo Invernizzi via Digitalmars-d-learn
On Tuesday, 14 March 2017 at 13:32:31 UTC, Suliman wrote: On Tuesday, 14 March 2017 at 13:21:39 UTC, Paolo Invernizzi wrote: On Tuesday, 14 March 2017 at 13:13:31 UTC, Suliman wrote: [...] I'm using ddb [1], a full-D implementation of the PostgreSQL protocol. Not everything it's in place,

Re: What is PostgreSQL driver is most stable?

2017-03-14 Thread Paolo Invernizzi via Digitalmars-d-learn
On Tuesday, 14 March 2017 at 13:13:31 UTC, Suliman wrote: I need to develop App that should work on Linux and Windows. It need PostgreSQL driver. I tried Vadim's ddbc for PostgreSQL but it's fail on x64 version of PostgreSQL and possible will not on x64 PG on Linux (I can't test it now).

Re: Natural sorted list of files

2017-02-06 Thread Paolo Invernizzi via Digitalmars-d-learn
On Monday, 6 February 2017 at 18:57:17 UTC, Ali Çehreli wrote: On 02/06/2017 08:43 AM, Dmitry wrote: Found this https://rosettacode.org/wiki/Natural_sorting#D but there is error on ".groupBy!isDigit" (Error: no property 'groupBy' for type 'string'). I think it's now std.algorithm.chunkBy.

Re: [Semi-OT] I don't want to leave this language!

2016-12-08 Thread Paolo Invernizzi via Digitalmars-d-learn
On Thursday, 8 December 2016 at 11:09:12 UTC, ketmar wrote: what can be done, tho, is article (or series of articles) describing what exactly druntime is, how it is compared to libc and libc++, why it doesn't hurt at all, how to do "bare metal" with custom runtime, why GC is handy (and how to

Re: non-constant expression ["foo":5, "bar":10, "baz":2000]

2016-11-28 Thread Paolo Invernizzi via Digitalmars-d-learn
On Sunday, 27 November 2016 at 22:25:51 UTC, John Colvin wrote: On Saturday, 26 November 2016 at 17:37:57 UTC, Paolo Invernizzi wrote: This is stated in documentation [1]: immutable long[string] aa = [ "foo": 5, "bar": 10, "baz": 2000 ]; unittest { assert(aa["foo"] == 5);

Re: non-constant expression ["foo":5, "bar":10, "baz":2000]

2016-11-27 Thread Paolo Invernizzi via Digitalmars-d-learn
On Saturday, 26 November 2016 at 19:57:21 UTC, Adam D. Ruppe wrote: On Saturday, 26 November 2016 at 17:37:57 UTC, Paolo Invernizzi wrote: This is stated in documentation [1]: What's the link? This is a known limitation, it has never worked. The docs should reflect that, though some day, it

non-constant expression ["foo":5, "bar":10, "baz":2000]

2016-11-26 Thread Paolo Invernizzi via Digitalmars-d-learn
This is stated in documentation [1]: immutable long[string] aa = [ "foo": 5, "bar": 10, "baz": 2000 ]; unittest { assert(aa["foo"] == 5); assert(aa["bar"] == 10); assert(aa["baz"] == 2000); } But results to: Error: non-constant expression ["foo":5L, "bar":10L,

Enumerate CTFE bug...

2016-11-21 Thread Paolo Invernizzi via Digitalmars-d-learn
I'm not sure if it's the same as #15064 bug: import std.array, std.range, std.algorithm; immutable static foo = ["a", "b", "c"]; auto bar(R)(R r) { string s = r[1]; return s; } immutable static res = foo.enumerate.map!bar().array; std/typecons.d(526): Error:

Re: test for equality of the content of two AA

2016-10-30 Thread Paolo Invernizzi via Digitalmars-d-learn
On Wednesday, 26 October 2016 at 19:03:45 UTC, Ali Çehreli wrote: On 10/26/2016 08:03 AM, Paolo Invernizzi wrote: [...] If you mean D's AAs, then that is already implemented: void main() { auto a = [ "hello" : 1, "world" : 2 ]; auto b = [ "world" : 2, "hello" : 1 ]; assert(a ==

test for equality of the content of two AA

2016-10-26 Thread Paolo Invernizzi via Digitalmars-d-learn
As the subject states, what is the best idiomatic way for doing that? Thanks in advance /Paolo

Re: How to kill whole application if child thread raises an exception?

2016-10-26 Thread Paolo Invernizzi via Digitalmars-d-learn
On Wednesday, 26 October 2016 at 08:42:02 UTC, dm wrote: Hi. I tried code below: import std.concurrency; import std.stdio; void func() { throw new Exception("I'm an exception"); } void main() { auto tID = spawn(); foreach(line; stdin.byLine) send(tID, ""); } I expect my

Re: Reinstalled Mac

2016-09-29 Thread Paolo Invernizzi via Digitalmars-d-learn
On Thursday, 29 September 2016 at 11:43:32 UTC, Jacob Carlborg wrote: Cool, what if I want to use different versions in different sessions, i.e. I have two tabs open in my terminal? Ummm... All the installed stuff is pretty well organised inside `/usr/local`, so this works... --- hw0062:~

Re: Reinstalled Mac

2016-09-29 Thread Paolo Invernizzi via Digitalmars-d-learn
On Thursday, 29 September 2016 at 06:24:08 UTC, Jacob Carlborg wrote: On 2016-09-29 03:43, David Nadlinger wrote: I've had good experiences using Homebrew, although you sometimes have to wait a day or three for a new release to appear. — David DVM doesn't have that problem :). How easy is it

Re: Experience report on installing dmd 2.066.1 on OSX

2014-11-13 Thread Paolo Invernizzi via Digitalmars-d-learn
On Thursday, 13 November 2014 at 05:57:49 UTC, Joakim wrote: On Wednesday, 12 November 2014 at 22:38:56 UTC, Ali Çehreli wrote: A friend of mine installed dmd on OSX and recorded his experiences: http://cap-lore.com/Languages/D/Install.html I wonder why he had to do manual work like running

Re: Dart bindings for D?

2014-10-30 Thread Paolo Invernizzi via Digitalmars-d-learn
On Thursday, 30 October 2014 at 06:57:23 UTC, Ola Fosheim Grøstad wrote: There are also scripting frameworks that let you write portable code for web and mobile platforms, but they tend to be geared towards a special type of application. E.g. http://www.tidesdk.org/ http://cordova.apache.org/

Re: Why do some language-defined attributes have @ and some not?

2014-10-24 Thread Paolo Invernizzi via Digitalmars-d-learn
On Friday, 24 October 2014 at 00:37:26 UTC, Mike Parker wrote: There are people out there using D who do not participate in the newsgroups. Walter has told us before that he gets emails from companies using D in production. He has to deal with complaints about code breakage that we aren't

Re: Why do some language-defined attributes have @ and some not?

2014-10-22 Thread Paolo Invernizzi via Digitalmars-d-learn
On Thursday, 23 October 2014 at 02:22:41 UTC, Jonathan M Davis wrote: On Thursday, 23 October 2014 at 00:59:26 UTC, Shriramana Sharma via Digitalmars-d-learn wrote: LOL. I understand the sentiment, but it's a waste of time. Jonathan, I agree It's impossible to debate such thing with Walter