Re: Using output-range overloads of SysTime.toISO{Ext}String with formatting code

2019-07-08 Thread Digital Mars via Digitalmars-d-learn
08.07.2019 13:38, Joseph Rushton Wakeling пишет: Thanks for taking the time to answer, but I don't think this really addresses my question. Your example shows a struct with `toString` overloads.  However, SysTime.toISOExtString does not work like this: it is a method with two explicit

Re: Assert and the optional Message

2012-03-09 Thread Mars
On Friday, 9 March 2012 at 07:55:56 UTC, Jonathan M Davis wrote: What you should almost certainly be doing is changing Visual Studio's settings so that it doesn't close the Window when the program exits. I know that it's possible. I've done it, but I rarely use Windows, and I don't remember

Re: std.socket with GDC

2012-02-26 Thread Mars
On Sunday, 26 February 2012 at 02:01:17 UTC, Andrew Wiley wrote: I recall having some issues because Winsock needs to be on the linker commandline *after* phobos. Try running with `gdc -v` to see what the linker commandline looks like. That's it... any way to get it in the correct order,

Re: std.socket with GDC

2012-02-25 Thread Mars
On Saturday, 25 February 2012 at 18:27:29 UTC, Vladimir Panteleev wrote: On Friday, 24 February 2012 at 19:15:26 UTC, Mars wrote: Hello everybody. When trying to compile a program using GDC (Windows), which includes an import std.socket, I get a lot undefined references, like undefined

Executable size when compiling with GDC

2012-02-21 Thread Mars
Hello everybody. Today I've tested GDC (on Windows), and a simple Hello World program results in a 5 MB exe file, while it's only about 200 KB with DMD. Is this normal? What does GDC (GCC?) put in there, to make it so big, and why? Mars

Re: Executable size when compiling with GDC

2012-02-21 Thread Mars
On Tuesday, 21 February 2012 at 13:19:11 UTC, Andrea Fontana wrote: Have you tried to strip executable using --strip or --strip-all? Down to 1 MB, a good start, thanks. I guess that's more bearable.

Removing items from an Array

2012-02-17 Thread Mars
to go over the array from the end to the beginning, and when I remove stuff from it, it shouldn't be a problem. But apparently it is. Mars

Re: Removing items from an Array

2012-02-17 Thread Mars
On Friday, 17 February 2012 at 10:13:00 UTC, Jonathan M Davis wrote: I don't believe that removing elements from an AA while iterating over it is safe. - Jonathan M Davis Well, no. But from my experience it's okay from bottom to top... at least in other languages. What would be the

Re: Removing items from an Array

2012-02-17 Thread Mars
On Friday, 17 February 2012 at 13:33:25 UTC, James Miller wrote: AAs don't keep the key order, so when you delete something out of it, what ever system iterates to the next pointer gets confused. Its generally a bad idea to modify an array as you loop through it. -- James Miller Too bad. So,

Re: Compiling Lua for D

2012-02-16 Thread Mars
On Thursday, 16 February 2012 at 05:06:13 UTC, Jesse Phillips wrote: BTW, I totally recommend LuaD when interacting with lua. Thank you for the explanation. I've started with LuaD, but I kinda didn't like it, can't exactly say why. I rather want to use Lua directly for now, and maybe write

Compiling Lua for D

2012-02-15 Thread Mars
Library File from DMD. What's the correct way to do this? Mars

Re: Compiling Lua for D

2012-02-15 Thread Mars
On Wednesday, 15 February 2012 at 16:35:01 UTC, Andrej Mitrovic wrote: Have you tried https://github.com/JakobOvrum/LuaD ? It has binaries here: http://github.com/JakobOvrum/LuaD/tree/binaries LuaD works fine, but I'd rather learn to compile stuff like this myself. It will get me further in

Re: Compiling Lua for D

2012-02-15 Thread Mars
On Wednesday, 15 February 2012 at 15:02:36 UTC, Mars wrote: What's the correct way to do this? I guess I did it. Using lib, I was able to bind those obj files to a lib file. lib -c obj_files... I really have to learn a bit more about this stuff... to successfully compile a program

Re: Compiling Lua for D

2012-02-15 Thread Mars
On Wednesday, 15 February 2012 at 19:44:41 UTC, Trass3r wrote: LuaD works fine, but I'd rather learn to compile stuff like this myself. It will get me further in the long run^^ Try to switch to gdc. dmc, optlink Co. must die a bloody death anyway :) I guess GDC uses COFF? That would

Re: A GUI library to begin with

2012-02-07 Thread Mars
, as it seems more mature. But aside from that they're very similar. Mars

Re: Partial classes

2012-01-31 Thread Mars
On Monday, 30 January 2012 at 10:21:07 UTC, bls wrote: As already said template mixins are close to partial classes. A snippet. HTH Thanks everybody. I still hope support for partial classes may come some day, to make this cleaner, but I guess it works.

Structs and Classes

2012-01-31 Thread Mars
Bar as a class, it works as expected (by silly me). Why is that? And if I want to use a struct for this, is the passing around of a pointer (like in the example) correct? Mars

Re: Partial classes

2012-01-31 Thread Mars
On Tuesday, 31 January 2012 at 12:33:22 UTC, bearophile wrote: Mars: Thanks everybody. I still hope support for partial classes may come some day, to make this cleaner, but I guess it works. Generally it's not wise to go too much against the style of a language. What do you need partial

Partial classes

2012-01-29 Thread Mars
Hello everybody. Quick question, is there anything like C#'s partial classes in D? Mars

Re: Singleton question (shared class)

2012-01-26 Thread Mars
, but for the time being, singletons are valid practice in my eyes. Mars

Re: char* to long

2012-01-25 Thread Mars
Thanks for the replies, everyone.I guess I'll go with the double conversion for now.

Singleton question (shared class)

2012-01-25 Thread Mars
shared, I'm wondering if that's okay. Example: http://pastie.org/private/vd7qfh8b9c1chjnrimpp9a If it's not... what's the right way to do this? Mars

Re: Singleton question (shared class)

2012-01-25 Thread Mars
Alternative approach, I just found: http://pastie.org/private/1jlcvfostnbopfp3quflg If I get that right, this is basically the classic singleton, like it would be in other languages, right? So... what's the best way? Mars

char* to long

2012-01-24 Thread Mars
Hello everybody. I have to convert a char* (from a C function) to long. At the moment I'm using long foo = to!long( to!string(bar) ); but this doesn't feel right... with 2 to calls. Is this the way to go? Or is there something better? Mars

Extend Enum

2012-01-23 Thread Mars
, } } else { enum example { FOO = 1, BAR = 3, } } Is there a better way to do this? Maybe a class with static consts...? How should I do it? Mars

Re: Extend Enum

2012-01-23 Thread Mars
inside an Enum. Mars

Re: MySQL

2012-01-22 Thread Mars
? Unknown Option : LLIBMYSQL Normally I just include the lib files in the files list (dmd foo.d bar.lib). Mars

Re: MySQL

2012-01-22 Thread Mars
On Sunday, 22 January 2012 at 10:21:29 UTC, DNewbie wrote: I've took a look at MySQL headers, the functions use stdcall, but in libmysql.dll exports table they are not decorated. This means...? Shouldn't it at least compile, if they are listed in the def file, coming from the lib?

Re: MySQL

2012-01-22 Thread Mars
On Sunday, 22 January 2012 at 23:23:23 UTC, Kapps wrote: 2) Create the binding functions using extern(System). Oh man... that was the problem. The file I used was using extern(C). Thought that was okay, it's a C lib after all. Thank you! Mars

MySQL

2012-01-21 Thread Mars
coffimplib), but it fails, no matter what. I've also tried to make a def file out of the lib, and the functions are definitly listed as exports there. Any idea what I might doing wrong? Mars

Re: MySQL

2012-01-21 Thread Mars
On Saturday, 21 January 2012 at 23:44:12 UTC, DNewbie wrote: Please check whether your MySQL lib is 64 bit and your app is 32 bit. The lib is 32 bit, just like my application.

Re: MySQL

2012-01-21 Thread Mars
it. Tried pragma and command line. And I don't get a message that the lib couldn't be found. What exactly is -L-l supposed to do? Is this valid in DMD 2.057? I get an error with it (Unknown Option). Mars

Re: Passing arguments to a new thread

2012-01-20 Thread Mars
On Friday, 20 January 2012 at 15:33:34 UTC, Timon Gehr wrote: On 01/20/2012 03:12 PM, Mars wrote: Hello everybody. As the title states, I want to run a function in a new thread, and pass it some arguments. How would I do that? I guess I could make a class, deriving from Thread, and work