D4M In D?

2018-05-05 Thread IntegratedDimensions via Digitalmars-d
http://www.mit.edu/~kepner/D4M/ Anyone?

Re: auto: useful, annoying or bad practice?

2018-05-06 Thread IntegratedDimensions via Digitalmars-d
On Monday, 30 April 2018 at 21:11:07 UTC, Gerald wrote: I'll freely admit I haven't put a ton of thought into this post (never a good start), however I'm genuinely curious what people's feeling are with regards to the auto keyword. Speaking for myself, I dislike the auto keyword. Some of this

Re: DIP 1011 library alternative

2018-05-17 Thread IntegratedDimensions via Digitalmars-d
On Tuesday, 15 May 2018 at 21:25:05 UTC, Andrei Alexandrescu wrote: Hello, I was reviewing again DIP 1011 and investigated a library solution. That led to https://gist.github.com/run-dlang/18845c9df3d73e45c945feaccfebfcdc It builds on the opening examples in:

do not include sc.ini in zip files!

2018-05-17 Thread IntegratedDimensions via Digitalmars-d
Any custom modification swill overwrite the original sc.ini file. The compiler should copy(rename) or create the file on demand when it is ran and does not exist in the same path as the compiler. This way one can unzip over a previous install without losing the original sc.ini file. It is a

http://asm.dlang.org/ needs updating

2018-05-20 Thread IntegratedDimensions via Digitalmars-d
load and save are not working, an example is always compiled in. No code in the input box still shows examples code in the disassembly.

Re: GDC Explorer - an online disassembler for D

2018-05-20 Thread IntegratedDimensions via Digitalmars-d
On Friday, 21 September 2012 at 03:46:12 UTC, Andrei Alexandrescu wrote: I've met Matt Goldbolt, the author of the GCC Explorer at http://gcc.godbolt.org - a very handy online disassembler for GCC. We got to talk a bit about D and he hacked together support for D by using gdc. Take a look at

Re: http://asm.dlang.org/ needs updating

2018-05-21 Thread IntegratedDimensions via Digitalmars-d
On Monday, 21 May 2018 at 20:29:13 UTC, Steven Schveighoffer wrote: On 5/20/18 12:47 PM, IntegratedDimensions wrote: load and save are not working, an example is always compiled in. No code in the input box still shows examples code in the disassembly. Why do we even have asm.dlang.org any

Re: http://asm.dlang.org/ needs updating

2018-05-21 Thread IntegratedDimensions via Digitalmars-d
On Monday, 21 May 2018 at 20:29:13 UTC, Steven Schveighoffer wrote: On 5/20/18 12:47 PM, IntegratedDimensions wrote: load and save are not working, an example is always compiled in. No code in the input box still shows examples code in the disassembly. Why do we even have asm.dlang.org any

run.dlang.io/ add scrolling window and possibly src line mapping

2018-05-23 Thread IntegratedDimensions via Digitalmars-d
Large code is produced for assmly and others and it would be nice if it had it's own window to scroll rather than scrolling the entire window. Also it would be nice if clicking on a line in the src scrolled to the proper location in the output It would also be nice if the imports were

Re: extend foreach to work on non-arrays

2018-05-25 Thread IntegratedDimensions via Digitalmars-d
On Friday, 25 May 2018 at 04:09:55 UTC, Mike Parker wrote: On Friday, 25 May 2018 at 03:24:32 UTC, IntegratedDimensions wrote: Show me where I asked you to do any work for me. You are an imbecile. Just trying to stir up trouble because you obviously don't know how to read. You didn't like my

Re: extend foreach to work on non-arrays

2018-05-25 Thread IntegratedDimensions via Digitalmars-d
On Friday, 25 May 2018 at 09:57:20 UTC, meppl wrote: On Friday, 25 May 2018 at 03:34:43 UTC, IntegratedDimensions wrote: On Friday, 25 May 2018 at 02:43:39 UTC, Jordan Wilson wrote: On Thursday, 24 May 2018 at 23:22:56 UTC, IntegratedDimensions wrote: [...] 3rd outcome: noobs like me who

Re: Morale of a story: ~ is the right choice for concat operator

2018-05-25 Thread IntegratedDimensions via Digitalmars-d
On Friday, 25 May 2018 at 22:07:22 UTC, Dukc wrote: On Friday, 25 May 2018 at 21:06:17 UTC, Walter Bright wrote: This ambiguity bug with + has been causing well-known problems since Algol. A *really* long time. Yet it gets constantly welded into new languages. Yeah. I could understand that

Re: Morale of a story: ~ is the right choice for concat operator

2018-05-25 Thread IntegratedDimensions via Digitalmars-d
On Friday, 25 May 2018 at 23:05:51 UTC, Jonathan M Davis wrote: On Friday, May 25, 2018 22:23:07 IntegratedDimensions via Digitalmars-d wrote: On Friday, 25 May 2018 at 22:07:22 UTC, Dukc wrote: > On Friday, 25 May 2018 at 21:06:17 UTC, Walter Bright wrote: >> This ambiguity bug with +

Re: extend foreach to work on non-arrays

2018-05-25 Thread IntegratedDimensions via Digitalmars-d
On Friday, 25 May 2018 at 04:28:31 UTC, Jordan Wilson wrote: On Friday, 25 May 2018 at 03:34:43 UTC, IntegratedDimensions wrote: On Friday, 25 May 2018 at 02:43:39 UTC, Jordan Wilson wrote: On Thursday, 24 May 2018 at 23:22:56 UTC, IntegratedDimensions wrote: the idea in the first place. I

Re: extend foreach to work on non-arrays

2018-05-24 Thread IntegratedDimensions via Digitalmars-d
On Friday, 25 May 2018 at 02:43:39 UTC, Jordan Wilson wrote: On Thursday, 24 May 2018 at 23:22:56 UTC, IntegratedDimensions wrote: the idea in the first place. I needed a hammer but no one invented it. If I give you my use case then there would be two main outcomes: You attempt to find a

Re: extend foreach to work on non-arrays

2018-05-24 Thread IntegratedDimensions via Digitalmars-d
On Friday, 25 May 2018 at 03:09:26 UTC, Neia Neutuladh wrote: On Thursday, 24 May 2018 at 23:22:56 UTC, IntegratedDimensions wrote: If you can't find validity in the suggestion based on it's own inherent usefulness than the only way I can convince you is to provide examples that you actually

Re: extend foreach to work on non-arrays

2018-05-24 Thread IntegratedDimensions via Digitalmars-d
On Thursday, 24 May 2018 at 23:03:34 UTC, meppl wrote: On Thursday, 24 May 2018 at 22:43:00 UTC, IntegratedDimensions wrote: Doesn't make any sense? foreach(a; x) if x is not an array then a = x and the loop reduces simply and function to the case it is not so their can be no harm. It

extend foreach to work on non-arrays

2018-05-24 Thread IntegratedDimensions via Digitalmars-d
Doesn't make any sense? foreach(a; x) if x is not an array then a = x and the loop reduces simply and function to the case it is not so their can be no harm. It unifies the concepts so that one does not have to worry if x is an array or not and can offer no harm since when x is not an

Re: extend foreach to work on non-arrays

2018-05-24 Thread IntegratedDimensions via Digitalmars-d
On Thursday, 24 May 2018 at 23:02:00 UTC, Neia Neutuladh wrote: On Thursday, 24 May 2018 at 22:43:00 UTC, IntegratedDimensions wrote: Doesn't make any sense? foreach(a; x) if x is not an array then a = x and the loop reduces simply and function to the case it is not so their can be no harm.

Re: extend foreach to work on non-arrays

2018-05-24 Thread IntegratedDimensions via Digitalmars-d
On Thursday, 24 May 2018 at 23:08:39 UTC, aliak wrote: On Thursday, 24 May 2018 at 23:02:00 UTC, Neia Neutuladh wrote: On Thursday, 24 May 2018 at 22:43:00 UTC, IntegratedDimensions wrote: Doesn't make any sense? foreach(a; x) if x is not an array then a = x and the loop reduces simply and

Re: extend foreach to work on non-arrays

2018-05-24 Thread IntegratedDimensions via Digitalmars-d
On Friday, 25 May 2018 at 04:31:54 UTC, Neia Neutuladh wrote: On Friday, 25 May 2018 at 03:24:32 UTC, IntegratedDimensions wrote: Show me where I asked you to do any work for me. The subject of your post is in the imperative. It's a command. You are an imbecile, which I will attempt to

Re: do not include sc.ini in zip files!

2018-05-17 Thread IntegratedDimensions via Digitalmars-d
On Thursday, 17 May 2018 at 08:53:06 UTC, Vladimir Panteleev wrote: On Thursday, 17 May 2018 at 07:38:50 UTC, IntegratedDimensions wrote: Any custom modification swill overwrite the original sc.ini file. The compiler should copy(rename) or create the file on demand when it is ran and does not

Re: On Forum Moderation

2018-05-26 Thread IntegratedDimensions via Digitalmars-d
On Saturday, 26 May 2018 at 20:13:15 UTC, Walter Bright wrote: On 5/26/2018 4:12 AM, Rubn wrote: What about self moderation? If I make an unprofessional comment and want to delete it? Will this be allowed now? I guess it's more of a feature request. People have from time to time asked me to

General problem I'm having in D with the type system

2018-05-27 Thread IntegratedDimensions via Digitalmars-d
(see my other most recent post for disclaimer) My designs generally work like this: Main Type uses Subservient types A a B b C c where C : B : A, c : b : a. In the usage I must also keep consistent the use of c in C,

Re: Friends in D, a new idiom?

2018-05-27 Thread IntegratedDimensions via Digitalmars-d
On Sunday, 27 May 2018 at 06:24:13 UTC, Vijay Nayar wrote: On Sunday, 27 May 2018 at 05:25:53 UTC, IntegratedDimensions wrote: Re: Friends in D, a new idiom? In D, there's no exact equivalent to friend, but there are a few more specialized tools at your disposal. Normally all code in the

Re: General problem I'm having in D with the type system

2018-05-27 Thread IntegratedDimensions via Digitalmars-d
On Sunday, 27 May 2018 at 18:16:25 UTC, JN wrote: On Sunday, 27 May 2018 at 06:00:30 UTC, IntegratedDimensions wrote: animal a = new cat(); a.f = new food() auto c = cast(cat)a; as now f in cat will be food rather than catfood. I think the problem is in your hierarchy. If Animal can have

Re: General problem I'm having in D with the type system

2018-05-27 Thread IntegratedDimensions via Digitalmars-d
On Sunday, 27 May 2018 at 06:59:43 UTC, Vijay Nayar wrote: On Sunday, 27 May 2018 at 06:00:30 UTC, IntegratedDimensions wrote: The problem description is not very clear, but the catfood example gives a bit more to work with. animal -> food || vv cat ->

Friends in D, a new idiom?

2018-05-26 Thread IntegratedDimensions via Digitalmars-d
(Please don't respond if you are going to attack me in any way! I only accept answers that are meaningful to me and if you come up with the wrong answer don't get offended when I tell you it's wrong, if you do, expect to to get it thrown back in your face) Was having to restrict write access

Re: Installation on Ubuntu 18.04 is broken

2018-06-01 Thread IntegratedDimensions via Digitalmars-d
On Friday, 1 June 2018 at 20:07:59 UTC, bachmeier wrote: On Friday, 1 June 2018 at 16:41:21 UTC, bachmeier wrote: I would file a bug, but I don't have time to dig into this now, and it would just sit there with no response for six months anyway. I cannot find a way to get std.net.curl to

Can D not reduce template error messages?

2018-06-02 Thread IntegratedDimensions via Digitalmars-d
Getting N messages for N template parameter variations on a template. void foo(A,B)(); A and B are selected from N different values and all are used. If there is an error in the function then I get N^2 error messages, one for each combination. All the error messages say the same thing

Re: On Forum Moderation

2018-05-27 Thread IntegratedDimensions via Digitalmars-d
On Sunday, 27 May 2018 at 05:30:22 UTC, TheUncivilServant wrote: On Sunday, 27 May 2018 at 04:57:20 UTC, SlimeBag wrote: surely the best form of professional etiquette is to NOT be offended by what others say. as soon as you ignore that etiquette, it's a slippery slope to utlimately

Re: General problem I'm having in D with the type system

2018-05-27 Thread IntegratedDimensions via Digitalmars-d
On Sunday, 27 May 2018 at 21:16:46 UTC, Neia Neutuladh wrote: On Sunday, 27 May 2018 at 20:50:14 UTC, IntegratedDimensions wrote: The only problem where it can leak is when we treat an cat as an animal then put in dog food in to the animal, which is valid when cat as treated as an animal, then

Re: Found on proggit: Krug, a new experimental programming language, compiler written in D

2018-05-01 Thread IntegratedDimensions via Digitalmars-d
On Friday, 27 April 2018 at 00:03:34 UTC, H. S. Teoh wrote: On Thu, Apr 26, 2018 at 07:14:17PM -0400, Nick Sabalausky (Abscissa) via Digitalmars-d wrote: On 04/26/2018 06:47 PM, H. S. Teoh wrote: > > If "less is more" were universally true, we'd be programming > in BF instead of D. :-O

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

2018-04-27 Thread IntegratedDimensions via Digitalmars-d-learn
On Friday, 27 April 2018 at 14:57:34 UTC, BoQsc wrote: On Friday, 27 April 2018 at 04:30:32 UTC, IntegratedDimensions wrote: On Thursday, 26 April 2018 at 06:18:25 UTC, BoQsc wrote: On Wednesday, 25 April 2018 at 20:44:10 UTC, u0_a183 wrote: On Wednesday, 25 April 2018 at 19:54:26 UTC, BoQsc

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

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

Re: Dependency injection pattern

2018-05-17 Thread IntegratedDimensions via Digitalmars-d-learn
On Sunday, 13 May 2018 at 07:42:10 UTC, Suliman wrote: Could anybody give small example of Dependency injection pattern? I googled about it, but found only C# examples and I am not quite sure how to use them. Also I would like get some explanation/comments for code. Dependency injection is

Real Int24

2018-05-19 Thread IntegratedDimensions via Digitalmars-d-learn
Is there any way to create an int24 type that behaves just like any other built in type without having to reimplement everything?

Re: Real Int24

2018-05-19 Thread IntegratedDimensions via Digitalmars-d-learn
On Saturday, 19 May 2018 at 18:19:35 UTC, IntegratedDimensions wrote: Is there any way to create an int24 type that behaves just like any other built in type without having to reimplement everything? In fact, what I'd like to do is create an arbitrary type: struct atype(T) { } where

Re: is ==

2018-05-19 Thread IntegratedDimensions via Digitalmars-d-learn
On Saturday, 19 May 2018 at 01:31:38 UTC, Jonathan M Davis wrote: On Friday, May 18, 2018 23:53:12 IntegratedDimensions via Digitalmars-d- learn wrote: Why does D complain when using == to compare with null? Is there really any technical reason? if one just defines == null to is null

C style callbacks fix for member callbacks

2018-05-19 Thread IntegratedDimensions via Digitalmars-d-learn
I have a member callback that I want to use as a C callback. This is impossible due to the `hidden this` passed as the "first" parameter. The callback already makes it's last value a user pointer which I use as a "this". If I make my method static extern(C) then there is no crash and

Re: is ==

2018-05-19 Thread IntegratedDimensions via Digitalmars-d-learn
On Sunday, 20 May 2018 at 00:19:28 UTC, Jonathan M Davis wrote: On Saturday, May 19, 2018 17:50:50 IntegratedDimensions via Digitalmars-d- learn wrote: So, ultimately what I feels like is that you are actually arguing for == null to be interpreted as is null but you don't realize it yet

Re: is ==

2018-05-19 Thread IntegratedDimensions via Digitalmars-d-learn
On Sunday, 20 May 2018 at 02:09:47 UTC, Jonathan M Davis wrote: On Sunday, May 20, 2018 01:51:50 IntegratedDimensions via Digitalmars-d- learn wrote: Simply require == null as is null and be done with it. That would be flat out wrong for dynamic arrays, because then auto result = arr == null

Re: is ==

2018-05-19 Thread IntegratedDimensions via Digitalmars-d-learn
Furthermore: https://issues.dlang.org/show_bug.cgi?id=3889 Shows real problems. You argue from the side that the bug already exists so we must work around it because we can't go back and "fix things". Who says? D has had breaking changes in the past so it is not a deal breaker. It is also a

Re: C style callbacks fix for member callbacks

2018-05-20 Thread IntegratedDimensions via Digitalmars-d-learn
On Sunday, 20 May 2018 at 08:40:57 UTC, MGW wrote: On Saturday, 19 May 2018 at 23:52:58 UTC, IntegratedDimensions wrote: I have a member callback that I want to use as a C callback. http://www.agner.org/optimize/calling_conventions.pdf https://www.youtube.com/watch?v=xhDS377mAc4 Sorry, I

Re: Convert mixin to function call

2018-05-20 Thread IntegratedDimensions via Digitalmars-d-learn
https://dpaste.dzfl.pl/fb49bf834cff import std.stdio; auto Q(string A)() { auto foo() { auto d = mixin(Z!(A)()); return d; } return foo()(); } auto X(string A, string N)() { return N~" = (() { int y = 4; return "~A~" + y

Convert mixin to function call

2018-05-20 Thread IntegratedDimensions via Digitalmars-d-learn
I have a string mixin that returns a value or function that uses the mixed in scope. Currently I have to wrap the mixin in a delegate or local function as to be able to get the value: int x = 3; int y = 1; auto foo() { mixin(X!("x")); } This allows the the mixin to see the scope but keep

Re: Convert mixin to function call

2018-05-20 Thread IntegratedDimensions via Digitalmars-d-learn
Also, one thing that would help would be able to create identifier names that are unique to avoid collisions. Does D have any ability to do such a thing?

Re: Convert mixin to function call

2018-05-20 Thread IntegratedDimensions via Digitalmars-d-learn
It should be obvious that these are simplifications. I can't pass the variables directly as parameters as in the real case the names may only be partially specified.

Re: C style callbacks fix for member callbacks

2018-05-20 Thread IntegratedDimensions via Digitalmars-d-learn
On Sunday, 20 May 2018 at 23:05:47 UTC, ag0aep6g wrote: On 05/20/2018 06:48 PM, IntegratedDimensions wrote: alias callback = extern(C) int function(const(void) a, void *b, uint c, void* context); (I'm assuming that `a` is supposed to be a `const(void)*`.) Where context acts as this. I

Re: Real Int24

2018-05-21 Thread IntegratedDimensions via Digitalmars-d-learn
On Monday, 21 May 2018 at 15:41:21 UTC, Simen Kjærås wrote: On Saturday, 19 May 2018 at 18:44:42 UTC, IntegratedDimensions wrote: On Saturday, 19 May 2018 at 18:19:35 UTC, IntegratedDimensions wrote: Is there any way to create an int24 type that behaves just like any other built in type

Re: C style callbacks fix for member callbacks

2018-05-21 Thread IntegratedDimensions via Digitalmars-d-learn
On Monday, 21 May 2018 at 02:23:27 UTC, ag0aep6g wrote: I tried this. Your code crashes in windows dmd x86 x64. Hm. Works for me in a virtual machine. But I'm not surprised that it's fragile. It might be completely wrong, and it just happens to look alright on my machine.

Re: Efficient idiom for fastest code

2018-05-23 Thread IntegratedDimensions via Digitalmars-d-learn
On Wednesday, 23 May 2018 at 10:55:02 UTC, Malte wrote: On Wednesday, 23 May 2018 at 02:24:08 UTC, IntegratedDimensions wrote: [...] I would just do [...] [...] Thanks, I didn't think about using a for loop like that. While it is not the most general it does solve the specific case for

Re: Efficient idiom for fastest code

2018-05-22 Thread IntegratedDimensions via Digitalmars-d-learn
On Wednesday, 23 May 2018 at 03:00:17 UTC, Nicholas Wilson wrote: On Wednesday, 23 May 2018 at 02:24:08 UTC, IntegratedDimensions wrote: Many times in expensive loops one must make decisions. Decisions must be determined and the determination costs. for(int i = 0; i < N; i++) {

Re: Locking data

2018-05-22 Thread IntegratedDimensions via Digitalmars-d-learn
On Tuesday, 22 May 2018 at 23:09:24 UTC, Sjoerd Nijboer wrote: On Tuesday, 22 May 2018 at 22:17:05 UTC, IntegratedDimensions wrote: On Tuesday, 22 May 2018 at 22:10:52 UTC, Alex wrote: On Tuesday, 22 May 2018 at 21:45:07 UTC, IntegratedDimensions wrote: an idea to lock data by removing the

Efficient idiom for fastest code

2018-05-22 Thread IntegratedDimensions via Digitalmars-d-learn
Many times in expensive loops one must make decisions. Decisions must be determined and the determination costs. for(int i = 0; i < N; i++) { if(decision(i)) A; else B; } the if statement costs N times the cycle cost. In some cases the decision holds for continuous ranges. For some 0

Locking data

2018-05-22 Thread IntegratedDimensions via Digitalmars-d-learn
an idea to lock data by removing the reference: class A { Lockable!Data data; } The idea is that when the data is going to be used, the user locks the data. The trick here is that data is a pointer to the data and the pointer is set to null when locked so no other data can use it(they see

Re: Locking data

2018-05-22 Thread IntegratedDimensions via Digitalmars-d-learn
On Tuesday, 22 May 2018 at 22:10:52 UTC, Alex wrote: On Tuesday, 22 May 2018 at 21:45:07 UTC, IntegratedDimensions wrote: an idea to lock data by removing the reference: class A { Lockable!Data data; } The idea is that when the data is going to be used, the user locks the data. The trick

Re: Any way to override base type with dervived in derived type

2018-05-25 Thread IntegratedDimensions via Digitalmars-d-learn
On Friday, 25 May 2018 at 10:45:23 UTC, Steven Schveighoffer wrote: On 5/24/18 4:24 PM, IntegratedDimensions wrote: What I'd like to do is class C : A {    private override @property TT t() { return cast(TT)(_t); } // null check if necessary    // Stuff below uses t which is now a TT   

Re: Any way to override base type with dervived in derived type

2018-05-25 Thread IntegratedDimensions via Digitalmars-d-learn
On Friday, 25 May 2018 at 10:45:23 UTC, Steven Schveighoffer wrote: On 5/24/18 4:24 PM, IntegratedDimensions wrote: What I'd like to do is class C : A {    private override @property TT t() { return cast(TT)(_t); } // null check if necessary    // Stuff below uses t which is now a TT   

Re: C style callbacks fix for member callbacks

2018-05-25 Thread IntegratedDimensions via Digitalmars-d-learn
Investigating further, this does not seem to be pushed on the stack but set in EAX. Hence no amount of parameter placement manipulation will work. It actually becomes an easy situation although this will be invalid as it will be be whatever value is in EAX used by the caller. One cannot set

Re: Any way to override base type with dervived in derived type

2018-05-25 Thread IntegratedDimensions via Digitalmars-d-learn
On Saturday, 26 May 2018 at 01:11:39 UTC, crimaniak wrote: On Thursday, 24 May 2018 at 20:24:32 UTC, IntegratedDimensions wrote: I'm pretty much guaranteed that in C, t will be type TT due to the design(C goes with TT like bread with butter). ... 1) Your architecture is wrong, I recommend to

Re: Any way to override base type with dervived in derived type

2018-05-24 Thread IntegratedDimensions via Digitalmars-d-learn
On Friday, 25 May 2018 at 01:02:00 UTC, Basile B. wrote: On Friday, 25 May 2018 at 00:15:39 UTC, IntegratedDimensions wrote: On Thursday, 24 May 2018 at 23:31:50 UTC, Alex wrote: On Thursday, 24 May 2018 at 20:24:32 UTC, IntegratedDimensions wrote: class T; class TT : T; interface I {

Any way to override base type with dervived in derived type

2018-05-24 Thread IntegratedDimensions via Digitalmars-d-learn
class T; class TT : T; interface I { @property T t(); } abstract class A { T _t; @property T t() { return _t; } } class C : A { // Stuff below uses t as TT but compiler, of course, treats t as T ... } The issue is that I programmed the class C with a variable that

Re: Any way to override base type with dervived in derived type

2018-05-24 Thread IntegratedDimensions via Digitalmars-d-learn
On Friday, 25 May 2018 at 01:42:48 UTC, Basile B. wrote: On Friday, 25 May 2018 at 01:17:45 UTC, IntegratedDimensions wrote: On Friday, 25 May 2018 at 01:02:00 UTC, Basile B. wrote: On Friday, 25 May 2018 at 00:15:39 UTC, IntegratedDimensions wrote: On Thursday, 24 May 2018 at 23:31:50 UTC,

Re: Any way to override base type with dervived in derived type

2018-05-24 Thread IntegratedDimensions via Digitalmars-d-learn
On Thursday, 24 May 2018 at 23:31:50 UTC, Alex wrote: On Thursday, 24 May 2018 at 20:24:32 UTC, IntegratedDimensions wrote: class T; class TT : T; interface I { @property T t(); } abstract class A { T _t; @property T t() { return _t; } } class C : A { // Stuff below uses t as

is ==

2018-05-18 Thread IntegratedDimensions via Digitalmars-d-learn
Why does D complain when using == to compare with null? Is there really any technical reason? if one just defines == null to is null then there should be no problem. It seems like a pedantic move by who ever implemented it and I'm hoping there is actually a good technical reason for it.

Re: is ==

2018-05-18 Thread IntegratedDimensions via Digitalmars-d-learn
On Friday, 18 May 2018 at 23:58:18 UTC, Uknown wrote: On Friday, 18 May 2018 at 23:53:12 UTC, IntegratedDimensions wrote: Why does D complain when using == to compare with null? Is there really any technical reason? if one just defines == null to is null then there should be no problem. It

Re: Code repetition

2018-05-27 Thread IntegratedDimensions via Digitalmars-d-learn
I guess I should have mentioned that basically this is like a C macro.

Code repetition

2018-05-27 Thread IntegratedDimensions via Digitalmars-d-learn
I have some code like void foo() { // setup stuff int x; scope(exit) something; // x = 34; } void foon() { // setup stuff int x; scope(exit) something; // } All the setup stuff is virtually identical in each foo. There are slight differences such

Getter an lvalue and cannot be modified

2018-05-27 Thread IntegratedDimensions via Digitalmars-d-learn
C[] c; @property C[] get() { return c; } get ~= something; errors out, yet auto q = get; q ~= something; is fine. Why is D thinking that ~= is being applied to get, the function, rather than what it returns? Also When I converted a field in to a property, an AA, it is returning null

How are switches optimized

2018-06-01 Thread IntegratedDimensions via Digitalmars-d-learn
What is the best optimizations that a compiler does to switches in general and in the D compilers? A switch can be seen as if statements, or safer, nested if elses. but surely the cost per case does not grow with depth in the switch? If one has a switch of N case then the last cost surely

Orange serializer/deserializer

2018-06-01 Thread IntegratedDimensions via Digitalmars-d-learn
How can I modify the pre serialization and post serialization values? I need to transform some variables that are stored but I would like to do this easily "inline"(would be cool to be able to provide a delegate to do the transformations at the site of definition of the fields). Also, how

Re: Getter an lvalue and cannot be modified

2018-05-27 Thread IntegratedDimensions via Digitalmars-d-learn
On Sunday, 27 May 2018 at 09:28:36 UTC, Mike Franklin wrote: On Sunday, 27 May 2018 at 09:23:09 UTC, IntegratedDimensions wrote: C[] c; @property C[] get() { return c; } get ~= something; errors out, yet auto q = get; q ~= something; is fine. Why is D thinking that ~= is being applied to

Re: Code repetition

2018-05-27 Thread IntegratedDimensions via Digitalmars-d-learn
On Sunday, 27 May 2018 at 13:20:08 UTC, Adam D. Ruppe wrote: On Sunday, 27 May 2018 at 06:47:38 UTC, IntegratedDimensions wrote: Putting the code in a template/function/lambda does not work because of the scopes which will be called when the main function exists. I think you might just be

Re: How to curl!

2018-05-01 Thread IntegratedDimensions via Digitalmars-d-learn
On Tuesday, 1 May 2018 at 22:08:50 UTC, Dr.No wrote: On Tuesday, 1 May 2018 at 21:57:22 UTC, IntegratedDimensions wrote: Trying to curl basic stuff but std.net.curl isn't cooperating: curl "https://www.googleapis.com/youtube/v3/channels; -G -d part=contentDetails -d forUsername=test -d

Re: How to curl!

2018-05-01 Thread IntegratedDimensions via Digitalmars-d-learn
On Tuesday, 1 May 2018 at 23:02:39 UTC, Dr.No wrote: On Tuesday, 1 May 2018 at 22:51:01 UTC, IntegratedDimensions wrote: [...] those dlls: libeay32.dll libssl32.dll ssleay32.dll I'm sure they would be installed with whatever [...] I don't think so. IIRC, when I used D+curl I needed to

How to curl!

2018-05-01 Thread IntegratedDimensions via Digitalmars-d-learn
Trying to curl basic stuff but std.net.curl isn't cooperating: curl "https://www.googleapis.com/youtube/v3/channels; -G -d part=contentDetails -d forUsername=test -d key=somekey import std.stdio; import std.net.curl; int main(string[] argv) { auto http = HTTP();

Re: How to curl!

2018-05-01 Thread IntegratedDimensions via Digitalmars-d-learn
On Tuesday, 1 May 2018 at 23:35:42 UTC, Arun Chandrasekaran wrote: On Tuesday, 1 May 2018 at 21:57:22 UTC, IntegratedDimensions wrote: Trying to curl basic stuff but std.net.curl isn't cooperating: This is one of the reasons I hate D ;/ I've spent more time trying to get std.net.curl to do

Re: How to curl!

2018-05-02 Thread IntegratedDimensions via Digitalmars-d-learn
On Wednesday, 2 May 2018 at 03:03:19 UTC, ikod wrote: On Wednesday, 2 May 2018 at 00:04:49 UTC, IntegratedDimensions wrote: On Tuesday, 1 May 2018 at 23:35:42 UTC, Arun Chandrasekaran wrote: [...] Ok, first try: Unhandled exception: object.Exception can't complete call to TLS_method at

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

2018-04-26 Thread IntegratedDimensions via Digitalmars-d-learn
On Thursday, 26 April 2018 at 06:18:25 UTC, BoQsc wrote: On Wednesday, 25 April 2018 at 20:44:10 UTC, u0_a183 wrote: On Wednesday, 25 April 2018 at 19:54:26 UTC, BoQsc wrote: On Wednesday, 25 April 2018 at 19:43:31 UTC, Jonathan M Davis wrote: On Wednesday, April 25, 2018 19:19:58 BoQsc via

LDC phobos2-ldc.lib(json.obj) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'x86'

2018-05-03 Thread IntegratedDimensions via Digitalmars-d-learn
trying to compile a simple program in x86. Compiles fine in dmd and ldcx64. Seems like ldc is using the wrong lib for some reason? phobos2-ldc.lib(json.obj) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'x86' Error: C:\Program Files (x86)\Microsoft

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

2018-04-25 Thread IntegratedDimensions via Digitalmars-d-learn
On Wednesday, 25 April 2018 at 19:19:58 UTC, BoQsc wrote: So there has been idea I've got for around few months now: making a software which executable would contain a source file. A software that anyone could modify by opening an executable and quickly change a few lines of it, rerun an