Re: Load D shared library on windows x64

2018-08-18 Thread Tofu Ninja via Digitalmars-d-learn
On Saturday, 18 August 2018 at 21:10:55 UTC, Tofu Ninja wrote: On Saturday, 18 August 2018 at 11:27:29 UTC, Mike Wey wrote: On 18-08-18 02:31, Tofu Ninja wrote: On Friday, 17 August 2018 at 20:27:05 UTC, Tofu Ninja wrote: Its this part that fails... always returns null HMODULE h =

Re: Load D shared library on windows x64

2018-08-18 Thread Tofu Ninja via Digitalmars-d-learn
On Saturday, 18 August 2018 at 11:27:29 UTC, Mike Wey wrote: On 18-08-18 02:31, Tofu Ninja wrote: On Friday, 17 August 2018 at 20:27:05 UTC, Tofu Ninja wrote: Its this part that fails... always returns null HMODULE h = cast(HMODULE) Runtime.loadLibrary(dllName); if (h is null) {

Re: Load D shared library on windows x64

2018-08-17 Thread Tofu Ninja via Digitalmars-d-learn
On Friday, 17 August 2018 at 20:27:05 UTC, Tofu Ninja wrote: Its this part that fails... always returns null HMODULE h = cast(HMODULE) Runtime.loadLibrary(dllName); if (h is null) { writeln("error loading"); return; } I there any way to see why Runtime.loadLibrary is failing?

Re: Load D shared library on windows x64

2018-08-17 Thread Tofu Ninja via Digitalmars-d-learn
Its this part that fails... always returns null HMODULE h = cast(HMODULE) Runtime.loadLibrary(dllName); if (h is null) { writeln("error loading"); return; }

Load D shared library on windows x64

2018-08-17 Thread Tofu Ninja via Digitalmars-d-learn
Do shared libraries work? I am trying to load a D library into a D program but Runtime.loadLibrary just returns null for me and I am not sure what I am doing wrong. import std.stdio; import std.file : exists, getcwd, rename; import core.thread; import std.conv : to; version(tofu_dynamic){

isFuture

2018-02-18 Thread Tofu Ninja via Digitalmars-d-learn
What is __traits(isFuture)? The language documents says it tests for @future which doesn't really help as @future is undocumented.

Re: TypeInfo_Class.interfaces[n].classinfo has TypeInfo_Class and not TypeInfo_Interface?

2017-12-27 Thread Tofu Ninja via Digitalmars-d
On Sunday, 24 December 2017 at 05:21:44 UTC, Tofu Ninja wrote: I didn't get any response in learn for this so I will ask it here. TypeInfo_Class.interfaces[n].classinfo has TypeInfo_Class and not TypeInfo_Interface? Is this correct? Or is it a bug? Doesn't make much sense to me. Also the

TypeInfo_Class.interfaces[n].classinfo has TypeInfo_Class and not TypeInfo_Interface?

2017-12-23 Thread Tofu Ninja via Digitalmars-d
I didn't get any response in learn for this so I will ask it here. TypeInfo_Class.interfaces[n].classinfo has TypeInfo_Class and not TypeInfo_Interface? Is this correct? Or is it a bug? Doesn't make much sense to me. Also the following code prints false so there are some consequences to

Re: TypeInfo_Class.interfaces has TypeInfo_Class and not TypeInfo_Interface?

2017-12-15 Thread Tofu Ninja via Digitalmars-d-learn
On Friday, 15 December 2017 at 05:19:04 UTC, Tofu Ninja wrote: TypeInfo_Class.interfaces has TypeInfo_Class and not TypeInfo_Interface? Is this correct? Or is it a bug? Doesn't make much sense to me. Also the following code prints false so there are some consequences to this. import

TypeInfo_Class.interfaces has TypeInfo_Class and not TypeInfo_Interface?

2017-12-14 Thread Tofu Ninja via Digitalmars-d-learn
TypeInfo_Class.interfaces has TypeInfo_Class and not TypeInfo_Interface? Is this correct? Or is it a bug? Doesn't make much sense to me.

Re: Open Scene Graph For D?

2017-12-11 Thread Tofu ninja via Digitalmars-d-learn
On Thursday, 7 December 2017 at 19:30:13 UTC, Tofu ninja wrote: Is there a binding for it? Just a question, trying to convince people at work to use D and that is something they asked about. Guess not

Open Scene Graph For D?

2017-12-07 Thread Tofu ninja via Digitalmars-d-learn
Is there a binding for it? Just a question, trying to convince people at work to use D and that is something they asked about.

Re: Debugging shared libs on windows

2017-12-07 Thread Tofu ninja via Digitalmars-d-learn
On Wednesday, 6 December 2017 at 22:59:17 UTC, user1234 wrote: On Wednesday, 6 December 2017 at 21:17:55 UTC, Tofu ninja wrote: On Wednesday, 6 December 2017 at 21:12:20 UTC, Tofu ninja wrote: I am compiling with -m64 -shared -debug -g and a .pdb is generated but visual studio says the dll was

Re: Debugging shared libs on windows

2017-12-06 Thread Tofu ninja via Digitalmars-d-learn
On Wednesday, 6 December 2017 at 21:12:20 UTC, Tofu ninja wrote: I am compiling with -m64 -shared -debug -g and a .pdb is generated but visual studio says the dll was not compiled with debug information, am I missing something or is this not supported? DMD32 D Compiler v2.076.0 Actually

Debugging shared libs on windows

2017-12-06 Thread Tofu ninja via Digitalmars-d-learn
I am compiling with -m64 -shared -debug -g and a .pdb is generated but visual studio says the dll was not compiled with debug information, am I missing something or is this not supported? DMD32 D Compiler v2.076.0

Re: D jobs?

2017-11-25 Thread Tofu Ninja via Digitalmars-d
On Saturday, 25 November 2017 at 22:55:00 UTC, Ali Çehreli wrote: On 11/25/2017 05:16 AM, Tofu Ninja wrote: >if anyone is in the bay area and is in a position to higher I'm not in a position to hire but I know networking is very effective in finding jobs.

Re: D jobs?

2017-11-25 Thread Tofu Ninja via Digitalmars-d
On Saturday, 25 November 2017 at 16:51:37 UTC, Mark wrote: On Saturday, 25 November 2017 at 13:16:19 UTC, Tofu Ninja wrote: Are there any places to look for D jobs? It seems really hard to find anything online. I got a really crappy job doing C++ and hate it to bits. Also if anyone is in the

Re: D jobs?

2017-11-25 Thread Tofu Ninja via Digitalmars-d
On Saturday, 25 November 2017 at 13:49:09 UTC, bauss wrote: On Saturday, 25 November 2017 at 13:16:19 UTC, Tofu Ninja wrote: Are there any places to look for D jobs? It seems really hard to find anything online. I got a really crappy job doing C++ and hate it to bits. Also if anyone is in the

Re: D jobs?

2017-11-25 Thread Tofu Ninja via Digitalmars-d
On Saturday, 25 November 2017 at 13:16:19 UTC, Tofu Ninja wrote: Are there any places to look for D jobs? It seems really hard to find anything online. I got a really crappy job doing C++ and hate it to bits. Also if anyone is in the bay area and is in a position to higher maybe check out this

D jobs?

2017-11-25 Thread Tofu Ninja via Digitalmars-d
Are there any places to look for D jobs? It seems really hard to find anything online. I got a really crappy job doing C++ and hate it to bits. Also if anyone is in the bay area and is in a position to higher maybe check out this project I have been working on in my free time, its a small game

Re: Windows X64 Calling conventions

2017-04-20 Thread Tofu Ninja via Digitalmars-d-learn
On Thursday, 20 April 2017 at 08:36:32 UTC, kinke wrote: On Thursday, 20 April 2017 at 01:16:11 UTC, Tofu Ninja wrote: My question is, why is it passed twice, both in xmm0 and rcx? The MSDN docs say floating point are passed in xmm registers, why is it also copied in into rcx? Is it necessary

Windows X64 Calling conventions

2017-04-19 Thread Tofu Ninja via Digitalmars-d-learn
I am trying to learn the calling conventions in DMD, I am sure I will have more than one question about them so as I come across them I will ask them in this thread. I am mainly reading the MSDN docs on the x64 calls and looking at disassemblies to confirm what I learn. While I was looking

Get method address from alias?

2017-04-11 Thread Tofu Ninja via Digitalmars-d-learn
I only have an alias to the method without a this pointer, is there any way to get the address? Something like struct T{ void foo(){} } alias A = Alias!(__traits(getMemeber, T, "foo")); void* A_addres = ? // Somehow get the address from A

Re: dub subpackage output to shared lib not working

2017-01-26 Thread Tofu Ninja via Digitalmars-d-learn
On Thursday, 26 January 2017 at 19:01:41 UTC, Tofu Ninja wrote: Actually.. if I do dub describe on the root package it lists both the exe and the lib as targets but the build settings for the lib has "targetType": 6 which according to dub/source/dub/compilers/buildsettings.d is

Re: dub subpackage output to shared lib not working

2017-01-26 Thread Tofu Ninja via Digitalmars-d-learn
On Thursday, 26 January 2017 at 18:26:27 UTC, Tofu Ninja wrote: On Thursday, 26 January 2017 at 18:10:12 UTC, Tofu Ninja wrote: On Thursday, 26 January 2017 at 18:00:57 UTC, Tofu Ninja wrote: Is this not doable? I guess an alternative question, is there any way to have multiple binaries(an

Re: dub subpackage output to shared lib not working

2017-01-26 Thread Tofu Ninja via Digitalmars-d-learn
On Thursday, 26 January 2017 at 18:10:12 UTC, Tofu Ninja wrote: On Thursday, 26 January 2017 at 18:00:57 UTC, Tofu Ninja wrote: Is this not doable? I guess an alternative question, is there any way to have multiple binaries(an executable and a bunch of shared libs) built from a single dub

Re: dub subpackage output to shared lib not working

2017-01-26 Thread Tofu Ninja via Digitalmars-d-learn
On Thursday, 26 January 2017 at 18:00:57 UTC, Tofu Ninja wrote: Is this not doable? I guess an alternative question, is there any way to have multiple binaries(an executable and a bunch of shared libs) built from a single dub package? Or should I just give up on trying to use dub for

Re: dub subpackage output to shared lib not working

2017-01-26 Thread Tofu Ninja via Digitalmars-d-learn
On Sunday, 22 January 2017 at 08:16:49 UTC, Tofu Ninja wrote: Trying to get a dub sub package to output as a shared lib but for some reason I can only get it to output as a static lib. dub.json --- { "name": "tofueng", "targetType": "executable", "targetPath" : "game",

dub subpackage output to shared lib not working

2017-01-22 Thread Tofu Ninja via Digitalmars-d-learn
Trying to get a dub sub package to output as a shared lib but for some reason I can only get it to output as a static lib. dub.json --- { "name": "tofueng", "targetType": "executable", "targetPath" : "game", "sourcePaths": ["eng"], "importPaths": ["eng"],

Re: Proper generic way to get the hash of something?

2016-12-03 Thread Tofu Ninja via Digitalmars-d-learn
Well for now I am going to revert back to 2.071.2, 2.072 seems broke as fuck.

Re: Proper generic way to get the hash of something?

2016-12-03 Thread Tofu Ninja via Digitalmars-d-learn
Actually better question, why was this breaking change allowed? The semantics of hashOf have completely changed, why was this done??

Proper generic way to get the hash of something?

2016-12-03 Thread Tofu Ninja via Digitalmars-d-learn
What is the proper generic way to get the hash of something? It seems that hashOf has been changed to no longer call toHash on anything Just blindly casts to void[]. It actually seems now toHash doesn't call any of the specializations of core.internal.hash.hashOf except the one for void[].

Re: Given two AliasSeq (A and B) and template T, how to make AliasSeq!(T!(A[0], B[0]) ... T!(A[n], B[n])) ?

2016-11-27 Thread Tofu Ninja via Digitalmars-d-learn
On Sunday, 27 November 2016 at 07:38:53 UTC, Nicholas Wilson wrote: Whoops it would help if I read your question. You want to use Iota in conjunction with staticMap. alias pairs(int N, alias a, alias b) = AliasSeq(a[N],b[N]); alias C = staticMap!(T,staticMap(pairs,Iota!N)); That didn't

Given two AliasSeq (A and B) and template T, how to make AliasSeq!(T!(A[0], B[0]) ... T!(A[n], B[n])) ?

2016-11-26 Thread Tofu Ninja via Digitalmars-d-learn
Basically the title says it all. alias A = AliasSeq!(...); alias B = AliasSeq!(...); static assert(A.length == B.length); template T(An, Bn){ ... } alias C = AliasSeq!(T!(A[0], B[0]) ... T!(A[n], B[n])); // how to make this :/ How do I actually make the sequence C?

Re: How to declare function with the same call signature as another?

2016-11-23 Thread Tofu Ninja via Digitalmars-d-learn
On Thursday, 24 November 2016 at 02:11:21 UTC, ketmar wrote: On Thursday, 24 November 2016 at 00:51:01 UTC, Tofu Ninja wrote: Even with std.traits, you can't know which arguments are variadic. sure, you can. see http://dpldocs.info/experimental-docs/std.traits.variadicFunctionStyle.html that

Re: How to declare function with the same call signature as another?

2016-11-23 Thread Tofu Ninja via Digitalmars-d-learn
On Thursday, 24 November 2016 at 00:36:54 UTC, ketmar wrote: On Thursday, 24 November 2016 at 00:19:04 UTC, Tofu Ninja wrote: You still can't replicate a function with this. you can, by using std.traits and string mixins. Even with std.traits, you can't know which arguments are variadic.

Re: How to declare function with the same call signature as another?

2016-11-23 Thread Tofu Ninja via Digitalmars-d-learn
On Thursday, 24 November 2016 at 00:15:07 UTC, ketmar wrote: On Thursday, 24 November 2016 at 00:04:51 UTC, Tofu Ninja wrote: On Wednesday, 23 November 2016 at 23:21:53 UTC, ketmar wrote: On Wednesday, 23 November 2016 at 23:02:30 UTC, Tofu Ninja wrote: Being able to get an alias to (ref int)

Re: How to declare function with the same call signature as another?

2016-11-23 Thread Tofu Ninja via Digitalmars-d-learn
On Wednesday, 23 November 2016 at 23:21:53 UTC, ketmar wrote: On Wednesday, 23 November 2016 at 23:02:30 UTC, Tofu Ninja wrote: Being able to get an alias to (ref int) seems like a bug. you are unable to alias it, `ref` will be erased on aliasing. the only way to retain it is to have a tuple

Re: How to declare function with the same call signature as another?

2016-11-23 Thread Tofu Ninja via Digitalmars-d-learn
On Wednesday, 23 November 2016 at 22:48:17 UTC, ketmar wrote: On Wednesday, 23 November 2016 at 22:28:57 UTC, Tofu Ninja wrote: On Wednesday, 23 November 2016 at 22:19:28 UTC, ketmar wrote: On Wednesday, 23 November 2016 at 22:14:25 UTC, Tofu Ninja wrote: What is a (ref int)? A tuple with "ref

Re: How to declare function with the same call signature as another?

2016-11-23 Thread Tofu Ninja via Digitalmars-d-learn
On Wednesday, 23 November 2016 at 22:19:28 UTC, ketmar wrote: On Wednesday, 23 November 2016 at 22:14:25 UTC, Tofu Ninja wrote: What is a (ref int)? A tuple with "ref int" as its only member? Since when is ref int a type? it is "type with modifier", like "const int" or "immutable int".

Re: How to declare function with the same call signature as another?

2016-11-23 Thread Tofu Ninja via Digitalmars-d-learn
On Sunday, 20 November 2016 at 12:06:15 UTC, Tofu Ninja wrote: On Sunday, 20 November 2016 at 11:52:01 UTC, Tofu Ninja wrote: ... Also does not include function linkage :/ Because of the lack of response, I am going to guess there is no way to do this cleanly. Guess I am going to have to

Re: How to declare function with the same call signature as another?

2016-11-20 Thread Tofu Ninja via Digitalmars-d-learn
On Sunday, 20 November 2016 at 11:52:01 UTC, Tofu Ninja wrote: ... Also does not include function linkage :/

Re: How to declare function with the same call signature as another?

2016-11-20 Thread Tofu Ninja via Digitalmars-d-learn
On Sunday, 20 November 2016 at 11:23:37 UTC, Nicholas Wilson wrote: On Sunday, 20 November 2016 at 11:19:24 UTC, Tofu Ninja wrote: I feel like this should be simple but I can't seem to figure it out. How do I declare a function to have the same call signature as another function/callable type?

How to declare function with the same call signature as another?

2016-11-20 Thread Tofu Ninja via Digitalmars-d-learn
I feel like this should be simple but I can't seem to figure it out. How do I declare a function to have the same call signature as another function/callable type? Like if I have: alias Sig = int function(int x, int y); How do I define a function such that it will have the same call

Status of static control flow? static foreach?

2016-09-13 Thread Tofu Ninja via Digitalmars-d
Sorry, I have not kept up in the forums for a while. Was just curious on what the current status of static control flow was for D. The only one I have heard about was static foreach, what happend, are we going to get it? We have static if, are we going to get other static control flow like

Re: VisualD core.exception.RangeError@pipedmd(286): Range violation

2016-09-08 Thread Tofu Ninja via Digitalmars-d-learn
On Thursday, 8 September 2016 at 19:56:45 UTC, Rainer Schuetze wrote: I think I fixed both issues in this build: https://ci.appveyor.com/project/rainers/visuald/build/1.0.76/job/kq0a5bqpy7anou46/artifacts Well that was fast :) It does appear to be fixed on my machine, thanks a lot for the

Re: VisualD core.exception.RangeError@pipedmd(286): Range violation

2016-09-08 Thread Tofu Ninja via Digitalmars-d-learn
On Thursday, 8 September 2016 at 07:45:56 UTC, Rainer Schuetze wrote: Fixed it again. You can find a prebuilt binary of pipedmd.exe here: https://ci.appveyor.com/project/rainers/visuald/build/1.0.75/job/n9tf67jxcir6kpmg/artifacts Thanks for the response, I think there is more going on than

VisualD core.exception.RangeError@pipedmd(286): Range violation

2016-09-05 Thread Tofu Ninja via Digitalmars-d-learn
I get "core.exception.RangeError@pipedmd(286): Range violation" whenever I try to build from visual D. Is there any workaround for this? It was reported[1] almost 9 months ago, does not seem like it's going to be fixed anytime soon. Visual D is completely broken for me right now because of

Re: dub generate visuald

2016-09-05 Thread Tofu Ninja via Digitalmars-d-learn
On Monday, 5 September 2016 at 19:03:00 UTC, Tofu Ninja wrote: On Monday, 5 September 2016 at 17:25:45 UTC, Tofu Ninja wrote: I am not sure what changed but I can no longer build using visuald after generating from dub. When I try to build from visual studio I get the following error LINK :

Re: dub generate visuald

2016-09-05 Thread Tofu Ninja via Digitalmars-d-learn
On Monday, 5 September 2016 at 17:25:45 UTC, Tofu Ninja wrote: I am not sure what changed but I can no longer build using visuald after generating from dub. When I try to build from visual studio I get the following error LINK : warning LNK4001: no object files specified; libraries used

Re: dub generate visuald

2016-09-05 Thread Tofu Ninja via Digitalmars-d-learn
On Monday, 5 September 2016 at 18:22:02 UTC, Guillaume Piolat wrote: On Monday, 5 September 2016 at 17:25:45 UTC, Tofu Ninja wrote: I can build directly from dub with no problem, but building from VS gives that error. Building with dub uses the dmd settings in sc.ini Building with VisualD

Re: Unicode function name? ∩

2016-08-27 Thread Tofu Ninja via Digitalmars-d-learn
On Sunday, 28 August 2016 at 05:28:17 UTC, rikki cattermole wrote: On 28/08/2016 5:21 PM, Tofu Ninja wrote: ... Try Ÿ. Yeah Ÿ and π both work but ∩ does not. I think I found my answer though... http://dlang.org/spec/lex.html#IdentifierChar Identifiers start with a letter, _, or universal

Re: Unicode function name? ∩

2016-08-27 Thread Tofu Ninja via Digitalmars-d-learn
On Sunday, 28 August 2016 at 05:21:03 UTC, Tofu Ninja wrote: ... Also visual D seems to recognize its not a valid character and highlights the error which makes me think its known behavior.

Re: Unicode function name? ∩

2016-08-27 Thread Tofu Ninja via Digitalmars-d-learn
On Sunday, 28 August 2016 at 05:21:03 UTC, Tofu Ninja wrote: Are unicode function names not supported in dmd? bool ∩(A, B)(A a, B b){ return intersect(a, b); } Error: character 0x2229 is not a valid token I won't be terribly disappointed if I can't do this, I really just tried it on a

Unicode function name? ∩

2016-08-27 Thread Tofu Ninja via Digitalmars-d-learn
Are unicode function names not supported in dmd? bool ∩(A, B)(A a, B b){ return intersect(a, b); } Error: character 0x2229 is not a valid token I won't be terribly disappointed if I can't do this, I really just tried it on a whim, but I thought dmd supported unicode.

Possible range idiom that I find useful, especially in @nogc

2016-08-25 Thread Tofu Ninja via Digitalmars-d
So this is a small thing but I find it definitely useful in my own ranges and wished the ranges in phobos did this. A lot of ranges in phobos take an alias to a function and somehow use that to generate the output range, for example map. But it can be annoying when your map function needs

Using shared libraries for external scripts, looking for advice (windows)

2016-08-15 Thread Tofu Ninja via Digitalmars-d-learn
So this is kind of an open ended question, just looking for advice on doing it in general, if it's possible, and doing it specifically in D on windows. I am not super familiar with how shared libraries work so I had some questions. I would like to attempt to use D to write scripts for a game

Re: DIP: Tail call optimization

2016-07-11 Thread Tofu Ninja via Digitalmars-d-announce
On Sunday, 10 July 2016 at 13:15:38 UTC, Andrew Godfrey wrote: Btw here's a thread from 2014 that touches on the idea of a "tailrec" annotation. At the time, Walter viewed the optimization as the compiler's business and not something he'd elevate to a language feature:

Re: DIP: Tail call optimization

2016-07-10 Thread Tofu Ninja via Digitalmars-d-announce
On Sunday, 10 July 2016 at 06:39:06 UTC, ketmar wrote: On Sunday, 10 July 2016 at 06:37:18 UTC, ketmar wrote: On Sunday, 10 July 2016 at 06:20:59 UTC, Seb wrote: ... guys, please stay friendly, constructive and polite! I thought we are all grown-ups here! i do. someone who is not able to

Re: Why is ElementType!(char[]) == dchar?

2016-07-09 Thread Tofu Ninja via Digitalmars-d-learn
On Saturday, 9 July 2016 at 11:35:24 UTC, Tofu Ninja wrote: On Saturday, 9 July 2016 at 11:29:18 UTC, ketmar wrote: On Saturday, 9 July 2016 at 11:24:01 UTC, Tofu Ninja wrote: Seems pretty silly to me... due to universally beloved autodecoding. Hmmm... I dont really know the history of

Re: Why is ElementType!(char[]) == dchar?

2016-07-09 Thread Tofu Ninja via Digitalmars-d-learn
On Saturday, 9 July 2016 at 11:29:18 UTC, ketmar wrote: On Saturday, 9 July 2016 at 11:24:01 UTC, Tofu Ninja wrote: Seems pretty silly to me... due to universally beloved autodecoding. Hmmm... I dont really know the history of autodecoding, why was that supposed to be a good idea?

Why is ElementType!(char[]) == dchar?

2016-07-09 Thread Tofu Ninja via Digitalmars-d-learn
Seems pretty silly to me...

Re: Logical location of template instantiations

2016-07-07 Thread Tofu Ninja via Digitalmars-d
On Thursday, 7 July 2016 at 12:39:51 UTC, Steven Schveighoffer wrote: Yes, it is a problem. I still don't understand how the *calling* of a private function is the problem, vs. the aliasing of it. Why aren't we preventing the aliasing of the private function in the first place (if not

Re: Logical location of template instantiations

2016-07-07 Thread Tofu Ninja via Digitalmars-d
On Friday, 1 July 2016 at 19:13:45 UTC, Steven Schveighoffer wrote: Emplace needs a constructor alias parameter. -Steve That wouldn't work as emplace wouldn't be able to use the alias if it was private... void main(){ import other; test!foo(); } private void foo(){} ##

Re: Blocking points for further D adoption

2016-07-06 Thread Tofu Ninja via Digitalmars-d
You know I just had an idea for documentation that might be nice. Why not make all the examples interactive like the "Your code here" box on the front page? We have the technology, could be cool.

Re: Is dmd fast?

2016-07-06 Thread Tofu Ninja via Digitalmars-d
On Wednesday, 6 July 2016 at 19:12:23 UTC, ketmar wrote: On Wednesday, 6 July 2016 at 08:13:01 UTC, Tofu Ninja wrote: On Wednesday, 6 July 2016 at 05:46:20 UTC, ketmar wrote: On Wednesday, 6 July 2016 at 05:38:25 UTC, Tofu Ninja wrote: dmd seems pretty fast to me. add "-O -inline" and go to

Re: Should templates have the instantiating scope's protection access rights?

2016-07-06 Thread Tofu Ninja via Digitalmars-d
On Wednesday, 6 July 2016 at 08:05:38 UTC, Lodovico Giaretta wrote: Thinking about this, maybe the choice about attributes should be made by the user, so that if I want to give emplace access to private ctors of my structs, I have to explicitly declare inside my module that I'm going to give

Re: Is dmd fast?

2016-07-06 Thread Tofu Ninja via Digitalmars-d
On Wednesday, 6 July 2016 at 05:46:20 UTC, ketmar wrote: On Wednesday, 6 July 2016 at 05:38:25 UTC, Tofu Ninja wrote: dmd seems pretty fast to me. add "-O -inline" and go to bed. ;-) Went up to about 18s for a full rebuild of the project and the dub dependencies, I am ok with these times

Re: Should templates have the instantiating scope's protection access rights?

2016-07-06 Thread Tofu Ninja via Digitalmars-d
On Wednesday, 6 July 2016 at 06:43:13 UTC, ZombineDev wrote: Using mixin templates you can get the behavior you want to some extent, with exception that you need to type "mixin" in front when you're instantiating them. I wonder if reusing the mixin statement for normal templates would be a

Re: Blocking points for further D adoption

2016-07-06 Thread Tofu Ninja via Digitalmars-d
On Wednesday, 6 July 2016 at 07:10:07 UTC, Puming wrote: It's been suggested that DMD/LDC/GDC could be combined into a bundle, say DCC, and when you call DCC hello.d it will call dmd hello.d, and if you call DCC -fast hello.d it will call ldc hello.d or gdc hello.d This will give

Re: Blocking points for further D adoption

2016-07-06 Thread Tofu Ninja via Digitalmars-d
You know what's kinda sad, there are only 2,052 question on SO with the "d" tag. I think if more d questions could be answered on SO then it would make googling d related things a lot easier. Another problem with SO is that it uses "d" instead of "dlang", "dlang" is generally better for

Re: Is dmd fast?

2016-07-05 Thread Tofu Ninja via Digitalmars-d
On Wednesday, 22 June 2016 at 19:56:26 UTC, Adam D. Ruppe wrote: On Wednesday, 22 June 2016 at 19:25:13 UTC, Jack Stouffer wrote: So if linking is slow, then compilation is slow. But, 1/3 second isn't slow... I don't feel compilation is slow until it takes more like 5 seconds. Certainly,

Re: Should templates have the instantiating scope's protection access rights?

2016-07-05 Thread Tofu Ninja via Digitalmars-d
On Tuesday, 5 July 2016 at 18:48:05 UTC, Tofu Ninja wrote: Also there could be code re-use wherever the access rights match. So if an argument is marked as opt-in, only the instantiation scope's access to that argument would need to be tied to the template instantiation. I suppose that means

Re: Should templates have the instantiating scope's protection access rights?

2016-07-05 Thread Tofu Ninja via Digitalmars-d
On Tuesday, 5 July 2016 at 18:04:31 UTC, Steven Schveighoffer wrote: The clear problem with this solution is that this means you must use the instantiating module as part of the template definition. A template instantiation with exactly the same parameters must behave exactly the same, no

Should templates have the instantiating scope's protection access rights?

2016-07-05 Thread Tofu Ninja via Digitalmars-d
Sorry if this has been posted before. One thing that constantly bugs me about D is how the protection system works when using templates. Currently the a template instantiation has the protection rights from the declaration scope, but this is not really congruent with how a lot of templates

Re: Real implicitly converts to float?

2016-06-24 Thread Tofu Ninja via Digitalmars-d-learn
On Friday, 24 June 2016 at 20:10:16 UTC, Tofu Ninja wrote: I am glad I was not the only one who thought that sounded a little crazy... I thought D was supposed to be type safe. I think I will make a bug report and see where that goes. https://issues.dlang.org/show_bug.cgi?id=16202

Re: Real implicitly converts to float?

2016-06-24 Thread Tofu Ninja via Digitalmars-d-learn
On Friday, 24 June 2016 at 08:52:48 UTC, Ola Fosheim Grøstad wrote: This is so wrong. _especially_ when you have parameter overloading/templates. It means that you accidentally can trash a computation by getting the wrong function. That is not type-safe in my book. Jonathan's max-value

Re: Real implicitly converts to float?

2016-06-23 Thread Tofu Ninja via Digitalmars-d-learn
On Thursday, 23 June 2016 at 15:25:49 UTC, Steven Schveighoffer wrote: I disagree. I've used languages where converting floating point types is not implicit, and it's painful. Most of the time, the loss in precision isn't important. -Steve Which is why a flag would be nice, for some

Re: Real implicitly converts to float?

2016-06-23 Thread Tofu Ninja via Digitalmars-d-learn
On Thursday, 23 June 2016 at 13:57:57 UTC, Steven Schveighoffer wrote: Whenever you work with floating point, the loss of precision must be expected -- a finite type cannot represent an infinite precision number. The loss in precision should still be a warning. If I am using reals then I

Re: Real implicitly converts to float?

2016-06-22 Thread Tofu Ninja via Digitalmars-d-learn
On Wednesday, 22 June 2016 at 14:17:42 UTC, Jonathan M Davis wrote: Well, that particular value should probably work thanks to VRP (value range propagation), since 10 can fit into float with no loss of precision. However, what's far more disconcerting is that real x = real.max; float y = x;

Re: Real implicitly converts to float?

2016-06-22 Thread Tofu Ninja via Digitalmars-d-learn
On Wednesday, 22 June 2016 at 08:57:38 UTC, Guillaume Piolat wrote: On Wednesday, 22 June 2016 at 05:04:42 UTC, Tofu Ninja wrote: Is this intended behavior? I can't seem to find it documented anywhere, I would think the loss in precision would atleast be a warning. real x = 10; float y = x;

Real implicitly converts to float?

2016-06-21 Thread Tofu Ninja via Digitalmars-d-learn
Is this intended behavior? I can't seem to find it documented anywhere, I would think the loss in precision would atleast be a warning. real x = 10; float y = x; // No error or warning real to double and double to float also work.

Unwanted moves in d and intrusive data structures

2016-06-19 Thread Tofu Ninja via Digitalmars-d
Figured I would link this because no one responded on Reddit, I did not make the post, just linking. https://www.reddit.com/r/d_language/comments/4oohgl/unwanted_moves_in_d_and_intrusive_data_structures/

Re: Dub generate visuald, multiple configurations?

2016-06-19 Thread Tofu Ninja via Digitalmars-d-learn
On Friday, 17 June 2016 at 08:49:47 UTC, Tofu Ninja wrote: Is there a way to generate a single visuald project file for all dub configurations, selecting the configuration from the visual studio configuration manager? Or do I have to generate a separate project for each configuration? I am

Dub generate visuald, multiple configurations?

2016-06-17 Thread Tofu Ninja via Digitalmars-d-learn
Is there a way to generate a single visuald project file for all dub configurations, selecting the configuration from the visual studio configuration manager? Or do I have to generate a separate project for each configuration?

Re: Are __gshared globals gc scanned?

2016-06-14 Thread Tofu Ninja via Digitalmars-d-learn
On Tuesday, 14 June 2016 at 13:53:10 UTC, ketmar wrote: __gshared globals are gc scanned. Ah cool, thanks I had to login to my work computer just to read your answer lol

Are __gshared globals gc scanned?

2016-06-14 Thread Tofu Ninja via Digitalmars-d-learn
Title says it all...

Re: [OT] Are there any jobs for D?

2016-05-03 Thread Tofu Ninja via Digitalmars-d
On Monday, 2 May 2016 at 23:32:26 UTC, Vladimir Panteleev wrote: On Monday, 2 May 2016 at 23:15:05 UTC, Brian Schott wrote: On Monday, 2 May 2016 at 23:08:02 UTC, Tofu Ninja wrote: I am going to be graduating soon and figured it would be cool to see if there were any jobs for D. Where would

[OT] Are there any jobs for D?

2016-05-02 Thread Tofu Ninja via Digitalmars-d
I am going to be graduating soon and figured it would be cool to see if there were any jobs for D. Where would one look?

Re: aquivalent to pragma comment

2016-04-29 Thread Tofu Ninja via Digitalmars-d
On Thursday, 28 April 2016 at 16:05:39 UTC, andi wrote: aquivalent Also fyi, it should be equivalent, not aquivalent. I don't think aquivalent is an english word.

Re: Shallow copy object when type is know

2016-04-20 Thread Tofu Ninja via Digitalmars-d-learn
On Wednesday, 20 April 2016 at 18:48:58 UTC, Alex Parrill wrote: On Wednesday, 20 April 2016 at 12:32:48 UTC, Tofu Ninja wrote: Is there a way to shallow copy an object when the type is known? I cant seem to figure out if there is a standard way. I can't just implement a copy function for the

Shallow copy object when type is know

2016-04-20 Thread Tofu Ninja via Digitalmars-d-learn
Is there a way to shallow copy an object when the type is known? I cant seem to figure out if there is a standard way. I can't just implement a copy function for the class, I need a generic solution.

Re: Anonymous structure

2016-04-19 Thread Tofu Ninja via Digitalmars-d-learn
On Tuesday, 19 April 2016 at 16:16:39 UTC, ZombineDev wrote: On Monday, 18 April 2016 at 23:00:42 UTC, captaindet wrote: On 2016-04-18 14:12, Tofu Ninja wrote: Also is there a way to have a named substructure, not a nested structure but something to just add an additional name, maybe something

Re: Anonymous structure

2016-04-19 Thread Tofu Ninja via Digitalmars-d-learn
On Monday, 18 April 2016 at 23:00:42 UTC, captaindet wrote: not sure what you mean by "named substructure, not a nested structure" but this works: struct Outer{ struct Inner{ int x; int y; int z; } Inner inner; int

Re: Anonymous structure

2016-04-17 Thread Tofu Ninja via Digitalmars-d-learn
On Monday, 18 April 2016 at 03:33:53 UTC, Adam D. Ruppe wrote: The struct inside union is the main pure-language use case I know of though. Actually curiously I found another potential use, applying attributes/UDAs to multiple members at once. enum testUDA; struct T{ @testUDA

Re: Anonymous structure

2016-04-17 Thread Tofu Ninja via Digitalmars-d-learn
On Monday, 18 April 2016 at 03:33:53 UTC, Adam D. Ruppe wrote: The struct inside union is the main pure-language use case I know of though. I understand the reason for allowing it in a union, I just don't see the reason it was extended to all aggregates as it seems to do nothing.

Re: Anonymous structure

2016-04-17 Thread Tofu Ninja via Digitalmars-d-learn
On Monday, 18 April 2016 at 02:42:15 UTC, Nicholas Wilson wrote: On Monday, 18 April 2016 at 02:12:24 UTC, Tofu Ninja wrote: Just out of curiosity, what is the point of the following? struct a{ struct{ int x; int y; int z; } } As

Anonymous structure

2016-04-17 Thread Tofu Ninja via Digitalmars-d-learn
Just out of curiosity, what is the point of the following? struct a{ struct{ int x; int y; int z; } } As far as I can tell, the anonymous structure does nothing. How is it different from struct a{ int x; int y;

Implicit conversion from string to custom type?

2016-02-14 Thread Tofu Ninja via Digitalmars-d-learn
So I wrote a simple ref counted string type because using the built in strings without the GC is extremely painful. It there any way I can get strings to implicitly convert to my custom string type? Some way to make this work... struct rstring {...} void fun(rstring s) {...} ... fun("hello

How is the TypeInfo assigned?

2016-02-13 Thread Tofu Ninja via Digitalmars-d-learn
Is the TypeInfo given by typeid() guaranteed to be the same for a type regardless of where I call it? I guess my question is, is the TypeInfo a valid way to dynamically check types? I am implementing a message passing system for an entity-component system, I was planning to use structs as

  1   2   3   4   5   >