Re: Solving the impossible?

2018-08-28 Thread bauss via Digitalmars-d-learn
On Sunday, 26 August 2018 at 02:26:58 UTC, Everlast wrote: in fact, I'd rather see void print(T)(T t, int... a) You were actually close. void print(T)(T t, int[] a ...);

Re: Pass Socket to new thread

2018-08-28 Thread bauss via Digitalmars-d-learn
On Tuesday, 28 August 2018 at 10:48:20 UTC, Ivo wrote: I'm writing a basic server program and I want to handle each connection received in a new thread. So here is the code I'm trying to produce: while(true) { auto client = socket.accept(); spawn(&handleConnection , client); } void ha

Re: D need an ORM library!

2018-08-22 Thread bauss via Digitalmars-d-learn
On Wednesday, 22 August 2018 at 06:14:40 UTC, binghoo dang wrote: On Tuesday, 21 August 2018 at 10:48:30 UTC, bauss wrote: Currently (When I get time again) working on implementing PostgreSQL and Sqlite support for Diamond. Mysql and Mssql should work out the box. https://github.com/DiamondM

Re: D need an ORM library!

2018-08-22 Thread bauss via Digitalmars-d-learn
On Wednesday, 22 August 2018 at 09:33:26 UTC, bauss wrote: I would suggest Accidentally pressed "Send", but as I was saying. I would suggest https://github.com/buggins/hibernated as an alternative.

Re: D need an ORM library!

2018-08-21 Thread bauss via Digitalmars-d-learn
On Monday, 20 August 2018 at 02:30:16 UTC, binghoo dang wrote: hi, I thinks D need an ORM library for Sqlite/Mysql/PostgreSQL, entity currently support all the three targets, but entity's API is too complex and cumbersome for using. Is there a more light-weight and simpler implementation lik

Re: dtoh

2018-08-07 Thread bauss via Digitalmars-d-learn
On Tuesday, 7 August 2018 at 12:46:31 UTC, Steven Schveighoffer wrote: On 8/7/18 6:08 AM, bauss wrote: On Monday, 6 August 2018 at 13:28:05 UTC, Laeeth Isharc wrote: Hi Walter. Can dtoh be open-sourced now that dmd is? https://github.com/adamdruppe/dtoh I might be confused, but it seems l

Re: dtoh

2018-08-07 Thread bauss via Digitalmars-d-learn
On Monday, 6 August 2018 at 13:28:05 UTC, Laeeth Isharc wrote: Hi Walter. Can dtoh be open-sourced now that dmd is? Laeeth. https://github.com/adamdruppe/dtoh I might be confused, but it seems like it is there.

Re: @safe - why does this compile?

2018-07-13 Thread bauss via Digitalmars-d-learn
On Friday, 13 July 2018 at 11:04:40 UTC, Piotr Mitana wrote: This code: import std.stdio; class X1 {} class X2 : X1 { void run() @safe { writeln("DONE"); } } void main() @safe { X1 x1 = new X1; X2 x2 = cast(X2) x1;

Re: Issues with undefined symbols when using Vibe on Windows

2018-07-02 Thread Bauss via Digitalmars-d-learn
On Monday, 2 July 2018 at 12:53:19 UTC, Chris M. wrote: On Friday, 29 June 2018 at 20:08:49 UTC, Chris M. wrote: On Friday, 29 June 2018 at 19:53:27 UTC, bauss wrote: On Friday, 29 June 2018 at 19:25:42 UTC, Chris M. wrote: [...] Are you compiling to 64bit? Else the functions will be named

Re: Issues with undefined symbols when using Vibe on Windows

2018-06-29 Thread bauss via Digitalmars-d-learn
On Friday, 29 June 2018 at 19:53:04 UTC, Timoses wrote: On Friday, 29 June 2018 at 19:25:42 UTC, Chris M. wrote: This doesn't appear to specifically be a Vibe issue, just noticing this error when I use eventcore from it (trying to use async). C:\dmd2\windows\bin\lld-link.exe: warning: eventc

Re: Issues with undefined symbols when using Vibe on Windows

2018-06-29 Thread bauss via Digitalmars-d-learn
On Friday, 29 June 2018 at 19:25:42 UTC, Chris M. wrote: This doesn't appear to specifically be a Vibe issue, just noticing this error when I use eventcore from it (trying to use async). C:\dmd2\windows\bin\lld-link.exe: warning: eventcore.lib(sockets_101f_952.obj): undefined symbol: SetWind

Re: High memory usage in vibe.d application

2018-06-29 Thread Bauss via Digitalmars-d-learn
On Friday, 29 June 2018 at 16:07:00 UTC, Anton Fediushin wrote: On Friday, 29 June 2018 at 11:11:57 UTC, rikki cattermole wrote: On 29/06/2018 11:09 PM, Anton Fediushin wrote: It is GC's fault for sure, I built my program with profile-gc and it allocated a lot there. Question is, why doesn't it

Re: High memory usage in vibe.d application

2018-06-29 Thread bauss via Digitalmars-d-learn
On Friday, 29 June 2018 at 11:24:14 UTC, Anton Fediushin wrote: On Friday, 29 June 2018 at 11:01:41 UTC, Anton Fediushin wrote: On Friday, 29 June 2018 at 10:21:24 UTC, Radu wrote: On Friday, 29 June 2018 at 09:44:27 UTC, Anton Fediushin wrote: Almost forgot, there are two timers which call thi

Re: High memory usage in vibe.d application

2018-06-29 Thread bauss via Digitalmars-d-learn
On Friday, 29 June 2018 at 10:21:24 UTC, Radu wrote: On Friday, 29 June 2018 at 09:44:27 UTC, Anton Fediushin wrote: Almost forgot, there are two timers which call this function for two different streams. Value of `metaint` is 16000, which means that only 16KB of memory are allocated for the

Re: Debugging compile time memory usage

2018-06-25 Thread Bauss via Digitalmars-d-learn
On Tuesday, 26 June 2018 at 00:59:24 UTC, Nicholas Wilson wrote: On Sunday, 24 June 2018 at 14:16:26 UTC, Kamil Koczurek wrote: [...] If you were able to compile it with LDC and not DMD, then that is most likely due to the LDC executable being 64-bit (limited to available system RAM+swaps) a

Re: Undo in D

2018-06-23 Thread bauss via Digitalmars-d-learn
On Saturday, 23 June 2018 at 01:58:31 UTC, DigitalDesigns wrote: Is there any idiomatic undo designs in D that give a more natural implementation than the standard techniques? There is the solution above, but there I've implemented something similar in Diamond. It's a little bit different co

Re: UCFS does not work for nested functions?

2018-06-18 Thread bauss via Digitalmars-d-learn
On Monday, 18 June 2018 at 17:16:29 UTC, aliak wrote: On Monday, 18 June 2018 at 14:19:30 UTC, Steven Schveighoffer wrote: On 6/18/18 7:16 AM, Bastiaan Veelo wrote: On Sunday, 18 May 2014 at 08:15:08 UTC, Steffen Wenz wrote: Hi, Just noticed that using UFCS does not work for nested functions

Re: typeof on protected field

2018-06-16 Thread bauss via Digitalmars-d-learn
On Saturday, 16 June 2018 at 08:32:38 UTC, DigitalDesigns wrote: mixin(`foo!(typeof(T.`~m~`)); gives me an error about m being protected. Error: class `X` member `name` is not accessible. this also happens when using __traits(getMember, T, m); X is in another module. Works fine when X is in t

Re: How do you test whether a variable is static or not?

2018-06-16 Thread Bauss via Digitalmars-d-learn
On Saturday, 16 June 2018 at 08:52:20 UTC, DigitalDesigns wrote: On Saturday, 30 July 2016 at 13:04:56 UTC, Ali Çehreli wrote: On 07/30/2016 05:47 AM, Jonathan M Davis via Digitalmars-d-learn wrote: > I'm writing some serialization code where I need to skip static variables. > So, I have a symb

Re: Get static fields!

2018-06-16 Thread Bauss via Digitalmars-d-learn
On Saturday, 16 June 2018 at 05:05:19 UTC, DigitalDesigns wrote: tupleof does not return static fields as does not Fields. Currently the only method seems to be use allMembers, but that returns members requiring filtering, which there is no good filtering checks. I'd simply like to get all the

Re: What is the point of nothrow?

2018-06-15 Thread bauss via Digitalmars-d-learn
On Friday, 15 June 2018 at 17:25:18 UTC, wjoe wrote: On Thursday, 14 June 2018 at 22:27:42 UTC, bauss wrote: On Thursday, 14 June 2018 at 19:06:07 UTC, Jonathan M Davis wrote: So in case of a thrown Error, you can catch it and log it to a database. No, you can't. Once the Error was thrown t

Re: What is the point of nothrow?

2018-06-15 Thread bauss via Digitalmars-d-learn
On Friday, 15 June 2018 at 17:27:13 UTC, bauss wrote: On Friday, 15 June 2018 at 17:25:18 UTC, wjoe wrote: On Thursday, 14 June 2018 at 22:27:42 UTC, bauss wrote: On Thursday, 14 June 2018 at 19:06:07 UTC, Jonathan M Davis wrote: So in case of a thrown Error, you can catch it and log it to a d

Re: comparing nullables

2018-06-15 Thread bauss via Digitalmars-d-learn
On Friday, 15 June 2018 at 15:00:38 UTC, Alex wrote: Hi all, do you see any valid reason why the last line yields an error: import std.typecons; void main() { void* ptr1; void* ptr2; assert(ptr1 is null); assert(ptr2 is null); assert(ptr1 == ptr2);

Re: What is the point of nothrow?

2018-06-14 Thread bauss via Digitalmars-d-learn
On Thursday, 14 June 2018 at 19:06:07 UTC, Jonathan M Davis wrote: As I said, personally, I think that the program shut just print and terminate rather than throwing an Error. Walter seems to It makes perfectly sense for it to throw an error and not just print and terminate. This is especial

Re: Pass arguments at compile time

2018-06-13 Thread bauss via Digitalmars-d-learn
On Wednesday, 13 June 2018 at 10:57:27 UTC, Malte wrote: I want to import a config file at compile time, but also need a way to have multiple configurations. With gcc you could do something like -DIMPORTFROM='"MyConfigFile.txt"'. Is there any equivalent in D? Hardcoding the config files for

Re: class X has forward references

2018-06-12 Thread bauss via Digitalmars-d-learn
On Tuesday, 12 June 2018 at 20:30:22 UTC, Steven Schveighoffer wrote: On 6/12/18 4:14 PM, bauss wrote: What could cause that error? I cannot find anything in the documentation nor does the error message itself give much information. A forward reference that can't be figured out by the compil

class X has forward references

2018-06-12 Thread bauss via Digitalmars-d-learn
What could cause that error? I cannot find anything in the documentation nor does the error message itself give much information. I can't really give a good example, but I can tell as much as I have a few inheritances of classes using templates. I just don't think that would be the issue.

Re: What is the point of nothrow?

2018-06-12 Thread Bauss via Digitalmars-d-learn
On Tuesday, 12 June 2018 at 14:19:42 UTC, Steven Schveighoffer wrote: On 6/10/18 7:59 PM, Bauss wrote: What is the point of nothrow if it can only detect when Exception is thrown and not when Error is thrown? It seems like the attribute is useless because you can't really use it as protection

Re: Is there a better way to do this? (Using class at compile-time)

2018-06-12 Thread bauss via Digitalmars-d-learn
On Tuesday, 12 June 2018 at 11:18:00 UTC, Simen Kjærås wrote: On Tuesday, 12 June 2018 at 11:04:40 UTC, bauss wrote: [snip] void test(T)() { pragma(msg, (getBar!T).baz()); pragma(msg, (getBar!T).helloworld()); import std.stdio; mixin((getBar!T).baz()); mixin((getBar!T).hell

Is there a better way to do this? (Using class at compile-time)

2018-06-12 Thread bauss via Digitalmars-d-learn
Let's say I have something like the following: abstract class Foo { abstract string baz(); abstract string helloworld(); } final class Bar(T) : Foo { override string baz() { return "writeln(\"Hello " ~ T.stringof ~ "!\");"; } override string helloworld() { return "writeln(\"Hell

Re: What is the point of nothrow?

2018-06-10 Thread Bauss via Digitalmars-d-learn
On Monday, 11 June 2018 at 00:47:27 UTC, Jonathan M Davis wrote: On Sunday, June 10, 2018 23:59:17 Bauss via Digitalmars-d-learn wrote: What is the point of nothrow if it can only detect when Exception is thrown and not when Error is thrown? It seems like the attribute is useless because you

What is the point of nothrow?

2018-06-10 Thread Bauss via Digitalmars-d-learn
What is the point of nothrow if it can only detect when Exception is thrown and not when Error is thrown? It seems like the attribute is useless because you can't really use it as protection to write bugless, safe code since the nasty bugs will pass by just fine. I'm aware that it's a featur

Re: WTF! new in class is static?!?!

2018-06-10 Thread Bauss via Digitalmars-d-learn
On Sunday, 10 June 2018 at 02:34:11 UTC, KingJoffrey wrote: On Sunday, 10 June 2018 at 01:27:50 UTC, bauss wrote: On Saturday, 9 June 2018 at 12:40:07 UTC, RealProgrammer wrote: maybe you and others in the D 'community' should start paying attention to the 'opinions' of those who do professiona

Re: WTF! new in class is static?!?!

2018-06-09 Thread bauss via Digitalmars-d-learn
On Saturday, 9 June 2018 at 12:40:07 UTC, RealProgrammer wrote: maybe you and others in the D 'community' should start paying attention to the 'opinions' of those who do professional development with professional compilers. I do professional work with a professional compiler aka. The D compil

Re: WTF! new in class is static?!?!

2018-06-09 Thread bauss via Digitalmars-d-learn
On Saturday, 9 June 2018 at 09:24:48 UTC, KingJoffrey wrote: On Thursday, 7 June 2018 at 21:57:17 UTC, Steven Schveighoffer wrote: Yep, long-standing issue: https://issues.dlang.org/show_bug.cgi?id=2947 Almost a decade old! -Steve Another reason why I still refuse to bring my code to D.

Re: question about keeeping reference to toStringz()

2018-05-31 Thread bauss via Digitalmars-d-learn
On Thursday, 31 May 2018 at 02:10:53 UTC, Mike Parker wrote: On Thursday, 31 May 2018 at 01:12:34 UTC, Dr.No wrote: is foo() is being called from a thread, how I am supposed to keep cstring "alive"? As Jonathan explained, you don't have to worry about it if foo() itself doesn't assign the

Re: What is special about an immutable array of class objects, and why can I not .dup ?

2018-05-28 Thread bauss via Digitalmars-d-learn
On Monday, 28 May 2018 at 13:51:49 UTC, James Blachly wrote: Consider the below: ``` class C { int x; } struct S { int x; } void main() { immutable C[] c = [ new C(), new C()]; immutable S[] s = [ S(), S() ]; immutable int[] i = [ 1, 2 ]; auto x = c.dup; a

Re: Deleting a file with extsion *.FIFO in Windows

2018-05-24 Thread bauss via Digitalmars-d-learn
On Thursday, 24 May 2018 at 06:59:47 UTC, Vino wrote: Hi All, Request your help on how to delete a file which has the extension .fifo (.javast.fifo) in Windows. From, Vino.B What exactly is your issue with it?

Re: UDA and static struct fields

2018-05-24 Thread bauss via Digitalmars-d-learn
On Thursday, 24 May 2018 at 10:42:26 UTC, Andrea Fontana wrote: On Thursday, 24 May 2018 at 10:23:41 UTC, Andrea Fontana wrote: On Thursday, 24 May 2018 at 09:17:10 UTC, Alex wrote: On Thursday, 24 May 2018 at 08:48:30 UTC, Andrea Fontana wrote: This line: mixin("alias tmp = " ~ s ~ ";

Re: Why The D Style constants are written in camelCase?

2018-05-09 Thread bauss via Digitalmars-d-learn
On Wednesday, 9 May 2018 at 09:38:14 UTC, BoQsc wrote: The D Style suggest to camelCase constants, while Java naming conventions always promoted uppercase letter. Is there an explanation why D Style chose to use camelCase instead of all UPPERCASE for constants, was there any technical problem

Re: Why The D Style constants are written in camelCase?

2018-05-09 Thread bauss via Digitalmars-d-learn
On Wednesday, 9 May 2018 at 09:51:37 UTC, bauss wrote: Just because. To add on to this. D is not Java, it's not C++, it's not C# etc. D is D and D has its own conventions. You're free to write your constants in all uppercase if you want. I guess if I should come up with an actual reason the

Re: Is HibernateD dead?

2018-05-08 Thread bauss via Digitalmars-d-learn
On Tuesday, 8 May 2018 at 07:28:31 UTC, Vadim Lopatin wrote: On Monday, 7 May 2018 at 17:27:17 UTC, Jesse Phillips wrote: You should get a hold of Vadim Lopatin and see if he would give you commit rights to the main repo. There was a great article I can't find by someone who would add contrib

Re: Is HibernateD dead?

2018-05-07 Thread Bauss via Digitalmars-d-learn
On Monday, 7 May 2018 at 18:15:17 UTC, Matthias Klumpp wrote: On Monday, 7 May 2018 at 08:26:15 UTC, bauss wrote: On Monday, 7 May 2018 at 06:12:19 UTC, Vadim Lopatin wrote: On Thursday, 3 May 2018 at 20:49:35 UTC, Matthias Klumpp wrote: On Thursday, 3 May 2018 at 18:52:34 UTC, singingbush wro

Re: Is HibernateD dead?

2018-05-07 Thread bauss via Digitalmars-d-learn
On Monday, 7 May 2018 at 06:12:19 UTC, Vadim Lopatin wrote: On Thursday, 3 May 2018 at 20:49:35 UTC, Matthias Klumpp wrote: On Thursday, 3 May 2018 at 18:52:34 UTC, singingbush wrote: On Thursday, 3 May 2018 at 10:27:47 UTC, Pasqui23 wrote: Last commit on https://github.com/buggins/hibernated

Re: Error: module `hello` is in file 'hello.d' which cannot be read

2018-05-05 Thread Bauss via Digitalmars-d-learn
On Friday, 4 May 2018 at 23:29:12 UTC, Alex wrote: Hi I just installed D on my windows 10 and want to try to compile a hello world. My source is a classical import std.stdio; void main() { writeln("Hello, World!"); } And I try to compile and get C:\D>dmd hello.d Error: module `hello` is in

Re: Is HibernateD dead?

2018-05-05 Thread Bauss via Digitalmars-d-learn
On Friday, 4 May 2018 at 19:54:46 UTC, Matthias Klumpp wrote: I've written an email to Vadim, maybe we get a reply on the status of both projects. On Friday, 4 May 2018 at 07:18:09 UTC, bauss wrote: [...] Would it maybe be easier for you to base on ddbc[1] or another existing abstraction lay

Re: Is HibernateD dead?

2018-05-04 Thread bauss via Digitalmars-d-learn
On Thursday, 3 May 2018 at 23:05:02 UTC, Matthias Klumpp wrote: On Thursday, 3 May 2018 at 21:28:18 UTC, bauss wrote: On Thursday, 3 May 2018 at 18:01:07 UTC, Matthias Klumpp wrote: DiamondMVC looks nice, but I would need PostgreSQL support for sure. Therefore, I think there are three options:

Re: Is HibernateD dead?

2018-05-03 Thread bauss via Digitalmars-d-learn
On Thursday, 3 May 2018 at 18:01:07 UTC, Matthias Klumpp wrote: DiamondMVC looks nice, but I would need PostgreSQL support for sure. Therefore, I think there are three options: 1) Extend the DiamondMVC ORM to support missing features that Hibernated has (maybe make it use ddbc as backend?) 2)

Re: Ambiguous template parameter names

2018-05-03 Thread bauss via Digitalmars-d-learn
On Thursday, 3 May 2018 at 02:51:18 UTC, Meta wrote: If you want that, you might be able to do `int val = val` on the inner function, though I'm not sure that'll work. It does not work and will do nothing.

Re: Is HibernateD dead?

2018-05-03 Thread bauss via Digitalmars-d-learn
On Thursday, 3 May 2018 at 11:00:36 UTC, bauss wrote: On Thursday, 3 May 2018 at 10:27:47 UTC, Pasqui23 wrote: That is if you want to use something that isn't "dead"

Re: Is HibernateD dead?

2018-05-03 Thread bauss via Digitalmars-d-learn
On Thursday, 3 May 2018 at 10:27:47 UTC, Pasqui23 wrote: Last commit on https://github.com/buggins/hibernated was almost a year ago So what is the status of HibernateD?Should I use it if I need an ORM? Or would I risk unpatched security risks? Although currently only mysql/mariadb support, th

Thread-safe cache

2018-05-02 Thread bauss via Digitalmars-d-learn
What would the most performent way to create a thread-safe cache that can be used across threads/fibers in D? Lock-free as much as possible. What I ultimately want to do is to cache some data I pull from a database (Or elsewhere for that matter) and then cache it somewhere, so I can avoid hav

Re: readonly member (but assignable at constructor time)

2018-04-30 Thread bauss via Digitalmars-d-learn
On Monday, 30 April 2018 at 10:57:51 UTC, Jonathan M Davis wrote: On Monday, April 30, 2018 10:36:52 bauss via Digitalmars-d-learn wrote: On Saturday, 28 April 2018 at 04:56:26 UTC, lempiji wrote: > On Friday, 27 April 2018 at 02:59:16 UTC, Dr.No wrote: >> In C# you can have a readon

Re: readonly member (but assignable at constructor time)

2018-04-30 Thread bauss via Digitalmars-d-learn
On Saturday, 28 April 2018 at 04:56:26 UTC, lempiji wrote: On Friday, 27 April 2018 at 02:59:16 UTC, Dr.No wrote: In C# you can have a readonly member assignable either at declaration or constructor time, like this: class C { readonly myClass mc; this() { mc = new myClass(); }

Re: Idiomatic way to add examples to dub package

2018-04-28 Thread bauss via Digitalmars-d-learn
On Saturday, 28 April 2018 at 15:11:31 UTC, FreeSlave wrote: On Friday, 27 April 2018 at 12:37:04 UTC, Basile B. wrote: On Thursday, 26 April 2018 at 18:16:01 UTC, FreeSlave wrote: Most dub packages are libraries and should provide runnable examples. What's the current idiomatic way to add exa

Re: Are Fibers just broken in D?

2018-04-24 Thread bauss via Digitalmars-d-learn
On Tuesday, 24 April 2018 at 07:58:01 UTC, Radu wrote: On Tuesday, 24 April 2018 at 00:46:39 UTC, Byron Heads wrote: On Friday, 20 April 2018 at 20:52:17 UTC, Byron Moxie wrote: On Friday, 20 April 2018 at 20:46:20 UTC, Steven Schveighoffer wrote: On 4/20/18 2:58 PM, Byron Moxie wrote: [...]

Re: Assoc. Array and struct with immutable member

2018-04-17 Thread bauss via Digitalmars-d-learn
On Sunday, 15 April 2018 at 18:51:52 UTC, Alex wrote: On Sunday, 15 April 2018 at 17:59:01 UTC, Dgame wrote: How am I supposed to insert a struct with immutable members into an assoc. array? Reduced example: struct A { immutable string name; } A[string] as; as["a"] = A("a"); // Does

Re: Delegates and classes for custom code.

2018-04-17 Thread bauss via Digitalmars-d-learn
On Tuesday, 17 April 2018 at 03:55:55 UTC, Chris Katko wrote: What I want: class viewport_t { int x,y,w,h; } class dialog_t { int x,y; this( int x, int y, delegate void (viewport_t) on_draw ) { this.x = x; this.y = y; this.execute = execute; } void draw_text(

Re: Why is the error message coming by the end of the compilation?

2018-04-15 Thread bauss via Digitalmars-d-learn
On Sunday, 15 April 2018 at 16:55:36 UTC, bauss wrote: On Sunday, 15 April 2018 at 15:55:15 UTC, ag0aep6g wrote: On 04/15/2018 05:33 PM, bauss wrote: On Sunday, 15 April 2018 at 10:27:26 UTC, ag0aep6g wrote: On 04/14/2018 08:56 PM, bauss wrote: I wish there was a way to give a mixin some kind

Re: Why is the error message coming by the end of the compilation?

2018-04-15 Thread bauss via Digitalmars-d-learn
On Sunday, 15 April 2018 at 15:55:15 UTC, ag0aep6g wrote: On 04/15/2018 05:33 PM, bauss wrote: On Sunday, 15 April 2018 at 10:27:26 UTC, ag0aep6g wrote: On 04/14/2018 08:56 PM, bauss wrote: I wish there was a way to give a mixin some kind of identity like: mixin("mymixin", "somecode"); Wher

Re: Why is the error message coming by the end of the compilation?

2018-04-15 Thread bauss via Digitalmars-d-learn
On Sunday, 15 April 2018 at 10:14:56 UTC, Simen Kjærås wrote: On Saturday, 14 April 2018 at 08:20:51 UTC, bauss wrote: The problem is I can't pragma(msg) the code I want to mixin manually since all mixins are dynamically generated. That's why my only way is to do it within that static foreach.

Re: Why is the error message coming by the end of the compilation?

2018-04-14 Thread bauss via Digitalmars-d-learn
On Saturday, 14 April 2018 at 17:58:20 UTC, Steven Schveighoffer wrote: On 4/14/18 4:16 AM, bauss wrote: I tried to use __traits(compiles) but it always returns false for the code I'm going to mixin, even though it's valid, that was my initial go to, so this is really a second attempt on som

Re: Why is the error message coming by the end of the compilation?

2018-04-14 Thread bauss via Digitalmars-d-learn
On Friday, 13 April 2018 at 21:20:26 UTC, Ikeran wrote: On Friday, 13 April 2018 at 20:50:38 UTC, bauss wrote: What I'm doing is basically this: static foreach (viewResult; generateViewsResult) { pragma(msg, "Compiling: " ~ viewResult.name); mixin(viewResult.source); pr

Re: Why is the error message coming by the end of the compilation?

2018-04-14 Thread bauss via Digitalmars-d-learn
On Friday, 13 April 2018 at 21:22:13 UTC, Steven Schveighoffer wrote: On 4/13/18 4:50 PM, bauss wrote: I can't seem to reproduce this with any other smaller projects, so my question is really what could trigger this behavior. See: https://i.imgur.com/OmqJ8Sr.png Whenever I try to just do thi

Why is the error message coming by the end of the compilation?

2018-04-13 Thread bauss via Digitalmars-d-learn
I can't seem to reproduce this with any other smaller projects, so my question is really what could trigger this behavior. See: https://i.imgur.com/OmqJ8Sr.png Whenever I try to just do this kind of thing by itself then it behaves correctly. Ex: (As you can see it prints the error messages i

Re: Why is the error message coming by the end of the compilation?

2018-04-13 Thread bauss via Digitalmars-d-learn
On Friday, 13 April 2018 at 20:50:38 UTC, bauss wrote: https://run.dlang.io/ Sorry posted wrong link for run.dlang.io. https://run.dlang.io/is/HQlbgv

Re: how to set up libuid on wondows 10

2018-04-04 Thread bauss via Digitalmars-d-learn
On Wednesday, 4 April 2018 at 19:10:33 UTC, greatsam4sure wrote: I am have problem setting up libuid on windows 10. These are the errors thus far: [...] How do you call the compiler? Make sure you pass all the libraries etc. to dmd when you compile.

Re: Why toUTF8 not accept wchar[] as argument?

2018-04-02 Thread bauss via Digitalmars-d-learn
On Tuesday, 3 April 2018 at 02:46:51 UTC, Domain wrote: On Tuesday, 3 April 2018 at 02:31:15 UTC, Uknown wrote: On Tuesday, 3 April 2018 at 02:24:08 UTC, Domain wrote: wchar[10] buffer; toUTF8(buffer); Error: template `std.utf.toUTF8` cannot deduce function from argument types `!()(wchar[10])

Re: vibe.d & nginx

2018-03-28 Thread bauss via Digitalmars-d-learn
On Wednesday, 28 March 2018 at 20:34:52 UTC, Adam D. Ruppe wrote: On Wednesday, 28 March 2018 at 19:42:24 UTC, bauss wrote: Can I just create multiple server sections in the config, even on the same port? Or is there something I have to be aware of? Multiple nginx configs can live on the same

Re: vibe.d & nginx

2018-03-28 Thread bauss via Digitalmars-d-learn
On Wednesday, 28 March 2018 at 19:42:24 UTC, bauss wrote: I know how to setup nginx to a single vibe.d application, but what if I host multiple vibe.d applications on the same host. How can I forward them using nginx correctly? Can I just create multiple server sections in the config, even on

vibe.d & nginx

2018-03-28 Thread bauss via Digitalmars-d-learn
I know how to setup nginx to a single vibe.d application, but what if I host multiple vibe.d applications on the same host. How can I forward them using nginx correctly? Can I just create multiple server sections in the config, even on the same port? Or is there something I have to be aware of

Re: get classname in static member

2018-03-28 Thread bauss via Digitalmars-d-learn
On Wednesday, 28 March 2018 at 09:44:35 UTC, number wrote: And could somebody explain to me why 'typeid(this).stringof' is returning 'typeid(this)'? stringof will return a string equivalent to the expression or symbol's representation, not its definition. Meaning: (212 + 221).stringof == "2

Re: Is there something special required to use Appender.clear

2018-03-27 Thread bauss via Digitalmars-d-learn
On Tuesday, 27 March 2018 at 12:17:58 UTC, Ellie Harper wrote: Sorry if this is a stupid question, but is there something special required to call Appender.clear? When I attempt even just a simple use I am getting compile errors relating to `template object.clear`. When I try: import st

Re: "in" no longer "scope" since 2.079.0?

2018-03-27 Thread bauss via Digitalmars-d-learn
On Tuesday, 27 March 2018 at 11:24:01 UTC, Jonathan M Davis wrote: On Tuesday, March 27, 2018 09:58:11 bauss via Digitalmars-d-learn wrote: On Tuesday, 27 March 2018 at 09:27:07 UTC, Jonathan M Davis wrote: > On Tuesday, March 27, 2018 09:15:43 Boris-Barboris via > > Digitalmars-d-le

Re: "in" no longer "scope" since 2.079.0?

2018-03-27 Thread bauss via Digitalmars-d-learn
On Tuesday, 27 March 2018 at 09:27:07 UTC, Jonathan M Davis wrote: On Tuesday, March 27, 2018 09:15:43 Boris-Barboris via Digitalmars-d-learn wrote: Hello! Can someone point me to the changelong entry or maybe a pull request, wich changed the "in" from "scope const" to "const"? I thought the pr

Re: Truly automatic benchmarking

2018-03-27 Thread bauss via Digitalmars-d-learn
On Tuesday, 27 March 2018 at 08:18:43 UTC, Nordlöw wrote: Have anybody implemented anything near the expressiveness and ease of use of Rust's builtin benchmarking features https://doc.rust-lang.org/1.16.0/book/benchmark-tests.html I'm mostly interested in completely automatic printing of resu

Re: importPaths option in dub

2018-03-27 Thread bauss via Digitalmars-d-learn
On Tuesday, 27 March 2018 at 06:34:29 UTC, ANtlord wrote: Hello! I work using Linux. Is it possible to use environment variables like $HOME in option importPaths of Dub project file? I tried it but dub concatenates the path and current path so I get something like this /develop/project/$HOME/

Re: Is socket.send thread safe?

2018-03-26 Thread bauss via Digitalmars-d-learn
On Monday, 26 March 2018 at 16:14:31 UTC, Jonathan wrote: Can I send data over an std.socket on multiple threads without manual mutexing? If not, can I send data on a separate thread than receive? The docs for std.socket say nothing of it (which I guess means I should assume it is not thread

Re: Slow start up time of runtime

2018-03-20 Thread bauss via Digitalmars-d-learn
On Tuesday, 20 March 2018 at 10:46:11 UTC, Dennis wrote: On Tuesday, 20 March 2018 at 10:20:55 UTC, Dennis wrote: On Tuesday, 20 March 2018 at 09:51:09 UTC, bauss wrote: Besides if it was and it took 1 second to startup, then it wouldn't matter in practice with an actual application. This is

Re: Slow start up time of runtime

2018-03-20 Thread bauss via Digitalmars-d-learn
On Tuesday, 20 March 2018 at 12:07:12 UTC, bauss wrote: On Tuesday, 20 March 2018 at 10:46:11 UTC, Dennis wrote: On Tuesday, 20 March 2018 at 10:20:55 UTC, Dennis wrote: On Tuesday, 20 March 2018 at 09:51:09 UTC, bauss wrote: Besides if it was and it took 1 second to startup, then it wouldn't

Re: Slow start up time of runtime

2018-03-20 Thread bauss via Digitalmars-d-learn
On Tuesday, 20 March 2018 at 09:44:41 UTC, Dennis wrote: Simply running a "hello world.exe" takes, on my pc: 1.12s When compiled with dmd 0.62s When compiled with ldc 0.05s When compiled with dmc (C program) or dmd/ldc as a -betterC program I suppose initializing the runtime takes a lot of ti

Re: how to make private class member private

2018-03-19 Thread bauss via Digitalmars-d-learn
On Monday, 19 March 2018 at 01:11:43 UTC, psychoticRabbit wrote: The fact that the creator of a class, is also the creator of the module that contains that class, is not a valid reason for not seeking to improve encapsulation of that class. I agree with this. This especially matters with proje

Re: how to make private class member private

2018-03-18 Thread bauss via Digitalmars-d-learn
On Saturday, 17 March 2018 at 23:54:22 UTC, psychoticRabbit wrote: In D, I would prefer no breaking change here. Leave private as it is. My suggestion has no breaking change and it works just like the package attribute already works. Also you shouldn't allow multiple types for it, that would

Re: Can't add ubytes together to make a ubyte... bug or feature?

2018-03-17 Thread bauss via Digitalmars-d-learn
On Saturday, 17 March 2018 at 18:56:55 UTC, Dominikus Dittes Scherkl wrote: On Saturday, 17 March 2018 at 18:36:35 UTC, Jonathan wrote: On Tuesday, 19 January 2016 at 23:36:14 UTC, Adam D. Ruppe wrote: On Tuesday, 19 January 2016 at 22:12:06 UTC, Soviet Friend wrote: I don't care if my computer

Re: how to make private class member private

2018-03-17 Thread bauss via Digitalmars-d-learn
On Saturday, 17 March 2018 at 15:02:21 UTC, psychoticRabbit wrote: On Saturday, 17 March 2018 at 14:16:19 UTC, bauss wrote: I don't like the name @deny . how about: @reallyis private string firstName_; mmm..perhaps not... then how about... @strictly private string firstName_; Still i

Re: how to make private class member private

2018-03-17 Thread bauss via Digitalmars-d-learn
On Saturday, 17 March 2018 at 11:08:27 UTC, psychoticRabbit wrote: On Saturday, 17 March 2018 at 09:18:13 UTC, Nick Treleaven wrote: It's a language design decision as to whether a particular feature is worth supporting. I would like this feature too though. I'm not sure how much compiler compl

Re: Is there any web browser control in D Lang to display html file ?

2018-03-16 Thread bauss via Digitalmars-d-learn
On Friday, 16 March 2018 at 11:04:31 UTC, Jayam wrote: On Friday, 16 March 2018 at 10:53:39 UTC, bauss wrote: On Friday, 16 March 2018 at 10:52:14 UTC, Alex wrote: On Friday, 16 March 2018 at 10:31:51 UTC, Jayam wrote: I creating one simple desktop application using dlang. I need to display so

Re: Is there any web browser control in D Lang to display html file ?

2018-03-16 Thread bauss via Digitalmars-d-learn
On Friday, 16 March 2018 at 10:52:14 UTC, Alex wrote: On Friday, 16 March 2018 at 10:31:51 UTC, Jayam wrote: I creating one simple desktop application using dlang. I need to display some html file in my desktop application. How can make it works ? Do you mean something like this? http://vibed

Re: How to simplify nested ifs

2018-03-16 Thread bauss via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 12:23:06 UTC, Ozan Süel wrote: Hi I have a construction like the following if (source) { if (source.pool) { if (source.pool.repository) { if (source.pool.repository.directory) { if (source.pool.repository.directory.users) { // do someth

Re: How to simplify nested ifs

2018-03-16 Thread bauss via Digitalmars-d-learn
On Friday, 16 March 2018 at 09:34:38 UTC, Satoshi wrote: null conditional operators are not implemented in D because, as a (I think Walter) said, D is not language designed to work with classes or advanced OOP stuff. Nobody uses it, so please, if you are using it, stop and use structs and meta

Re: VsCode tutorial

2018-03-08 Thread bauss via Digitalmars-d-learn
On Wednesday, 7 March 2018 at 21:39:09 UTC, Apocalypto wrote: Are there any tutorials about D in vscode? Which are the minimal plugins to install to have code completion, syntax highlighting and code formatting? Are there any app templates that i can invoke to not start every project from sc

Re: How to use globals correctly?

2018-03-06 Thread bauss via Digitalmars-d-learn
On Monday, 5 March 2018 at 19:51:33 UTC, Steven Schveighoffer wrote: On 3/5/18 2:25 PM, Marc wrote: Can __gshared be used instead of static in the singleton pattern? I, comming from C++, ignorantly, have never used _gshared so I went to static instead of (being static also means thread-safe,

Re: Speed of math function atan: comparison D and C++

2018-03-05 Thread bauss via Digitalmars-d-learn
On Monday, 5 March 2018 at 18:39:21 UTC, J-S Caux wrote: But now comes the question: can the D fundamental maths functions be propped up to be as fast as the C ones? Probably, if someone takes the time to look at the bottlenecks.

Re: How to use globals correctly?

2018-03-05 Thread bauss via Digitalmars-d-learn
On Monday, 5 March 2018 at 19:39:35 UTC, Robert M. Münch wrote: On 2018-03-05 18:57:01 +, Steven Schveighoffer said: If you want to have methods, shared kind of sucks. But this at least tells the type system that it's shared between threads. Why does it suck? Because your code will becom

Re: Get function argument name?

2018-03-04 Thread bauss via Digitalmars-d-learn
On Sunday, 4 March 2018 at 21:48:53 UTC, JN wrote: On Sunday, 4 March 2018 at 21:12:44 UTC, arturg wrote: you can pass it by alias: import std.stdio; void main(string[] args) { int x; printName!(x); } void printName(alias var)() { writeln(__traits(identifier, var), " ", var); }

Re: What's the proper way to add a local file dependence to dub?

2018-03-04 Thread bauss via Digitalmars-d-learn
On Sunday, 4 March 2018 at 16:46:56 UTC, Marc wrote: then copy it to sources folder? let's say I have a small library folder at C:\mylibrary\D where I want to use dir.d from it. How do I add that file dependence to dub? But I do not want to that file be passed directly to dmd, I want to that

Re: Fastest way to zero a slice of memory

2018-03-04 Thread bauss via Digitalmars-d-learn
On Sunday, 4 March 2018 at 15:23:41 UTC, Nordlöw wrote: When zeroing a slice of memory (either stack or heap) such as enum n = 100; ubyte[n] chunk; should I use `memset` such as memset(chunk.ptr, 0, n/2); // zero first half or an array assignment such as chunk[0 .. n/2] = 0;

Re: Template Class With Default Values

2018-03-04 Thread bauss via Digitalmars-d-learn
On Sunday, 4 March 2018 at 11:59:52 UTC, Mike Parker wrote: On Sunday, 4 March 2018 at 11:35:23 UTC, bauss wrote: Why is the following not working? class Foo(string baz = "baz") { mixin("int " ~ baz ~ ";"); } class Bar : Foo { } Shouldn't it implicit do, without me having to do it manuall

Re: Template Class With Default Values

2018-03-04 Thread bauss via Digitalmars-d-learn
On Sunday, 4 March 2018 at 11:57:12 UTC, Jonathan M Davis wrote: On Sunday, March 04, 2018 11:35:23 bauss via Digitalmars-d-learn wrote: Why is the following not working? class Foo(string baz = "baz") { mixin("int " ~ baz ~ ";"); } class Bar : Foo { } Sho

Template Class With Default Values

2018-03-04 Thread bauss via Digitalmars-d-learn
Why is the following not working? class Foo(string baz = "baz") { mixin("int " ~ baz ~ ";"); } class Bar : Foo { } Shouldn't it implicit do, without me having to do it manually? class Bar : Foo!"baz" { } ... What's the reason you can't specify default values for template parameters on a

<    1   2   3   4   5   6   >