Re: Best error msg ever

2017-02-11 Thread Profile Anaysis via Digitalmars-d
On Friday, 10 February 2017 at 03:07:28 UTC, Adam D. Ruppe wrote: On Friday, 10 February 2017 at 02:53:50 UTC, Era Scarecrow In cases like these i really wish the structure of the class/struct had a hash or something (based on source or struct layout or something) They do have different full

Re: The extent of trust in errors and error handling

2017-02-05 Thread Profile Anaysis via Digitalmars-d
On Wednesday, 1 February 2017 at 19:25:07 UTC, Ali Çehreli wrote: tl;dr - Seeking thoughts on trusting a system that allows "handling" errors. One of my extra-curricular interests is the Mill CPU[1]. A recent discussion in that context reminded me of the Error-Exception distinction in languag

array error msg improvement

2017-02-02 Thread Profile Anaysis via Digitalmars-d
Error Error: cannot append type int[] to type int[2][] This is because I tried to slice too small [0..1] when I was suppose to do [0..2](which passes). The error message is deceiving because it makes it look like the append can't happen when it can. Should be something like

Re: Fix it for me!

2017-02-01 Thread Profile Anaysis via Digitalmars-d
On Tuesday, 31 January 2017 at 15:21:42 UTC, Vladimir Panteleev wrote: On Tuesday, 31 January 2017 at 13:11:22 UTC, Profile Anaysis wrote: The web interface could use a little work! 1. Tabs - I know that tabs are designed to move to different elements but you can override the default behavior

Fix it for me!

2017-01-31 Thread Profile Anaysis via Digitalmars-d
The web interface could use a little work! 1. Tabs - I know that tabs are designed to move to different elements but you can override the default behavior and make life quite a bit easier for most people(since most people have access to a mouse). http://stackoverflow.com/questions/3362/captu

Re: A better way to deal with overloading?

2017-01-27 Thread Profile Anaysis via Digitalmars-d
On Friday, 27 January 2017 at 11:16:09 UTC, Patrick Schluter wrote: On Thursday, 26 January 2017 at 00:02:03 UTC, Profile Anaysis wrote: [...] It's funny (or sad) that C has compound types since C99 and that they are good. Your foo(|a,b,|c1,c2,3||,|e|,|f,g,c|) writes as foo((T1){a,b,{c1,c2

Re: A better way to deal with overloading?

2017-01-27 Thread Profile Anaysis via Digitalmars-d
On Friday, 27 January 2017 at 12:44:30 UTC, rjframe wrote: On Fri, 27 Jan 2017 10:38:53 +, Profile Anaysis wrote: Do you realize 1. That without change there can be no progress? ... If people with your mentality rules the world we would still be using sticks and stones. This is a fact...

Re: A better way to deal with overloading?

2017-01-27 Thread Profile Anaysis via Digitalmars-d
On Friday, 27 January 2017 at 19:32:29 UTC, Jesse Phillips wrote: On Thursday, 26 January 2017 at 00:02:03 UTC, Profile Anaysis wrote: Many times we pass compound types(non-primitives) as arguments to functions. I don't understand what issue you are solving. I see an undefined syntax: foo(|

Re: A better way to deal with overloading?

2017-01-27 Thread Profile Anaysis via Digitalmars-d
On Friday, 27 January 2017 at 09:47:48 UTC, Bauss wrote: On Thursday, 26 January 2017 at 00:02:03 UTC, Profile Anaysis wrote: Many times we pass compound types(non-primitives) as arguments to functions. [...] This is going to be a no from me. It's just another syntactic sugar that doesn't r

COMDAT error

2017-01-26 Thread Profile Anaysis via Digitalmars-d
test1.obj : fatal error LNK1179: invalid or corrupt file: duplicate COMDAT '_D4main4mainFAAyaZ16__T3recVii1TAAiZ3recMFNfAAiZv (@safe void main.main(immutable(char)[][]).rec!(1, int[][]).rec(int[][]))' code import std.stdio; import std.traits, std.meta, std.conv, std.string, std.algorithm;

Allow static methods and fields for enum?

2017-01-25 Thread Profile Anaysis via Digitalmars-d
Why not make enum a comparable type to structs and classes? They are static so they can't contain any mutable fields but surely they can contain methods? And especially they should be able to contain static methods!?

A better way to deal with overloading?

2017-01-25 Thread Profile Anaysis via Digitalmars-d
Many times we pass compound types(non-primitives) as arguments to functions. e.g., void foo(T1 t1, T2 t2, T3, t3); But to call foo with new variables we have to create the arguments. This usually requires extra code to simply initialize the variables. (imagine foo being a constructor).

test.d(22): Error: cannot append type test.Path to type test.Path

2017-01-24 Thread Profile Anaysis via Digitalmars-d
test.d(22): Error: cannot append type test.Path to type test.Path This is due to the changing some code that was appending. Obviously we can't append a type to itself. Would be nice if the error message was more clear like: Type test.Path is not an array. Cannot append to itself.

Re: Writing a JFlex lexer for D - have an issue with cycles

2017-01-23 Thread Profile Anaysis via Digitalmars-d
On Monday, 23 January 2017 at 01:46:58 UTC, FatalCatharsis wrote: On Monday, 23 January 2017 at 00:46:30 UTC, Profile Anaysis wrote: The real issue is ambiguity. Any time you have a cycle you must be able to get out of it and so your rules must be organized so that one always checks to see if t

Re: Writing a JFlex lexer for D - have an issue with cycles

2017-01-22 Thread Profile Anaysis via Digitalmars-d
On Sunday, 22 January 2017 at 22:11:08 UTC, FatalCatharsis wrote: I'm writing a flex lexer for D and I've hit a roadblock. It is almost working EXCEPT for one specific production. StringLiteral is cyclic and I don't know how to approach it. It is cyclic because: Token -> StringLiteral -