Re: Unresolved external symbol

2014-05-02 Thread evilrat via Digitalmars-d-learn
On Thursday, 1 May 2014 at 22:23:22 UTC, Ga wrote: And I am getting a error LNK2019: unresolved external symbol GetDeviceCaps referenced in function _Dmain have you linked gdi32.lib?

Re: Programming a Game in D? :D

2014-05-23 Thread evilrat via Digitalmars-d-learn
On Friday, 23 May 2014 at 14:43:30 UTC, David wrote: On Friday, 23 May 2014 at 14:11:26 UTC, David wrote: Ok so I installed DDT for eclipse now but have a problem :D First the imports are changed, std.studio is now std.stdio (or its something completly else) And if I try to run the file now it

Re: Programming a Game in D? :D

2014-05-24 Thread evilrat via Digitalmars-d-learn
On Saturday, 24 May 2014 at 09:35:01 UTC, David wrote: On Friday, 23 May 2014 at 17:47:56 UTC, evilrat wrote: why not just use Xamarin Studio with Mono-D? But only the trial of Xamarin Studio is for free, and I used eclipse for Java before and really like it :P actually not. you don't

Re: Programming a Game in D? :D

2014-05-24 Thread evilrat via Digitalmars-d-learn
On Saturday, 24 May 2014 at 16:41:41 UTC, Dmitry wrote: On Saturday, 24 May 2014 at 09:49:30 UTC, evilrat wrote: why not just use Xamarin Studio with Mono-D? But only the trial of Xamarin Studio is for free, and I used eclipse for Java before and really like it :P actually not. you don't even

Re: Programming a Game in D? :D

2014-05-25 Thread evilrat via Digitalmars-d-learn
On Sunday, 25 May 2014 at 08:59:55 UTC, Dmitry wrote: On Saturday, 24 May 2014 at 18:00:05 UTC, evilrat wrote: there is a plugin for linux for GDB i believe, and another plugin for Windows which i can't remember the name, the latter one disappeared from XS 5.0 by some reason. search the

Re: Programming a Game in D? :D

2014-05-25 Thread evilrat via Digitalmars-d-learn
On Sunday, 25 May 2014 at 08:59:55 UTC, Dmitry wrote: I use Windows. Thanks, I think I found it: https://github.com/llucenic/MonoDevelop.Debugger.Gdb.D But now I cant install it, here is error: The package 'MonoDevelop.Core v4.0' could not be found in any repository The package

alias and mixin

2014-08-31 Thread evilrat via Digitalmars-d-learn
what the problem with this? alias myint = mixin(int); // - basic type expected blah blah blah... mixin alias unusable now, it blocks various cool templates and really frustrating(such things make D feels like some cheap limited language), is there any way to tell compiler explicitly use

Re: alias and mixin

2014-08-31 Thread evilrat via Digitalmars-d-learn
On Sunday, 31 August 2014 at 11:43:03 UTC, ketmar via Digitalmars-d-learn wrote: On Sun, 31 Aug 2014 11:26:47 + evilrat via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: alias myint = mixin(int); // - basic type expected blah blah mixin(alias myint = ~int~;); ? wow

Re: Programming a Game in D? :D

2014-08-31 Thread evilrat via Digitalmars-d-learn
On Sunday, 31 August 2014 at 19:06:41 UTC, David wrote: So first of all, I'm not sure if D is really the best choice for me. Since its just pretty hard for begginers like me without any tutorials and anything to come up with a game. Then what language should it be? It should have a big

Re: alias and mixin

2014-09-01 Thread evilrat via Digitalmars-d-learn
On Sunday, 31 August 2014 at 12:01:43 UTC, evilrat wrote: On Sunday, 31 August 2014 at 11:43:03 UTC, ketmar via Digitalmars-d-learn wrote: On Sun, 31 Aug 2014 11:26:47 + evilrat via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: alias myint = mixin(int); // - basic type

Re: alias and mixin

2014-09-01 Thread evilrat via Digitalmars-d-learn
On Monday, 1 September 2014 at 11:23:37 UTC, ketmar via Digitalmars-d-learn wrote: On Mon, 01 Sep 2014 10:57:41 + evilrat via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: p.s. you should really read about D mixins and templates. they aren't such intuitive sometimes, has

Re: Overriding to!string on enum types

2014-09-02 Thread evilrat via Digitalmars-d-learn
On Tuesday, 2 September 2014 at 12:54:55 UTC, Nordlöw wrote: Is it possible to override the behaviour of to!string(x) when x is an enum. I'm asking because this enum CxxRefQualifier { none, normalRef, rvalueRef } string toString(CxxRefQualifier refQ) @safe pure nothrow { final

Re: Overriding to!string on enum types

2014-09-02 Thread evilrat via Digitalmars-d-learn
sorry, i forgot everything. here is example of how to do this - import std.conv : to; enum Test { One, Two, Three, } template to(T: string) { T to(A: Test)(A val) { final switch (val) { case Test.One: return 1; case Test.Two: return 2; case Test.Three: return 3; } } }

Re: Overriding to!string on enum types

2014-09-02 Thread evilrat via Digitalmars-d-learn
On Tuesday, 2 September 2014 at 15:42:36 UTC, monarch_dodra wrote: Word of warning: You are not overriding to, but rather, simply defining your own to locally, which resolves as a better match in the context where you are using it. If you pass the enum to another function in another module,

Re: basic question about adresses and values in structs

2014-09-04 Thread evilrat via Digitalmars-d-learn
On Thursday, 4 September 2014 at 09:54:57 UTC, nikki wrote: thanks! just what I needed, with some stumbling I managed to get everything working as intended: using a pointer variable to save an adres of a function, then dereferencing to use it. Now I am wondering when to use the ** ? for

dub github dependencies?

2014-09-04 Thread evilrat via Digitalmars-d-learn
how i can specify github repo branch? i've already tried adding everything i have in mind but no luck so far. so in theory it should be like this: -- dub.json dependencies: { cairod: {version: ~ReworkWin32, path: https://github.com/evilrat666/cairoD.git} } but it says

Re: dub github dependencies?

2014-09-04 Thread evilrat via Digitalmars-d-learn
On Thursday, 4 September 2014 at 17:22:42 UTC, Gary Willoughby wrote: On Thursday, 4 September 2014 at 16:43:13 UTC, evilrat wrote: how i can specify github repo branch? i've already tried adding everything i have in mind but no luck so far. so in theory it should be like this: --

Re: Recomended cairo bindings

2014-09-14 Thread evilrat via Digitalmars-d-learn
On Sunday, 14 September 2014 at 13:30:28 UTC, Paul Z. Barsan wrote: First of all, the cairo version in the dub registry is different from the deimos version. CairoD (dub pkg) has support for more surfaces and provides D-style wrappers but I get compile-time errors. When I try to get an

Re: Recomended cairo bindings

2014-09-15 Thread evilrat via Digitalmars-d-learn
On Monday, 15 September 2014 at 12:11:09 UTC, Paul Z. Barsan wrote: Variables like CAIRO_HAS_XLIB_SURFACE are platform specific, xlib and xcb surfaces are for linux, win32 and directfb surfaces are for windows and so on.. I will search in dubs documentation how can I specify this sort of

Re: Function Pointers with Type T

2014-09-16 Thread evilrat via Digitalmars-d-learn
On Tuesday, 16 September 2014 at 01:16:14 UTC, Adam D. Ruppe wrote: bool function(T val1,T val2) ptr=comp!T; Moreover, comp has compile time arguments, so you can't take the address of it without forwarding the arguments. So instead of comp, you use comp!T - passing the T from the outside

Re: [Dub Problem] DMD compile run failed with exit code -9

2014-09-19 Thread evilrat via Digitalmars-d-learn
On Friday, 19 September 2014 at 15:58:37 UTC, Jack wrote: Disclaimer: I'm a newbie so don't bite me. Anyway I've been testing out dub in an ArchLinux environment that is inside a VM software(namely VirtualBox) and tried to build the Dash-sample game. The whole process went smoothly until it

Re: [Dub Problem] DMD compile run failed with exit code -9

2014-09-19 Thread evilrat via Digitalmars-d-learn
On Friday, 19 September 2014 at 16:35:39 UTC, Jack wrote: On Friday, 19 September 2014 at 16:06:23 UTC, evilrat wrote: On Friday, 19 September 2014 at 15:58:37 UTC, Jack wrote: Disclaimer: I'm a newbie so don't bite me. Anyway I've been testing out dub in an ArchLinux environment that is

Re: [DerelictAlure] Error loading libdumb.so etc...

2014-09-20 Thread evilrat via Digitalmars-d-learn
On Saturday, 20 September 2014 at 06:47:09 UTC, Jack wrote: I've configured dub to build DerelictAlure for my project which only contains the example code shown in: https://github.com/DerelictOrg/DerelictALURE The build was successful though when I tried to run it, they were spewing out that

Re: Can't get Visual D to come up. No warnings, no errors, no nothing

2014-09-22 Thread evilrat via Digitalmars-d-learn
On Tuesday, 23 September 2014 at 03:14:27 UTC, WhatMeWorry wrote: On Monday, 22 September 2014 at 03:30:22 UTC, Vladimir Panteleev wrote: On Monday, 22 September 2014 at 03:21:44 UTC, WhatMeWorry wrote: Anybody installed Visual D recently? As per the install instructions, I downloaded the

Re: Can't get Visual D to come up. No warnings, no errors, no nothing

2014-09-22 Thread evilrat via Digitalmars-d-learn
On Tuesday, 23 September 2014 at 05:13:58 UTC, evilrat wrote: On Tuesday, 23 September 2014 at 03:14:27 UTC, WhatMeWorry wrote: I've downloaded the isolated shell and the integrated package installer and successfully installed them both. But after that I have no clue as to how to proceed. I

Re: Can't get Visual D to come up. No warnings, no errors, no nothing

2014-09-23 Thread evilrat via Digitalmars-d-learn
On Tuesday, 23 September 2014 at 07:02:58 UTC, remco johannes wrote: On Monday, 22 September 2014 at 03:21:44 UTC, WhatMeWorry wrote: Anybody installed Visual D recently? As per the install instructions, I downloaded the Visual Studio isolated Shell 2013 and its integrated package.

Re: Can't get Visual D to come up. No warnings, no errors, no nothing

2014-09-23 Thread evilrat via Digitalmars-d-learn
On Tuesday, 23 September 2014 at 10:29:10 UTC, remco johannes wrote: why you guys have problems with it? it is so simple, install isolated shell first, then install ingegrated shell, install visuald and now you have your visuald environment ready to use. i Tried al kind of combination and

Re: DirectX 11 bindings?

2014-09-30 Thread evilrat via Digitalmars-d-learn
On Tuesday, 30 September 2014 at 13:05:56 UTC, Denis Gladkiy wrote: http://www.dsource.org/projects/bindings/browser/trunk/directx On Sunday, 8 August 2010 at 15:13:19 UTC, Trass3r wrote: Are there any bindings for DirectX 11? The bindings project only contains DX9 and DX10. better check

Re: Opening dub packages in Mono-D

2014-09-30 Thread evilrat via Digitalmars-d-learn
On Tuesday, 30 September 2014 at 21:47:01 UTC, Phil wrote: I'm trying to use Mono-D, but can't work out how to do simple things. I've tried looking for tutorials but this http://wiki.dlang.org/Mono-D is all I could find. I want to reference Pegged from a Mono-D project. I can't add its

Re: Invalid Assembly Generated

2014-10-04 Thread evilrat via Digitalmars-d-learn
On Saturday, 4 October 2014 at 09:40:24 UTC, Bauss wrote: I am not able to run the output file compiled. I am not sure if it might be an error with my commandline or not. Operating System: Windows 8 Commandline Arguments Try1: -c hello.d out\hello.exe Commandline Arguments Try2: -c hello.d

Re: How do I call a C++ struct default constructor from D?

2017-02-08 Thread evilrat via Digitalmars-d-learn
On Tuesday, 7 February 2017 at 14:26:11 UTC, MGW wrote: On Tuesday, 7 February 2017 at 13:37:01 UTC, Atila Neves wrote: Here still example https://pp.vk.me/c636630/v636630885/46579/neSdIip1ySI.jpg I'm sorry for being offensive, but... Of course, and the next step will be pragma mangle on D

Re: Are there plans to make mono D work with current version?

2017-01-25 Thread evilrat via Digitalmars-d-learn
On Thursday, 26 January 2017 at 01:58:51 UTC, Adam Wilson wrote: I'd recommend VSCode with Code-D works very well for me. https://github.com/Pure-D/code-d And with Microsoft C++ tools (ms-vscode.cpptools) it can debug D too with x64 or -m32mscoff

Re: Recommend: IDE and GUI library

2017-02-24 Thread evilrat via Digitalmars-d-learn
On Saturday, 25 February 2017 at 00:45:24 UTC, Moritz Maxeiner wrote: I use Visual Studio Code on Linux and macOS, not sure how the experience on Windows is, but I'd expect it to be the same. Windows is fine, can also debug mscoff x86 or x64 projects with MS 'cpptools' plugin that has

Re: Why is for() less efficient than foreach?

2017-02-10 Thread evilrat via Digitalmars-d-learn
On Friday, 10 February 2017 at 13:13:24 UTC, evilrat wrote: On my machine (AMD FX-8350) actually almost no difference oops, it skips flags with -run -_- sorry dmd loops.d -release Function 0 took: 16 ╬╝s and 5 hnsecs Function 1 took: 55 secs, 262 ms, 844 ╬╝s, and 6 hnsecs Function 2 took:

Re: Why is for() less efficient than foreach?

2017-02-10 Thread evilrat via Digitalmars-d-learn
On Friday, 10 February 2017 at 12:39:50 UTC, Bastiaan Veelo wrote: Depending on the machine this is run on, for() performs a factor 3-8 slower than foreach(). Can someone explain this to me? Or, taking for() as the norm, how can foreach() be so blazingly fast? Thanks! On my machine (AMD

Re: Recommend: IDE and GUI library

2017-03-01 Thread evilrat via Digitalmars-d-learn
On Wednesday, 1 March 2017 at 23:44:47 UTC, XavierAP wrote: For this I found out how to clone the dependencies, sorry about that... (Only from the command line... Anyone recommends better free Windows Git gui clients than GitHub Desktop?) TortoiseGIT maybe?

Re: Returning structs from COM

2016-12-19 Thread evilrat via Digitalmars-d-learn
On Monday, 19 December 2016 at 22:47:26 UTC, kinke wrote: On Monday, 19 December 2016 at 09:49:13 UTC, kinke wrote: [...] I did some research myself and indeed, COM classes/interfaces are apparently subject to a separate ABI. Unfortunately, googling it hasn't turned up any official (and not

D3D12 memory issues

2016-12-20 Thread evilrat via Digitalmars-d-learn
Hello guys, I have DirectX 12 code that doesn't work in D (it works in C++), as the subject says this can be related to D heap and/or thread local storage. code can be found here (build with dmd -m32mscoff)

Re: returning struct, destructor

2016-12-21 Thread evilrat via Digitalmars-d-learn
On Wednesday, 21 December 2016 at 14:15:06 UTC, John C wrote: On Wednesday, 21 December 2016 at 11:45:18 UTC, Eugene Wissner wrote: This prints 3 times "Destruct" with dmd 0.072.1. If I remove the if block, it prints "Destruct" only 2 times - the behavior I'm expecting. Why? Possibly to do

Re: Returning structs from COM

2016-12-18 Thread evilrat via Digitalmars-d-learn
On Saturday, 3 December 2016 at 09:51:00 UTC, John C wrote: Some DirectX methods return structs by value, but when I try calling them I either get garbage or an access violation. Usually COM methods return structs by pointer as a parameter, but these are returning the struct as the actual

Re: Is it possbile to specify a remote git repo as dub dependency?

2016-12-20 Thread evilrat via Digitalmars-d-learn
On Tuesday, 20 December 2016 at 11:04:30 UTC, biocyberman wrote: On Monday, 19 December 2016 at 16:23:45 UTC, Guillaume Piolat wrote: What you can do for private package as of today is: - use path-based dependencies and put your packages in the same repo - use git submodules and

Re: Returning structs from COM

2016-12-19 Thread evilrat via Digitalmars-d-learn
On Monday, 19 December 2016 at 09:49:13 UTC, kinke wrote: On Saturday, 3 December 2016 at 09:51:00 UTC, John C wrote: Some DirectX methods return structs by value, but when I try calling them I either get garbage or an access violation. Usually COM methods return structs by pointer as a

Re: COM2D Wrapper

2017-03-27 Thread evilrat via Digitalmars-d-learn
On Monday, 27 March 2017 at 21:02:05 UTC, Nierjerson wrote: On Friday, 24 March 2017 at 18:17:31 UTC, Nierjerson wrote: I'd like to present the following D library I am working on: https://github.com/IllusionSoftware/COM2D I get access violations when trying to call the functions on the

Re: How to COM interfaces work

2017-03-18 Thread evilrat via Digitalmars-d-learn
On Sunday, 19 March 2017 at 03:27:28 UTC, StarGrazer wrote: I'd just like to get some conformation on the process so at least I know I'm headed in the right direction. The project is pretty complex and most of the stuff is done in compile time code. What debug shows? If CoCreateInstance

Re: How to COM interfaces work

2017-03-18 Thread evilrat via Digitalmars-d-learn
On Sunday, 19 March 2017 at 02:04:53 UTC, StarGrazer wrote: I have a COM interface that is dynamically created using invoke and such. One of the functions returns an interface. It is just a value of IUnknown or whatever. If I use it as a pointer in to the the D interface equivalent, it

Re: Declaring interfaces with a constructor

2017-03-14 Thread evilrat via Digitalmars-d-learn
On Tuesday, 14 March 2017 at 13:54:41 UTC, David Zhang wrote: Yeah, that's the idea. Though I just thought of a possibility using an isPublicInterface template. Is that what you meant by templates and duck typing? Not sure about what that template does, but the idea behind ranges is

Re: DMD + Dynamic Library.

2017-03-08 Thread evilrat via Digitalmars-d-learn
On Wednesday, 8 March 2017 at 18:21:35 UTC, Damien Gibson wrote: On Wednesday, 8 March 2017 at 06:28:47 UTC, Jerry wrote: You have to use "export" for any symbol to be visible from a dll. On Windows by default nothing is exported. Would "export" and "export extern(D):" not be the same? Im

Re: Declaring interfaces with a constructor

2017-03-13 Thread evilrat via Digitalmars-d-learn
On Monday, 13 March 2017 at 19:31:52 UTC, David Zhang wrote: Basically, I want to define a common interface for a group of platform-specific classes, except that they should ideally also share constructor parameters. What I want to do is then alias them to a common name, selecting the

Re: Single exe vibe.d app

2017-04-05 Thread evilrat via Digitalmars-d-learn
On Wednesday, 5 April 2017 at 12:13:38 UTC, Satoshi wrote: Hi, How can I build single exe application with vibe.d (windows)? now it require zlib.dll, libeay32.dll and ssleay32.dll But I need it as single app. you have to build those as static libraries first, compile vibe.d with that static

Re: Single exe vibe.d app

2017-04-05 Thread evilrat via Digitalmars-d-learn
On Wednesday, 5 April 2017 at 12:13:38 UTC, Satoshi wrote: Hi, How can I build single exe application with vibe.d (windows)? now it require zlib.dll, libeay32.dll and ssleay32.dll But I need it as single app. btw, if all you need is to ship it as a single file and don't care if it writes

Re: C++ binding issues with C++ function returning a simple POD struct.

2017-05-22 Thread evilrat via Digitalmars-d-learn
On Monday, 22 May 2017 at 06:33:37 UTC, ParticlePeter wrote: On Monday, 22 May 2017 at 01:39:04 UTC, evilrat wrote: And this is actually D problem. In fact first bug report on this thing was dated back to 2014. Still not fixed. Thanks for your reply, do you have any links to some bug

Re: C++ binding issues with C++ function returning a simple POD struct.

2017-05-22 Thread evilrat via Digitalmars-d-learn
On Monday, 22 May 2017 at 08:03:07 UTC, ParticlePeter wrote: No, no, this (other) way around :-), still C++ to D. It actually works btw: HACK --- // original C++ ImVec2 GetCursorPos(); // C++ helper void GetCursorPos(ImVec2& result) { result = GetCursorPos(); }

Re: C++ binding issues with C++ function returning a simple POD struct.

2017-05-22 Thread evilrat via Digitalmars-d-learn
On Monday, 22 May 2017 at 11:25:31 UTC, ParticlePeter wrote: Then I am not getting your hack, this function here, does not exist on the C++ side. HACK --- // extern(C++) of course void GetCursorPos(ImVec2* v); How is it supposed to work then if there is no

Re: C++ binding issues with C++ function returning a simple POD struct.

2017-05-22 Thread evilrat via Digitalmars-d-learn
On Monday, 22 May 2017 at 18:51:43 UTC, ParticlePeter wrote: On Monday, 22 May 2017 at 14:01:56 UTC, Jerry wrote: IIRC the problem is that it isn't a POD type. ImVec2 has its own default constructor. The problem now is that because it no longer is POD, Window's ABI handles it different and

Re: Top level associative arrays

2017-05-02 Thread evilrat via Digitalmars-d-learn
On Tuesday, 2 May 2017 at 09:50:50 UTC, ANtlord wrote: On Tuesday, 2 May 2017 at 08:24:09 UTC, evilrat wrote: Making enum means that value should be available at compile time and AA's are fully dynamic. But if my memory serves me well, you can declare empty AA and delay initialization. So

Re: Top level associative arrays

2017-05-02 Thread evilrat via Digitalmars-d-learn
On Tuesday, 2 May 2017 at 07:48:35 UTC, ANtlord wrote: Hello! Is it possible to define associative array on top level of module? I try to compile this code and I get message `Error: non-constant expression ["s":"q", "ss":"qq"]` import std.stdio; auto dict = [ "s": "q", "ss":

Re: C++ binding issues with C++ function returning a simple POD struct.

2017-05-21 Thread evilrat via Digitalmars-d-learn
On Monday, 22 May 2017 at 01:27:22 UTC, Nicholas Wilson wrote: On Sunday, 21 May 2017 at 19:33:06 UTC, ParticlePeter wrote: I am statically linking to ImGui [1] on Win 10 x64, quite successfully till this issue came up. The noticed error so far comes when an ImGui function returns an ImVec2, a

Re: How to embed static strings to a D program?

2017-10-16 Thread evilrat via Digitalmars-d-learn
On Monday, 16 October 2017 at 05:34:13 UTC, Ky-Anh Huynh wrote: Hello, I want to use some static contents in my program, e.g, a CSS file, a long listing. To help deployment process I'd like to have them embedded in the final binary file. Is there any convenient way to support this? Maybe I

Re: Why isn't IID_ITaskbarList3 defined?

2017-10-15 Thread evilrat via Digitalmars-d-learn
On Sunday, 15 October 2017 at 15:13:09 UTC, Nieto wrote: I'm trying to write a blinding and I found both IID_ITaskbarList and IID_ITaskbarList2 are defined but IID_ITaskbarList3 isn't. Any reason why it isn't defined? sorry if it sounds such a naive question, I'm new to COM and D interop. I

Re: Can't use function with same name as module?

2017-10-17 Thread evilrat via Digitalmars-d-learn
On Tuesday, 17 October 2017 at 06:13:45 UTC, Shriramana Sharma wrote: Hello. fun.d: import std.stdio; void fun() { writeln("Hello"); } main.d: import fun; void main() { fun(); } $ dmd -oftest fun.d main.d main.d(2): Error: function expected before (), not module fun of type void Why can't

Re: debugging in vs code on Windows

2017-10-14 Thread evilrat via Digitalmars-d-learn
On Saturday, 14 October 2017 at 07:40:31 UTC, piotrklos wrote: On Friday, 13 October 2017 at 17:04:00 UTC, kerdemdemir wrote: On Friday, 13 October 2017 at 12:55:09 UTC, piotrklos wrote: (...) I am using VisualD(https://github.com/dlang/visuald/releases) with vs2015 community version(free)

Re: debugging in vs code on Windows

2017-10-18 Thread evilrat via Digitalmars-d-learn
On Wednesday, 18 October 2017 at 07:57:25 UTC, Dmitry wrote: On Tuesday, 17 October 2017 at 10:09:12 UTC, Dmitry wrote: On Tuesday, 17 October 2017 at 08:38:20 UTC, Arjan wrote: Before this will work, one must install the Microsoft C/C++ Addin i.e. ms-vscode.cpptools. Start debugging and

Re: Writing some built-in functions for Bash, possible?

2017-10-18 Thread evilrat via Digitalmars-d-learn
On Wednesday, 18 October 2017 at 03:48:01 UTC, Ky-Anh Huynh wrote: Hi, I'm using Bash heavily in my systems. Things become slow and slow when I have tons of scripts :) And sometimes it's not easy to manipulate data. You may have heard of recutils [1] which has a C extension to be loaded by

Re: Writing some built-in functions for Bash, possible?

2017-10-18 Thread evilrat via Digitalmars-d-learn
On Wednesday, 18 October 2017 at 08:15:53 UTC, evilrat wrote: ... extern(C) static int test_builtin(WORD_LIST* list) ... This of course should be nothrow also, because if it throws something really bad may(will) happen

Re: Writing some built-in functions for Bash, possible?

2017-10-18 Thread evilrat via Digitalmars-d-learn
On Wednesday, 18 October 2017 at 08:22:09 UTC, Andrea Fontana wrote: On Wednesday, 18 October 2017 at 03:48:01 UTC, Ky-Anh Huynh wrote: You can write your script in D using #!/usr/local/bin/rdmd as shebang line. Or, using dstep, you can convert C headers to D imports, so you can compile your

Re: COM/OLE advanced questions

2017-11-02 Thread evilrat via Digitalmars-d-learn
You'd better read some more authorative source since my experience is very limited on that matter, but here is some quick notes On Thursday, 2 November 2017 at 14:22:56 UTC, Guillaume Piolat wrote: Question 1. Is it mandatory to inherit from core.sys.windows.unknwn.IUnknown, or just having

Re: Request Assistance Calling D from C++: weird visibility issue inside struct and namespace

2017-11-07 Thread evilrat via Digitalmars-d-learn
On Wednesday, 8 November 2017 at 06:34:27 UTC, Andrew Edwards wrote: Modify example.cpp to: == // example.cpp #include "example.h" namespace SomeApi {} struct SomeStruct {} void call_cpp() { foo("do great things"); return; }

Re: dub optional dependency

2017-10-28 Thread evilrat via Digitalmars-d-learn
On Saturday, 28 October 2017 at 19:23:42 UTC, ikod wrote: So default version is "std", I can build it w/o vibe-d, but dub anyway fetch vibe-d. I'd like dub fetch vibe-d only when I build with --config vibed. I know about "optional": true, it prevent dub to fetch vibe-d for "std" config,

Re: Making an .exe that executes source file inside itself.

2018-04-27 Thread evilrat via Digitalmars-d-learn
On Thursday, 26 April 2018 at 10:06:57 UTC, JN wrote: On Wednesday, 25 April 2018 at 19:19:58 UTC, BoQsc wrote: Alternatively, I don't know about specifics how to implement it in D, but the key phrase you are looking for is "code hotswap" or "hot loading". It's being popularized right now in

Re: Passing C++ class to DLL for callbacks from D (Steam)

2018-06-09 Thread evilrat via Digitalmars-d-learn
On Sunday, 10 June 2018 at 01:35:40 UTC, cc wrote: On Saturday, 9 June 2018 at 14:11:13 UTC, evilrat wrote: However steam devs decided to shield actual pointer and return pointer sized integer when C API is used(or they just screw up?). Anyway, the pointers for subsystems returned by context

Re: Passing C++ class to DLL for callbacks from D (Steam)

2018-06-09 Thread evilrat via Digitalmars-d-learn
On Saturday, 9 June 2018 at 03:14:13 UTC, cc wrote: On Saturday, 9 June 2018 at 03:07:39 UTC, cc wrote: I've put together a simplified test program here (124KB): Here is a pastebin of the D source file updated with some additional comments at the end with the callback class definitions from

Re: Runtime introspection, or how to get class members at runtime Fin D

2018-06-07 Thread evilrat via Digitalmars-d-learn
On Wednesday, 6 June 2018 at 13:28:02 UTC, Arafel wrote: I know it might not be the most idiomatic D, but as somebody with mostly a Java background (with some C and just a bit of C++) it seems something really straightforward to me: myObject.getClass().getFields() [2]. Also, I know I could

Re: Runtime introspection, or how to get class members at runtime Fin D

2018-06-07 Thread evilrat via Digitalmars-d-learn
On Thursday, 7 June 2018 at 12:32:26 UTC, Arafel wrote: Thanks for all the answers! Is it possible to register, say, a base class, and have all the subclasses then registered automatically? My idea would be to make it as transparent as possible for the plugin implementation, and also not

Re: Runtime introspection, or how to get class members at runtime Fin D

2018-06-08 Thread evilrat via Digitalmars-d-learn
On Friday, 8 June 2018 at 08:06:27 UTC, Arafel wrote: On Thursday, 7 June 2018 at 13:07:21 UTC, evilrat wrote: I don't think so. It clearly states that children must mixin too, which can mean it just grabs symbols in scope only, and base class has no way of knowing about its subclasses. It

Re: Passing C++ class to DLL for callbacks from D (Steam)

2018-06-08 Thread evilrat via Digitalmars-d-learn
On Friday, 8 June 2018 at 00:55:35 UTC, cc wrote: I've defined it in D, as per https://dlang.org/spec/cpp_interface.html#classes : change this to class, or even abstract class as shown in example extern(C++) { interface CCallbackBase { //this() { m_nCallbackFlags

Re: Passing C++ class to DLL for callbacks from D (Steam)

2018-06-08 Thread evilrat via Digitalmars-d-learn
On Friday, 8 June 2018 at 06:59:51 UTC, cc wrote: On Friday, 8 June 2018 at 02:52:10 UTC, Mike Parker wrote: On Friday, 8 June 2018 at 00:55:35 UTC, cc wrote: class CImpl : CCallbackBase { extern(C++) { If anyone has any insight to provide it would be greatly appreciated, thanks!

Re: Importing struct

2018-08-13 Thread evilrat via Digitalmars-d-learn
On Monday, 13 August 2018 at 12:34:25 UTC, Andrey wrote: Hello, This is my test project: source/app.d source/MyClass.d app.d: import std.stdio; import MyClass; void main(string[] args) { MyClass.MyClass.parse(args); // I want just

Re: Importing struct

2018-08-13 Thread evilrat via Digitalmars-d-learn
On Monday, 13 August 2018 at 12:44:44 UTC, evilrat wrote: Another option to save up on typing is renamed imports import mc = MyClass; mc.MyClass.parse(...) this also should work import mc = MyClass; alias MyClass = mc.MyClass; // make synonym // now it is just MyClass

Re: Importing struct

2018-08-13 Thread evilrat via Digitalmars-d-learn
On Monday, 13 August 2018 at 13:09:24 UTC, Andrey wrote: On Monday, 13 August 2018 at 13:05:28 UTC, evilrat wrote: however the best option is simply avoid naming anything with same name as module. Hmm, I thought that name of class should match name of file... And how to name a file that

Re: Windows 64-bit import library

2018-07-20 Thread evilrat via Digitalmars-d-learn
On Friday, 20 July 2018 at 04:31:38 UTC, Jordan Wilson wrote: On Friday, 20 July 2018 at 01:34:39 UTC, Mike Parker wrote: On Thursday, 19 July 2018 at 21:43:35 UTC, Jordan Wilson wrote: Is there any way I can generate the appropriate lib? Else I think I'll need to get hold of the proper

Re: how to compile D programs without console window

2018-07-14 Thread evilrat via Digitalmars-d-learn
On Saturday, 14 July 2018 at 09:43:48 UTC, Flaze07 wrote: On Saturday, 14 July 2018 at 09:39:21 UTC, rikki cattermole wrote: If you're using dub, throw them into lflags and remove the -L. https://forum.dlang.org/post/gmcsxgfsfnwllploo...@forum.dlang.org hmm, for some unknown reason it says

Re: Is there any tool that will auto publish my changes.

2018-07-16 Thread evilrat via Digitalmars-d-learn
On Sunday, 15 July 2018 at 00:25:22 UTC, Venkat wrote: I am writing a simple vibe.d app. The following is what I do right now. - I make changes. - build - Restart the server. Is there any tool that will auto publish my changes as I save them ? I am using Visual Studio Code. Thanks Venkat

Re: Create D binding for C struct containing templated class

2018-06-28 Thread evilrat via Digitalmars-d-learn
On Thursday, 28 June 2018 at 18:43:11 UTC, Andre Pany wrote: Hi, I try to write a binding for the GRPC core. There is a struct which has some ugly fields: (https://github.com/grpc/grpc/blob/master/src/core/lib/surface/call.cc#L229) struct grpc_call { gpr_refcount ext_ref; gpr_arena*

Re: Create D binding for C struct containing templated class

2018-06-29 Thread evilrat via Digitalmars-d-learn
On Friday, 29 June 2018 at 06:04:10 UTC, Andre Pany wrote: Thanks a lot for the great help. You are right, until now I haven't looked at the include folder, I thought the "surface" folder is the folder with the public api. But it seems also in the include folder, the header files contains

Re: Is there a nice syntax to achieve optional named parameters?

2019-01-18 Thread evilrat via Digitalmars-d-learn
On Friday, 18 January 2019 at 09:39:31 UTC, John Burton wrote: On Thursday, 17 January 2019 at 01:43:42 UTC, SrMordred wrote: struct Config { string title; int width; } struct Window { this(Config config) It likely is a bad idea for a small struct like this but if it

Re: DirectXMath alternative

2018-12-05 Thread evilrat via Digitalmars-d-learn
On Wednesday, 5 December 2018 at 10:52:44 UTC, Guillaume Piolat wrote: On Wednesday, 5 December 2018 at 01:57:53 UTC, evilrat wrote: On Tuesday, 4 December 2018 at 20:41:54 UTC, Guillaume Piolat wrote: On Tuesday, 4 December 2018 at 20:33:07 UTC, John Burton wrote: What is the best alternative

Re: How may I tell dub where to find a C library for linking?

2018-12-09 Thread evilrat via Digitalmars-d-learn
On Monday, 10 December 2018 at 02:59:21 UTC, Pablo De Nápoli wrote: On my system (Debian GNU/Linux 9, 64 bits) the library is in the directory /usr/lib/llvm-6.0/lib/ $ ls -l /usr/lib/llvm-6.0/lib/libLLVM.so lrwxrwxrwx 1 root root 14 oct 24 19:44 /usr/lib/llvm-6.0/lib/libLLVM.so ->

Re: DirectXMath alternative

2018-12-04 Thread evilrat via Digitalmars-d-learn
On Tuesday, 4 December 2018 at 20:41:54 UTC, Guillaume Piolat wrote: On Tuesday, 4 December 2018 at 20:33:07 UTC, John Burton wrote: What is the best alternative for D, assuming there is anything? (I want vector, matrix math for use in D3, things like inverting a matrix, getting perspective

Re: DUB / compiling same source and config to different windows subsystems in 32/64 bit

2019-03-04 Thread evilrat via Digitalmars-d-learn
On Monday, 4 March 2019 at 18:34:09 UTC, Robert M. Münch wrote: Hi, when compiling a minimal Windows GUI app (using WinMain()) and compiling it with DUB, the 32-bit x86 version is a character subsystem EXE (writeln works) and for x86_64 it's a GUI subsystem EXE (writeln doesn't work). Since

Re: DUB / compiling same source and config to different windows subsystems in 32/64 bit

2019-03-05 Thread evilrat via Digitalmars-d-learn
On Tuesday, 5 March 2019 at 05:03:42 UTC, Mike Parker wrote: This has nothing to do with dub, so that’s the wrong place for it. The dmd for windows docs needs to make clear the distinction between the linkers and the differences in behavior, and point to the linked docs for options. I just

Re: DUB / compiling same source and config to different windows subsystems in 32/64 bit

2019-03-04 Thread evilrat via Digitalmars-d-learn
On Tuesday, 5 March 2019 at 03:48:22 UTC, Mike Parker wrote: I stopped using WinMain with D a long time ago. It's not necessary. If you always use `main`, then both linkers will provide you with a console subsystem app by default. That's particularly useful during development. You can add a

Re: how to pass a malloc'd C string over to be managed by the GC

2019-02-27 Thread evilrat via Digitalmars-d-learn
On Thursday, 28 February 2019 at 04:26:47 UTC, Sam Johnson wrote: Update: it seems that all I need to do is GC.addRoot(output); and memory leak goes away. I think I have answered my own question. If you know what you are doing. Otherwise you just postpone troubles due to mixed

Re: use dll's

2019-03-16 Thread evilrat via Digitalmars-d-learn
On Saturday, 16 March 2019 at 15:13:15 UTC, ontrail wrote: On Saturday, 16 March 2019 at 14:18:07 UTC, Andre Pany wrote: On Saturday, 16 March 2019 at 12:53:49 UTC, ontrail wrote: hi, i created a program (windows) and 2 dll's. how do i use the 2 d-language dll's in a d-language program with

Re: Setup help?

2019-02-06 Thread evilrat via Digitalmars-d-learn
On Wednesday, 6 February 2019 at 23:59:07 UTC, Charles wrote: I don't use C++, and I do use Windows, which has me wondering if I'm just missing some normal/exepcted configuration. My most recent attempt I tried to get Native Debug to make VS Code debugging stop on the first line. Instead,

Re: C++ base class needs at least one virtual method

2019-02-05 Thread evilrat via Digitalmars-d-learn
On Tuesday, 5 February 2019 at 14:23:00 UTC, ezneh wrote: Hello While trying to make a 1:1 binding to a C/C++ lib, I got the following issue: I only have access to the .h header file, and in there I have this: class someclass {}; class otherclass : public someclass {}; When trying to

Re: C++ base class needs at least one virtual method

2019-02-06 Thread evilrat via Digitalmars-d-learn
On Wednesday, 6 February 2019 at 07:38:04 UTC, ezneh wrote: Thanks for the trick, I'll try it and see how it goes. Since the class have nothing in them, I just made some "alias otherclass = baseclass" statements and it seems it is working (at least it's compiling, have to really test that

Re: DlangUI print too small on retina screens

2019-04-13 Thread evilrat via Digitalmars-d-learn
On Saturday, 13 April 2019 at 12:00:30 UTC, Joel wrote: Thanks for the reply, but I looked it up, and couldn't work out what I can do. I want to try using the overrideScreenDPI trick. option 1 - using override DPI function: --- // your average hello world UIAppMain()

Re: DlangUI print too small on retina screens

2019-04-12 Thread evilrat via Digitalmars-d-learn
On Friday, 12 April 2019 at 08:39:52 UTC, Joel wrote: I got a new computer (another MacBook Pro, but this one has retina display), now I don't think I can use my main programs (done in DlangUI), without eye strain and having my head close to the screen. I noticed a lot of forked versions of

Re: is there a way to embed python 3.7 code in D program?

2019-05-12 Thread evilrat via Digitalmars-d-learn
On Sunday, 12 May 2019 at 22:36:43 UTC, torea wrote: ok, I'll do some more tests with pyd then. And if I cannot get it to work, I'll have a look at the package! I have project using pyd with python 3.7, that also using ptvsd (visual studio debugger for python package) to allow mixed

Re: is there a way to embed python 3.7 code in D program?

2019-05-12 Thread evilrat via Digitalmars-d-learn
On Monday, 13 May 2019 at 01:35:58 UTC, evilrat wrote: I have project using pyd with python 3.7, that also using ptvsd (visual studio debugger for python package) to allow mixed debugging right inside VS Code. I'll reduce the code and upload somewhere later.

  1   2   >