Re: Down the VisualD0.3.38-1.exe ,found virus!

2014-05-08 Thread sigod via Digitalmars-d-learn
On Friday, 9 May 2014 at 01:02:39 UTC, FrankLike wrote: Hi,everyone, down VisulaD from http://rainers.github.io/visuald/visuald/StartPage.html found the virus:Win32.Troj.Undef.(kcloud) Why? Frank https://www.virustotal.com/en/file/bbd76ddb41a80f0526f6cf1e37a2db2736cfa8f29ed3f5fd7a4336bf4c8b

Re: __traits with alias

2014-05-08 Thread sigod via Digitalmars-d-learn
On Thursday, 8 May 2014 at 07:33:34 UTC, Philippe Sigaud via Digitalmars-d-learn wrote: A workaround is to wrap it into another template, to 'hide' __traits. Like this: alias Alias(alias a) = a; // A bit circular, I know. Oh, thank you. I think there is bug report / enhancement for this. I f

Re: Down the VisualD0.3.38-1.exe ,found virus!

2014-05-08 Thread Meta via Digitalmars-d-learn
On Friday, 9 May 2014 at 01:02:39 UTC, FrankLike wrote: Hi,everyone, down VisulaD from http://rainers.github.io/visuald/visuald/StartPage.html found the virus:Win32.Troj.Undef.(kcloud) Why? Frank I've been using VisualD for a long time without problems. If it makes you nervous, you can get

How to use 'Heat the compiler' to vibe.d?

2014-05-08 Thread FrankLike via Digitalmars-d-learn
How to use 'Heat the compiler' to vibe.d? If you can not stop the exe ,how to do? Thank you. Frank

Re: vibe.d's example is good, but Memory Usage is bigger than beeblog?

2014-05-08 Thread FrankLike via Digitalmars-d-learn
The form-interface-example.exe's Memory Usage is 3.5M,if have some error,then Memory Usage is 6.7M,if error is closed,the Memory Usage keeps in 6.7M ,until you close the exe. the error :such as '500 - Internal Server Error Internal Server Error Internal error information: object.Exception@

vibe.d's example is good,but Memory Usage is bigger than beeblog?

2014-05-08 Thread FrankLike via Digitalmars-d-learn
I build the vibe.d's example: http-server-example,the exe's size is 5M ,it's very good, is better than go's beeblog,the beeblog's size is 12M. I very like D,but the Memory Usage is bigger than go's exe. http-server-example.exe's Memory Usage is 3.5M,but the beeblog's Memory Usage is 2.5M,I don

Re: Down the VisualD0.3.38-1.exe ,found virus!

2014-05-08 Thread FrankLike via Digitalmars-d-learn
Most probably a false positive. What antivir do you use? http://www.ijinshan.com/duba/newduba.shtml

Re: Down the VisualD0.3.38-1.exe ,found virus!

2014-05-08 Thread Jack via Digitalmars-d-learn
On Friday, 9 May 2014 at 01:02:39 UTC, FrankLike wrote: Hi,everyone, down VisulaD from http://rainers.github.io/visuald/visuald/StartPage.html found the virus:Win32.Troj.Undef.(kcloud) Why? Frank Most probably a false positive. What antivir do you use?

Re: DOSNEWSIZE Error

2014-05-08 Thread Jack via Digitalmars-d-learn
On Thursday, 8 May 2014 at 21:10:34 UTC, Arjan wrote: On Thursday, 8 May 2014 at 14:49:09 UTC, Jack wrote: I had a compiler error with just a "DOSNEWSIZE Error" with no more information. Code: http://pastebin.com/UDAgmjtx I was trying to learn to implement SQLite connections to a local file

Down the VisualD0.3.38-1.exe ,found virus!

2014-05-08 Thread FrankLike via Digitalmars-d-learn
Hi,everyone, down VisulaD from http://rainers.github.io/visuald/visuald/StartPage.html found the virus:Win32.Troj.Undef.(kcloud) Why? Frank

Re: Any chance to avoid monitor field in my class?

2014-05-08 Thread Yuriy via Digitalmars-d-learn
I don't doubt your reasons, but then again, you have what you have right now in D. Asking for more, you have to provide it, or convince others to. If it's the latter, you need to make a very very strong case. I want to provide it, but before i do, i want to know if there were any decisions made

Re: Any chance to avoid monitor field in my class?

2014-05-08 Thread Steven Schveighoffer via Digitalmars-d-learn
On Thu, 08 May 2014 17:05:56 -0400, Yuriy wrote: How many of these? In order to justify saving 8 bytes per instance, you have have a lot. I don't see emplacing thousands or tens of thousands of objects on the stack. Ok, i guess i have to agree with you. But. Why are you protecting __monito

Re: Any chance to avoid monitor field in my class?

2014-05-08 Thread Yuriy via Digitalmars-d-learn
Also take a look at the Rust language, that avoids some of your problems :-) Done already =). Rust is great, but I like D, and i strongly believe it's the next big language. If only it could allow a bit more tweaks ;)

Re: dxl (the d port of jexcelapi)

2014-05-08 Thread John Colvin via Digitalmars-d-learn
On Thursday, 8 May 2014 at 21:02:05 UTC, Taylor Hillegeist wrote: By the way the weblink is: http://www.dsource.org/projects/dexcelapi That will need some work before it works with modern D.

Re: Any chance to avoid monitor field in my class?

2014-05-08 Thread bearophile via Digitalmars-d-learn
Yuriy: But. Why are you protecting __monitors so eagerly? :) Also take a look at the Rust language, that avoids some of your problems :-) Bye, bearophile

Re: DOSNEWSIZE Error

2014-05-08 Thread Arjan via Digitalmars-d-learn
On Thursday, 8 May 2014 at 14:49:09 UTC, Jack wrote: I had a compiler error with just a "DOSNEWSIZE Error" with no more information. Code: http://pastebin.com/UDAgmjtx I was trying to learn to implement SQLite connections to a local file with only the path to the file and no port or localhos

Re: Any chance to avoid monitor field in my class?

2014-05-08 Thread Yuriy via Digitalmars-d-learn
How many of these? In order to justify saving 8 bytes per instance, you have have a lot. I don't see emplacing thousands or tens of thousands of objects on the stack. Ok, i guess i have to agree with you. But. Why are you protecting __monitors so eagerly? :) Arrays of objects are stored as arr

Re: dxl (the d port of jexcelapi)

2014-05-08 Thread Taylor Hillegeist via Digitalmars-d-learn
By the way the weblink is: http://www.dsource.org/projects/dexcelapi

Re: Any chance to avoid monitor field in my class?

2014-05-08 Thread John Colvin via Digitalmars-d-learn
On Wednesday, 7 May 2014 at 14:44:57 UTC, Yuriy wrote: Hello, is there a way of reducing size of an empty class to just vtbl? I tried to declare it as extern(C++) which works, but has a nasty side effect of limited mangling. Just a general FYI: Classes are relatively heavyweight in D. struct-

dxl (the d port of jexcelapi)

2014-05-08 Thread Taylor Hillegeist via Digitalmars-d-learn
So i was thinking i wonder if anyone has a d library for excel and behold there it was. however, it seems like d has grown since this was written. I'm getting bunches of errors telling me that i can't override a function without the override keyword. which is not a big deal, however I seem to

Re: Any chance to avoid monitor field in my class?

2014-05-08 Thread Steven Schveighoffer via Digitalmars-d-learn
On Thu, 08 May 2014 15:47:46 -0400, Yuriy wrote: But my question more was about where do you plan to put so many of these objects that you will save a significant amount of bytes, aside from the heap (which already uses 16-byte blocks). Hm.. Stack/emplace, How many of these? In order to j

Re: Any chance to avoid monitor field in my class?

2014-05-08 Thread Yuriy via Digitalmars-d-learn
But my question more was about where do you plan to put so many of these objects that you will save a significant amount of bytes, aside from the heap (which already uses 16-byte blocks). Hm.. Stack/emplace, arrays, n-dimensional arrays? :) Besides, if we're talking of D as a system language to

Re: CMake for D

2014-05-08 Thread Chris Piker via Digitalmars-d-learn
On Monday, 24 March 2014 at 23:55:14 UTC, Dragos Carp wrote: I moved cmaked2 to github [1], updated and simplified the usage a little (system cmake patch not necessary anymore). You can give it a try. Dub registry support is also on the way. [1] - https://github.com/dcarp/cmake-d Verified tes

Re: Any chance to avoid monitor field in my class?

2014-05-08 Thread Steven Schveighoffer via Digitalmars-d-learn
On Thu, 08 May 2014 14:17:42 -0400, Yuriy wrote: On Thursday, 8 May 2014 at 17:49:01 UTC, Steven Schveighoffer wrote: To what end? What are you trying to save? I'm trying to reimplement std.variant in a nice OOP way, that supports CTFE, zero-size and a minimal amount of void*-casts. For that

Re: Any chance to avoid monitor field in my class?

2014-05-08 Thread Yuriy via Digitalmars-d-learn
On Thursday, 8 May 2014 at 17:49:01 UTC, Steven Schveighoffer wrote: To what end? What are you trying to save? I'm trying to reimplement std.variant in a nice OOP way, that supports CTFE, zero-size and a minimal amount of void*-casts. For that i'm using my VariantPayload(T) class, which i want

Re: Any chance to avoid monitor field in my class?

2014-05-08 Thread Steven Schveighoffer via Digitalmars-d-learn
On Thu, 08 May 2014 13:21:07 -0400, Yuriy wrote: On Thursday, 8 May 2014 at 14:57:37 UTC, Steven Schveighoffer wrote: The de-facto minimum size of a class is 16 bytes, due to the minimum block size of the heap. 8 bytes vtbl pointer on 64-bit systems would still allocate into 16-byte block

Re: Any chance to avoid monitor field in my class?

2014-05-08 Thread Yuriy via Digitalmars-d-learn
On Thursday, 8 May 2014 at 14:57:37 UTC, Steven Schveighoffer wrote: The de-facto minimum size of a class is 16 bytes, due to the minimum block size of the heap. 8 bytes vtbl pointer on 64-bit systems would still allocate into 16-byte blocks. -Steve Yes, but still the question remains open

Re: throws Exception in method

2014-05-08 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, May 08, 2014 at 03:19:04PM +, amehat via Digitalmars-d-learn wrote: > On Thursday, 8 May 2014 at 14:02:06 UTC, monarch_dodra wrote: [...] > >Keep in mind that D also has the concept of "Error". Both "Exception" > >and "Error" derive from "Throwable". > > > >"nothrow" only means the func

Re: [Rosettacode] D code line length limit

2014-05-08 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, May 08, 2014 at 03:13:48PM +, Dicebot via Digitalmars-d-learn wrote: > On Thursday, 8 May 2014 at 14:34:27 UTC, H. S. Teoh via Digitalmars-d-learn > wrote: > >FWIW, for very long function signatures I write it this way: > > > > const(T)[] myVeryLongFunction(T)(const(T)[] arr, > >

Re: static if (__ctfe)

2014-05-08 Thread Timon Gehr via Digitalmars-d-learn
On 05/07/2014 12:07 PM, Yuriy wrote: On Wednesday, 7 May 2014 at 09:51:01 UTC, John Colvin wrote: On Wednesday, 7 May 2014 at 09:47:20 UTC, Yuriy wrote: Hello, is there any way to static if(__ctfe)? I want to declare class members which are only available in ctfe. Thanx. Sadly not as far as I

Re: throws Exception in method

2014-05-08 Thread amehat via Digitalmars-d-learn
On Thursday, 8 May 2014 at 14:02:06 UTC, monarch_dodra wrote: On Thursday, 8 May 2014 at 13:06:05 UTC, amehat wrote: Okay. Thank you for these explanations, I understand a little better the exceptions D. Keep in mind that D also has the concept of "Error". Both "Exception" and "Error" derive

Re: [Rosettacode] D code line length limit

2014-05-08 Thread Dicebot via Digitalmars-d-learn
On Thursday, 8 May 2014 at 14:34:27 UTC, H. S. Teoh via Digitalmars-d-learn wrote: FWIW, for very long function signatures I write it this way: const(T)[] myVeryLongFunction(T)(const(T)[] arr, intx,

Re: [Rosettacode] D code line length limit

2014-05-08 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, May 08, 2014 at 02:50:54PM +, bearophile via Digitalmars-d-learn wrote: > H. S. Teoh: > > >FWIW, for very long function signatures I write it this way: > > > > const(T)[] myVeryLongFunction(T)(const(T)[] arr, > > intx, > >

Re: Any chance to avoid monitor field in my class?

2014-05-08 Thread Steven Schveighoffer via Digitalmars-d-learn
On Wed, 07 May 2014 10:44:55 -0400, Yuriy wrote: Hello, is there a way of reducing size of an empty class to just vtbl? I tried to declare it as extern(C++) which works, but has a nasty side effect of limited mangling. The de-facto minimum size of a class is 16 bytes, due to the minimum bl

Re: [Rosettacode] D code line length limit

2014-05-08 Thread bearophile via Digitalmars-d-learn
H. S. Teoh: FWIW, for very long function signatures I write it this way: const(T)[] myVeryLongFunction(T)(const(T)[] arr, intx, inty, intz,

DOSNEWSIZE Error

2014-05-08 Thread Jack via Digitalmars-d-learn
I had a compiler error with just a "DOSNEWSIZE Error" with no more information. Code: http://pastebin.com/UDAgmjtx I was trying to learn to implement SQLite connections to a local file with only the path to the file and no port or localhost nonesense from this : https://github.com/buggins/d

Re: [Rosettacode] D code line length limit

2014-05-08 Thread Jonathan M Davis via Digitalmars-d-learn
On Thu, 8 May 2014 07:32:52 -0700 "H. S. Teoh via Digitalmars-d-learn" wrote: > On Thu, May 08, 2014 at 01:59:58AM -0700, Jonathan M Davis via > Digitalmars-d-learn wrote: > > On Thu, 08 May 2014 07:29:08 + > > bearophile via Digitalmars-d-learn > > wrote: > > > > > Jonathan M Davis: > > > >

Re: Signals far from Slots

2014-05-08 Thread Jim Hewes via Digitalmars-d-learn
Thanks Ali, In the second part of that example I was hoping it was understood that Bar generates it's own signal. Sorry, I guess I wasn't clear; I was just trying to reduce code. I think maybe I'm really looking for a way that BarContainer doesn't have to know that Bar and Foo are connected.

Re: [Rosettacode] D code line length limit

2014-05-08 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, May 08, 2014 at 01:59:58AM -0700, Jonathan M Davis via Digitalmars-d-learn wrote: > On Thu, 08 May 2014 07:29:08 + > bearophile via Digitalmars-d-learn > wrote: > > > Jonathan M Davis: > > > > > ultimately, this sort of thing pretty much always ends up being > > > highly subjective.

Re: throws Exception in method

2014-05-08 Thread monarch_dodra via Digitalmars-d-learn
On Thursday, 8 May 2014 at 13:06:05 UTC, amehat wrote: Okay. Thank you for these explanations, I understand a little better the exceptions D. Keep in mind that D also has the concept of "Error". Both "Exception" and "Error" derive from "Throwable". "nothrow" only means the function will not

Re: SQLite3

2014-05-08 Thread Jack via Digitalmars-d-learn
On Thursday, 8 May 2014 at 12:47:55 UTC, Arjan wrote: On Thursday, 8 May 2014 at 11:48:14 UTC, Jack wrote: On Thursday, 8 May 2014 at 11:07:06 UTC, Arjan wrote: On Thursday, 8 May 2014 at 10:29:16 UTC, Jack wrote: On Wednesday, 7 May 2014 at 19:03:34 UTC, Arjan wrote: On Wednesday, 7 May 2014

Re: throws Exception in method

2014-05-08 Thread amehat via Digitalmars-d-learn
On Thursday, 8 May 2014 at 12:27:55 UTC, John Colvin wrote: On Thursday, 8 May 2014 at 12:00:40 UTC, amehat wrote: On Thursday, 8 May 2014 at 10:14:27 UTC, Jonathan M Davis via Digitalmars-d-learn wrote: On Thu, 08 May 2014 09:15:13 + amehat via Digitalmars-d-learn wrote: Hello everyon

Re: SQLite3

2014-05-08 Thread Arjan via Digitalmars-d-learn
On Thursday, 8 May 2014 at 11:48:14 UTC, Jack wrote: On Thursday, 8 May 2014 at 11:07:06 UTC, Arjan wrote: On Thursday, 8 May 2014 at 10:29:16 UTC, Jack wrote: On Wednesday, 7 May 2014 at 19:03:34 UTC, Arjan wrote: On Wednesday, 7 May 2014 at 06:21:10 UTC, Jack wrote: First off a Disclaimer: I

Re: throws Exception in method

2014-05-08 Thread John Colvin via Digitalmars-d-learn
On Thursday, 8 May 2014 at 12:00:40 UTC, amehat wrote: On Thursday, 8 May 2014 at 10:14:27 UTC, Jonathan M Davis via Digitalmars-d-learn wrote: On Thu, 08 May 2014 09:15:13 + amehat via Digitalmars-d-learn wrote: Hello everyone, in java, you can have exceptions on methods. Thus we can

Re: throws Exception in method

2014-05-08 Thread amehat via Digitalmars-d-learn
On Thursday, 8 May 2014 at 10:14:27 UTC, Jonathan M Davis via Digitalmars-d-learn wrote: On Thu, 08 May 2014 09:15:13 + amehat via Digitalmars-d-learn wrote: Hello everyone, in java, you can have exceptions on methods. Thus we can write: public static void control (String string) throws

Re: SQLite3

2014-05-08 Thread Jack via Digitalmars-d-learn
On Thursday, 8 May 2014 at 11:07:06 UTC, Arjan wrote: On Thursday, 8 May 2014 at 10:29:16 UTC, Jack wrote: On Wednesday, 7 May 2014 at 19:03:34 UTC, Arjan wrote: On Wednesday, 7 May 2014 at 06:21:10 UTC, Jack wrote: First off a Disclaimer: I'm a noob and still learning. Please don't bash me li

Re: SQLite3

2014-05-08 Thread Arjan via Digitalmars-d-learn
On Thursday, 8 May 2014 at 10:29:16 UTC, Jack wrote: On Wednesday, 7 May 2014 at 19:03:34 UTC, Arjan wrote: On Wednesday, 7 May 2014 at 06:21:10 UTC, Jack wrote: First off a Disclaimer: I'm a noob and still learning. Please don't bash me like some forums. Now to the questions: I'm searching fo

Re: [Rosettacode] D code line length limit

2014-05-08 Thread Jonathan M Davis via Digitalmars-d-learn
On Thu, 08 May 2014 10:27:17 + bearophile via Digitalmars-d-learn wrote: > Jonathan M Davis: > > > I still think that allowing const on the left is simply a > > bad design decision. > > I opened a request on this, and it was closed down :-) I know. Walter doesn't agree that it was a bad deci

Re: [Rosettacode] D code line length limit

2014-05-08 Thread bearophile via Digitalmars-d-learn
Jonathan M Davis: I still think that allowing const on the left is simply a bad design decision. I opened a request on this, and it was closed down :-) Bye, bearophile

Re: SQLite3

2014-05-08 Thread Jack via Digitalmars-d-learn
On Wednesday, 7 May 2014 at 19:03:34 UTC, Arjan wrote: On Wednesday, 7 May 2014 at 06:21:10 UTC, Jack wrote: First off a Disclaimer: I'm a noob and still learning. Please don't bash me like some forums. Now to the questions: I'm searching for a quick and easy way to integrate SQLite3 in my appl

Re: [Rosettacode] D code line length limit

2014-05-08 Thread Jonathan M Davis via Digitalmars-d-learn
On Thu, 08 May 2014 09:30:38 + bearophile via Digitalmars-d-learn wrote: > Jonathan M Davis: > > > Unfortunately, making this consistent by doing something like > > enforcing that > > all function attributes go on the right would then be > > inconsistent with other > > languages with regards

Re: throws Exception in method

2014-05-08 Thread Jonathan M Davis via Digitalmars-d-learn
On Thu, 08 May 2014 09:15:13 + amehat via Digitalmars-d-learn wrote: > Hello everyone, > > in java, you can have exceptions on methods. > Thus we can write: > public static void control (String string) throws > MyException {} > > Is that possible in D and if so how does it work? If I write th

Re: throws Exception in method

2014-05-08 Thread bearophile via Digitalmars-d-learn
amehat: What is the proper behavior for this D? D doesn't have that Java syntax, because it was widely regarded as a Java design mistake. So in D omit the throws part. If your function tree doesn't throw exceptions (but it can throw errors) add a "nothrow". Bye, bearophile

Re: [Rosettacode] D code line length limit

2014-05-08 Thread bearophile via Digitalmars-d-learn
Jonathan M Davis: Unfortunately, making this consistent by doing something like enforcing that all function attributes go on the right would then be inconsistent with other languages with regards to the attributes that they have which go on the left, This is a job for a Lint. like DScanner :

Re: throws Exception in method

2014-05-08 Thread John Colvin via Digitalmars-d-learn
On Thursday, 8 May 2014 at 09:15:16 UTC, amehat wrote: Hello everyone, in java, you can have exceptions on methods. Thus we can write: public static void control (String string) throws MyException {} Is that possible in D and if so how does it work? If I write this D: public void testMe () t

throws Exception in method

2014-05-08 Thread amehat via Digitalmars-d-learn
Hello everyone, in java, you can have exceptions on methods. Thus we can write: public static void control (String string) throws MyException {} Is that possible in D and if so how does it work? If I write this D: public void testMe () throws MyException {} The compiler refuses to compile.

Re: [Rosettacode] D code line length limit

2014-05-08 Thread Jonathan M Davis via Digitalmars-d-learn
On Thu, 08 May 2014 07:29:08 + bearophile via Digitalmars-d-learn wrote: > Jonathan M Davis: > > > ultimately, this sort of > > thing pretty much always ends up being highly subjective. > > But please put the const/immutable of methods on the right: > > struct Foo { > void bar1() const {

Re: Need help with movement from C to D

2014-05-08 Thread Mengu via Digitalmars-d-learn
On Tuesday, 6 May 2014 at 15:13:41 UTC, Artur Skawina via Digitalmars-d-learn wrote: On 05/06/14 16:45, via Digitalmars-d-learn wrote: On Tuesday, 6 May 2014 at 14:25:01 UTC, Artur Skawina via Digitalmars-d-learn wrote: I'm not sure why you'd want to wrap the .offsetof expression in a template

Re: Need help with movement from C to D

2014-05-08 Thread bearophile via Digitalmars-d-learn
Artur Skawina: But I have no idea why anybody would want to wrap this trivial expression like that. And, I have no idea if the, hmm, /unconventional/ D offsetof semantics are in the bugzilla. It's not really a "bug", but a design mistake... https://issues.dlang.org/show_bug.cgi?id=12714 By

Re: __traits with alias

2014-05-08 Thread Philippe Sigaud via Digitalmars-d-learn
> alias a = __traits(getMember, module_, m); // fails > //Error: basic type expected, not __traits > //Error: semicolon expected to close alias declaration > Is this a bug or I've missed something? It's a syntax limitation for alias. That bites us from time to time. A w

Re: [Rosettacode] D code line length limit

2014-05-08 Thread bearophile via Digitalmars-d-learn
Jonathan M Davis: ultimately, this sort of thing pretty much always ends up being highly subjective. But please put the const/immutable of methods on the right: struct Foo { void bar1() const {} // Good const void bar2() {} // Bad } Bye, bearophile

Re: [Rosettacode] D code line length limit

2014-05-08 Thread Jonathan M Davis via Digitalmars-d-learn
On Wed, 07 May 2014 18:51:58 + Meta via Digitalmars-d-learn wrote: > On Wednesday, 7 May 2014 at 14:40:37 UTC, Jonathan M Davis via > Digitalmars-d-learn wrote: > > My eyes... Oh, how that hurts readibily. > > While I agree that > > pure @safe @nogc nothrow > void doSomething(int n) > { > } >