Re: Multiple producer - multiple consumer with std.concurrency?

2016-12-08 Thread Christian Köstlin via Digitalmars-d-learn
Hi Ali, Thanks for the input, will read about this. About the slowness. I think it also depends on the situation. Sure, every message from all producers/consumers has to go through one MessageBox, but, that is a small critical section, if the work for producing and consuming takes long enough, the

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

2016-12-08 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 7 December 2016 at 12:12:56 UTC, Ilya Yaroshenko wrote: R, Matlab, Python, Mathematica, Gauss, and Julia use C libs. --Ilya As a C lib, you have the possibility of not initializing the runtime, which leaves usable a part of phobos+druntime and it's only a matter of avoiding TL

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

2016-12-08 Thread Chris via Digitalmars-d-learn
On Wednesday, 7 December 2016 at 16:43:54 UTC, bachmeier wrote: On Wednesday, 7 December 2016 at 16:15:32 UTC, Chris wrote: I don't understand this discussion at all. Why not have both? I don't need bare metal stuff at the moment but I might one day, and I perfectly understand that people may n

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

2016-12-08 Thread ketmar via Digitalmars-d-learn
On Thursday, 8 December 2016 at 10:49:40 UTC, Chris wrote: The "hard way" (no runtime/Phobos/GC) should not be the default and I hope that nobody is seriously suggesting this. It should be available in case anyone needs it. I dare doubt, however, that C/C++ programmers will take to D like ducks

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: [Semi-OT] I don't want to leave this language!

2016-12-08 Thread Guillaume Piolat via Digitalmars-d-learn
On Thursday, 8 December 2016 at 11:32:56 UTC, Paolo Invernizzi wrote: 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, ho

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

2016-12-08 Thread Chris 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

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

2016-12-08 Thread Andrey 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 t

drepl fails because of missing lib linenoise

2016-12-08 Thread Nordlöw via Digitalmars-d-learn
drepl fails to build as https://github.com/drepl/drepl/issues/58 Any ideas why?

Re: drepl fails because of missing lib linenoise

2016-12-08 Thread Edwin van Leeuwen via Digitalmars-d-learn
On Thursday, 8 December 2016 at 12:31:01 UTC, Nordlöw wrote: drepl fails to build as https://github.com/drepl/drepl/issues/58 Any ideas why? Looks like you don't have liblinenoise installed. Some basic notes on how to install on linux/macosx can be found here: https://github.com/BlackEdder

Hosting vibe.d on OpenShift

2016-12-08 Thread aberba via Digitalmars-d-learn
I would like to try vibe.d with mongoDB on OpenShit. I managed to do that on Heroku. Do I need a buildpack like vibe.d? Any help will be really appreciated.

Re: drepl fails because of missing lib linenoise

2016-12-08 Thread Seb via Digitalmars-d-learn
On Thursday, 8 December 2016 at 13:03:10 UTC, Edwin van Leeuwen wrote: On Thursday, 8 December 2016 at 12:31:01 UTC, Nordlöw wrote: drepl fails to build as https://github.com/drepl/drepl/issues/58 Any ideas why? Looks like you don't have liblinenoise installed. ... and for the record I jus

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

2016-12-08 Thread Patric Dexheimer via Digitalmars-d-learn
On Thursday, 8 December 2016 at 12:10:55 UTC, Andrey wrote: 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

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

2016-12-08 Thread Radu 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 l

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

2016-12-08 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Thursday, 8 December 2016 at 09:57:21 UTC, Guillaume Piolat wrote: On Wednesday, 7 December 2016 at 12:12:56 UTC, Ilya Yaroshenko wrote: R, Matlab, Python, Mathematica, Gauss, and Julia use C libs. --Ilya As a C lib, you have the possibility of not initializing the runtime, which leaves

Range of uncopyable elements

2016-12-08 Thread RazvanN via Digitalmars-d-learn
Hi, I am trying to create a range with uncopyable elements. My thought process was the following: 1.I have created a struct : struct S { int a; @disable this(this); } 2. I declared an array : S[] arr = [S(1), S(2), S(3)]; expecting that arr will be a range like, for example, an in

Re: Range of uncopyable elements

2016-12-08 Thread Jerry via Digitalmars-d-learn
The problem is with how isInputRange is defined, requires that front be copyable. auto h = r.front; // can get the front of the range https://github.com/dlang/phobos/blob/v2.072.1/std/range/primitives.d#L168 It doesn't take into consideration that front exists and that it's a reference to a s

@property

2016-12-08 Thread Satoshi via Digitalmars-d-learn
Hello, is there any advantage of marking function as @property?? class Foo { void objectValue(Object value) { } Object objectValue() { } } auto foo = new Foo; // This works fine without @property attribute foo.objectValue = null; auto bar = foo.objectValue;

Re: Range of uncopyable elements

2016-12-08 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Dec 08, 2016 at 04:35:02PM +, Jerry via Digitalmars-d-learn wrote: > The problem is with how isInputRange is defined, requires that front > be copyable. > > auto h = r.front; // can get the front of the range > > https://github.com/dlang/phobos/blob/v2.072.1/std/range/primitives.d#L16

Re: @property

2016-12-08 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 8 December 2016 at 16:53:13 UTC, Satoshi wrote: is there any advantage of marking function as @property?? Not really. I think it just changes the meaning of typeof(thatfunc) but otherwise it does nothing. However, if you use it in a base class, you must also use it when overrid

Re: Range of uncopyable elements

2016-12-08 Thread Jerry via Digitalmars-d-learn
On Thursday, 8 December 2016 at 16:48:07 UTC, H. S. Teoh wrote: On Thu, Dec 08, 2016 at 04:35:02PM +, Jerry via Digitalmars-d-learn wrote: The problem is with how isInputRange is defined, requires that front be copyable. auto h = r.front; // can get the front of the range https://github.c

Re: Range of uncopyable elements

2016-12-08 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Dec 08, 2016 at 05:22:25PM +, Jerry via Digitalmars-d-learn wrote: > On Thursday, 8 December 2016 at 16:48:07 UTC, H. S. Teoh wrote: > > On Thu, Dec 08, 2016 at 04:35:02PM +, Jerry via Digitalmars-d-learn > > wrote: > > > The problem is with how isInputRange is defined, requires tha

Templating Function Names

2016-12-08 Thread Bryce Kellogg via Digitalmars-d-learn
Say I've got a bunch of classes that inherit from a common interface (in this case Component) and a class Foo that can handle any subclass of Component. Like so: interface Component { ... } class A : Component { ... } class B : Component { ... } class C : Component { ... } class Foo { alia

Re: Templating Function Names

2016-12-08 Thread Ali Çehreli via Digitalmars-d-learn
On 12/08/2016 10:21 AM, Bryce Kellogg wrote: > It should look like Foo always had a property named after their custom Component. opDispatch? https://dlang.org/spec/operatoroverloading.html#dispatch Ali

Re: Range of uncopyable elements

2016-12-08 Thread Jerry via Digitalmars-d-learn
On Thursday, 8 December 2016 at 17:29:42 UTC, H. S. Teoh wrote: The problem is that most range algorithms won't work if `auto h = r.front;` doesn't compile. Random chunks of std.algorithm won't work for such a range. One may argue, of course, that std.algorithm ought to be fixed... but the r

Re: Hosting vibe.d on OpenShift

2016-12-08 Thread Tiberiu Gal via Digitalmars-d-learn
On Thursday, 8 December 2016 at 14:03:35 UTC, aberba wrote: I would like to try vibe.d with mongoDB on OpenShit. I managed to do that on Heroku. Do I need a buildpack like vibe.d? Any help will be really appreciated. I've tried to create a vibe cartridge but cannot because of memory limitati

Re: Range of uncopyable elements

2016-12-08 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, December 08, 2016 20:21:41 Jerry via Digitalmars-d-learn wrote: > Assuming that is wrong though, as you aren't copying an iterator > or range you are copying the actual value. What you are confusing > "auto h = r.front;" for is this: "auto rcopy = r;". The D code > "auto h = r.front" i

Re: @property

2016-12-08 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, December 08, 2016 16:54:57 Adam D. Ruppe via Digitalmars-d- learn wrote: > On Thursday, 8 December 2016 at 16:53:13 UTC, Satoshi wrote: > > is there any advantage of marking function as @property?? > > Not really. I think it just changes the meaning of > typeof(thatfunc) but otherwise

Re: @property

2016-12-08 Thread ArturG via Digitalmars-d-learn
On Thursday, 8 December 2016 at 16:54:57 UTC, Adam D. Ruppe wrote: On Thursday, 8 December 2016 at 16:53:13 UTC, Satoshi wrote: is there any advantage of marking function as @property?? Not really. I think it just changes the meaning of typeof(thatfunc) but otherwise it does nothing. Howeve

Re: Range of uncopyable elements

2016-12-08 Thread Jerry via Digitalmars-d-learn
On Thursday, 8 December 2016 at 21:46:26 UTC, Jonathan M Davis wrote: However, at least as of C++98, non-copyable elements in a container were not allowed IIRC, so it would have been pretty rare to have a C++ iterator that returned a non-copyable value when you dereferenced it. Even if it was u

Re: @property

2016-12-08 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, December 08, 2016 22:11:22 ArturG via Digitalmars-d-learn wrote: > On Thursday, 8 December 2016 at 16:54:57 UTC, Adam D. Ruppe wrote: > > On Thursday, 8 December 2016 at 16:53:13 UTC, Satoshi wrote: > >> is there any advantage of marking function as @property?? > > > > Not really. I t

Re: Range of uncopyable elements

2016-12-08 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, December 08, 2016 22:32:47 Jerry via Digitalmars-d-learn wrote: > On Thursday, 8 December 2016 at 21:46:26 UTC, Jonathan M Davis > > wrote: > > However, at least as of C++98, non-copyable elements in a > > container were not allowed IIRC, so it would have been pretty > > rare to have a

Re: @property

2016-12-08 Thread ArturG via Digitalmars-d-learn
On Thursday, 8 December 2016 at 22:46:32 UTC, Jonathan M Davis wrote: On Thursday, December 08, 2016 22:11:22 ArturG via Digitalmars-d-learn wrote: On Thursday, 8 December 2016 at 16:54:57 UTC, Adam D. Ruppe wrote: > On Thursday, 8 December 2016 at 16:53:13 UTC, Satoshi wrote: >> is there any a

Re: template library like Jinja

2016-12-08 Thread Brian via Digitalmars-d-learn
On Wednesday, 21 November 2012 at 20:56:04 UTC, Masahiro Nakagawa wrote: On Tuesday, 20 November 2012 at 11:38:46 UTC, Tobias Pankrath wrote: Is there any template library like Jinja? (jinja.pocoo.org). I'm pretty sure we can do even better by leveraging CTFE and a precompiler, but speed is no