Re: Variant is just a class

2018-09-06 Thread Josphe Brigmo via Digitalmars-d
On Thursday, 6 September 2018 at 20:25:18 UTC, Neia Neutuladh wrote: On Thursday, 6 September 2018 at 10:18:43 UTC, Josphe Brigmo wrote: Variants can hold an arbitrary set of types. I imagine that it is effectively just a type id and an object pointer!? It's a typeid and a static array

Re: Source changes should include date of change

2018-09-08 Thread Josphe Brigmo via Digitalmars-d
On Sunday, 9 September 2018 at 02:49:45 UTC, Walter Bright wrote: On 9/8/2018 4:29 AM, Josphe Brigmo wrote: Um, I didn't say don't use Git! I've done this manually before git. I can guarantee you that the dates put in the file are invariably wrong, incomplete, or non-existent. But if you

Re: Source changes should include date of change

2018-09-08 Thread Josphe Brigmo via Digitalmars-d
On Sunday, 9 September 2018 at 02:48:40 UTC, Neia Neutuladh wrote: On Sunday, 9 September 2018 at 01:27:06 UTC, Josphe Brigmo wrote: How hard would it be to automate dating for dmd source so that everything is consistent in a way that makes sense? Perhaps you could find out by trying to

Re: Source changes should include date of change

2018-09-08 Thread Josphe Brigmo via Digitalmars-d
On Saturday, 8 September 2018 at 18:47:39 UTC, Neia Neutuladh wrote: On Saturday, 8 September 2018 at 06:59:28 UTC, Josphe Brigmo wrote: Having source code that doesn't show changes with dates is pretty useless for diagnostics. I realize that git has the changes but the source code should.

Variant is just a class

2018-09-06 Thread Josphe Brigmo via Digitalmars-d
Variants can hold an arbitrary set of types. I imagine that it is effectively just a type id and an object pointer!? If so, then it really is just a special type of a class class. Let me explain: I have a class that will "hold/wrap" another class. I could hold them using a variant but

Source changes should include date of change

2018-09-08 Thread Josphe Brigmo via Digitalmars-d
Having source code that doesn't show changes with dates is pretty useless for diagnostics. I realize that git has the changes but the source code should. If some code is added or changed it is very simple to add the date of change in a comment. // Date: Date1, Date2, Date3, Anything

Re: Variant is just a class

2018-09-07 Thread Josphe Brigmo via Digitalmars-d
On Friday, 7 September 2018 at 18:18:50 UTC, Neia Neutuladh wrote: On Friday, 7 September 2018 at 03:04:19 UTC, Josphe Brigmo wrote: We are talking about two different things that are related: A variant holds a set of objects. Using VariantClass limits the types to a subset and allows for

Re: Source changes should include date of change

2018-09-08 Thread Josphe Brigmo via Digitalmars-d
On Saturday, 8 September 2018 at 07:08:46 UTC, Colin wrote: On Saturday, 8 September 2018 at 06:59:28 UTC, Josphe Brigmo wrote: Having source code that doesn't show changes with dates is pretty useless for diagnostics. I realize that git has the changes but the source code should. If some

Re: Variant is just a class

2018-09-07 Thread Josphe Brigmo via Digitalmars-d
Here is a working example: import std.stdio; class Project(Wrapped, Interface) : Interface { import std.traits; Wrapped wrapped; static foreach (member; __traits(allMembers, Interface)) { static foreach (overload; __traits(getOverloads, Interface, member))

Why the hell do exceptions give error in the library rather than the user code?

2018-09-14 Thread Josphe Brigmo via Digitalmars-d
std.file.FileException@C:\D\dmd2\windows\bin\..\..\src\phobos\std\file.d(3153): It is very annoying when the only error info I have is pointing to code in a library which tells me absolutely nothing about where the error occurs in the in the user code(which is what matters). Surely the

Re: Why the hell do exceptions give error in the library rather than the user code?

2018-09-14 Thread Josphe Brigmo via Digitalmars-d
On Friday, 14 September 2018 at 15:40:46 UTC, Jonathan Marler wrote: On Friday, 14 September 2018 at 14:34:36 UTC, Josphe Brigmo wrote: std.file.FileException@C:\D\dmd2\windows\bin\..\..\src\phobos\std\file.d(3153): It is very annoying when the only error info I have is pointing to code in a

Re: Why the hell do exceptions give error in the library rather than the user code?

2018-09-14 Thread Josphe Brigmo via Digitalmars-d
On Friday, 14 September 2018 at 15:52:20 UTC, Neia Neutuladh wrote: On Friday, 14 September 2018 at 14:34:36 UTC, Josphe Brigmo wrote: std.file.FileException@C:\D\dmd2\windows\bin\..\..\src\phobos\std\file.d(3153): It is very annoying when the only error info I have is pointing to code in a

Re: phobo's std.file is completely broke!

2018-09-14 Thread Josphe Brigmo via Digitalmars-d
https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#maxpath But because MAX_PATH is an enum, it can't be redefined without recompiling phobos, which means it will break later on... It does say that this is not a problem with unicode... but...

phobo's std.file is completely broke!

2018-09-14 Thread Josphe Brigmo via Digitalmars-d
For very long file names it is broke and every command fails. These paths are not all that long but over 256 limit. (For windows) The problem this causes can be disastrous. If some check fails and runs code that isn't mean to run if the file exists, it could destroy data. I replaced many

Re: phobo's std.file is completely broke!

2018-09-14 Thread Josphe Brigmo via Digitalmars-d
On Friday, 14 September 2018 at 19:17:58 UTC, bachmeier wrote: On Friday, 14 September 2018 at 19:06:14 UTC, Josphe Brigmo wrote: For very long file names it is broke and every command fails. These paths are not all that long but over 256 limit. (For windows) Please file a bug report with

Re: phobo's std.file is completely broke!

2018-09-15 Thread Josphe Brigmo via Digitalmars-d
and the biggest problem is that I don't see any motivation in the D community to make things better. Anyone with the abilities to make it better in the right way simply does not care about having a proper plan to get D to where it needs to be. Hence, it gives me no hope that D will ever reach

Re: phobo's std.file is completely broke!

2018-09-15 Thread Josphe Brigmo via Digitalmars-d
On Saturday, 15 September 2018 at 13:37:29 UTC, Vladimir Panteleev wrote: On Saturday, 15 September 2018 at 12:59:25 UTC, Josphe Brigmo wrote: The libraries are already copying the user's string and adding the 0 termination prior to calling the windows api, so it seems to me to be a reasonable

Re: phobo's std.file is completely broke!

2018-09-15 Thread Josphe Brigmo via Digitalmars-d
On Saturday, 15 September 2018 at 23:06:57 UTC, Jonathan M Davis wrote: On Saturday, September 15, 2018 6:54:50 AM MDT Josphe Brigmo via Digitalmars-d wrote: On Saturday, 15 September 2018 at 12:38:41 UTC, Adam D. Ruppe wrote: > On Saturday, 15 September 2018 at 10:57:56 UTC, Josphe Bri

Re: phobo's std.file is completely broke!

2018-09-15 Thread Josphe Brigmo via Digitalmars-d
On Saturday, 15 September 2018 at 09:47:25 UTC, WebFreak001 wrote: On Friday, 14 September 2018 at 19:06:14 UTC, Josphe Brigmo wrote: For very long file names it is broke and every command fails. These paths are not all that long but over 256 limit. (For windows) The problem this causes can

Re: phobo's std.file is completely broke!

2018-09-15 Thread Josphe Brigmo via Digitalmars-d
On Saturday, 15 September 2018 at 12:38:41 UTC, Adam D. Ruppe wrote: On Saturday, 15 September 2018 at 10:57:56 UTC, Josphe Brigmo wrote: Phobos *NEEDS* to be modified to work with these newer OS's. You need to look at the source code before posting. The code for remove is literally

Re: phobo's std.file is completely broke!

2018-09-15 Thread Josphe Brigmo via Digitalmars-d
For example, https://issues.dlang.org/show_bug.cgi?id=8967 ` Jay Norwood 2014-03-18 18:01:59 UTC More surprising is attempting to remove a long directory path and having an exception occur. The libraries are already copying the user's string and adding the 0 termination prior to calling

Re: phobo's std.file is completely broke!

2018-09-15 Thread Josphe Brigmo via Digitalmars-d
On Saturday, 15 September 2018 at 10:48:10 UTC, Vladimir Panteleev wrote: On Friday, 14 September 2018 at 19:42:39 UTC, Josphe Brigmo wrote: "It doesn't matter. When I compile a program or DLL in C/C++ and many other languages, I use the Windows headers. These headers define MAX_PATH to 260.

Re: phobo's std.file is completely broke!

2018-09-15 Thread Josphe Brigmo via Digitalmars-d
On Saturday, 15 September 2018 at 13:23:34 UTC, Rubn wrote: On Saturday, 15 September 2018 at 12:59:25 UTC, Josphe Brigmo wrote: This is the typical mindset with D. There are all these "minor" problems that people(the D community pretends are all that big a deal but when you couple all these

DlangUI and android

2018-09-10 Thread Josphe Brigmo via Digitalmars-d-learn
Is there an emulator that can run the apks? Android emulator does not work, I suppose, because it isn't java. Complains about a missing classes.dex file. I'd rather have an emulator version if possible for quicker dev.

Re: Error: expression `update` of type `void` does not have a boolean value

2018-09-08 Thread Josphe Brigmo via Digitalmars-d-learn
On Saturday, 8 September 2018 at 05:39:39 UTC, Alex wrote: On Saturday, 8 September 2018 at 03:12:56 UTC, Josphe Brigmo wrote: auto foo(bool update = false)() { static if(update) { } } and the compiler, after upgrading to 2.082 from 2.080 now says: Error: expression `update` of type

compiler asserts

2018-09-07 Thread Josphe Brigmo via Digitalmars-d-learn
import std.stdio, std.variant; class Wrapper(Interface, Wrapped) : Interface { import std.traits; Wrapped wrapped; static foreach (member; __traits(allMembers, Interface)) { } } void main() { } when I try to compile this v2.080.0 object.Error@(0):

Re: Error: expression `update` of type `void` does not have a boolean value

2018-09-08 Thread Josphe Brigmo via Digitalmars-d-learn
On Saturday, 8 September 2018 at 07:30:35 UTC, Alex wrote: On Saturday, 8 September 2018 at 06:56:40 UTC, Josphe Brigmo wrote: My project does not use the term update at all in any other context except that one. But I did find: void update(K, V, C, U)(ref V[K] aa, K key, scope C create,

GTKD for android?

2018-09-07 Thread Josphe Brigmo via Digitalmars-d-learn
I have an app I'm writing using GtkD on windows. Eventually I'd like to port it to android. Since I have never been able to actually get anything to work on android I'm curious if there are any demos with gtkD for android? I'm wondering if I just scrap the idea of using it because it won't

Error: expression `update` of type `void` does not have a boolean value

2018-09-07 Thread Josphe Brigmo via Digitalmars-d-learn
auto foo(bool update = false)() { static if(update) { } } and the compiler, after upgrading to 2.082 from 2.080 now says: Error: expression `update` of type `void` does not have a boolean value when update is clearly a bool. Why the hell is the compiler now thinking update is a

Re: x64 Privileged instruction

2018-09-12 Thread Josphe Brigmo via Digitalmars-d-learn
On Wednesday, 12 September 2018 at 13:26:03 UTC, Stefan Koch wrote: On Wednesday, 12 September 2018 at 10:42:08 UTC, Josphe Brigmo wrote: x64 gives Privileged instruction but x86 gives First-chance exception: std.file.FileException "C:\": The filename, directory name, or volume label syntax

Re: remove file access denied(remove broke)

2018-09-14 Thread Josphe Brigmo via Digitalmars-d-learn
On Friday, 14 September 2018 at 13:28:41 UTC, Adam D. Ruppe wrote: On Friday, 14 September 2018 at 08:32:48 UTC, Josphe Brigmo wrote: Seems remove is broke. The source code for remove is DeleteFile(name), so not much room for bugs there, except maybe string conversion. What is the filename

Re: remove file access denied(remove broke)

2018-09-14 Thread Josphe Brigmo via Digitalmars-d-learn
On Friday, 14 September 2018 at 15:21:21 UTC, H. S. Teoh wrote: On Fri, Sep 14, 2018 at 02:36:34PM +, Josphe Brigmo via Digitalmars-d-learn wrote: [...] It happens on a bunch. I do get errors or overlong file names but this doesn't seem to be the case. The fact is, that simply using

dealing with very long paths and names

2018-09-14 Thread Josphe Brigmo via Digitalmars-d-learn
Seems to break dirEntries when trying to deal with long pathnames(> 512) on windows. It's a strange error because it just fails with access denied or missing file.

Re: [OT] My State is Illegally Preventing Me From Voting In The Upcoming 2018 US Elections

2018-09-15 Thread Josphe Brigmo via Digitalmars-d-announce
Don't worry, your vote actually does not matter either way, so no reason to get upset. Voting is simply a census count to find out how many people still believe that voting still works. If you have 50M eligible voters and 25 million vote, it means you have about 50% of those that believe the

Bug in VD

2018-09-14 Thread Josphe Brigmo via Digitalmars-d-debugger
When having two loops it seems the variables are never show if the name is already used: foreach(string a; x) { // a not shown in the locals or autos} foreach(string a; y) { // a not shown } renaming one of them to b, say, works as long as be wasn't used somewhere else.

Re: remove file access denied(remove broke)

2018-09-15 Thread Josphe Brigmo via Digitalmars-d-learn
On Saturday, 15 September 2018 at 06:13:29 UTC, bauss wrote: On Friday, 14 September 2018 at 16:55:21 UTC, Josphe Brigmo wrote: On Friday, 14 September 2018 at 15:21:21 UTC, H. S. Teoh wrote: [...] It woudln't help. I'm dealing with over a million files and you'd need those files too. But

Re: x64 Privileged instruction

2018-09-15 Thread Josphe Brigmo via Digitalmars-d-learn
On Saturday, 15 September 2018 at 14:57:20 UTC, Vladimir Panteleev wrote: On Thursday, 13 September 2018 at 05:50:53 UTC, Josphe Brigmo wrote: Privileged instruction Lots of code. I pretty much always get this error. Something must have gone really wrong to get this error. Most likely, the

remove file access denied

2018-09-13 Thread Josphe Brigmo via Digitalmars-d-learn
I am trying to remove a file remove(filename); and I get an access denied! I can remove it from explorer just fine. I am able to remove other files but there should be no reason why the file can't be removed in this case. All I am doing to mess with the file is reading it's contents right

Re: remove file access denied(remove broke)

2018-09-14 Thread Josphe Brigmo via Digitalmars-d-learn
On Friday, 14 September 2018 at 04:48:09 UTC, Norm wrote: On Thursday, 13 September 2018 at 23:25:24 UTC, Josphe Brigmo wrote: I am trying to remove a file remove(filename); and I get an access denied! I can remove it from explorer just fine. I am able to remove other files but there should

x64 Privileged instruction

2018-09-12 Thread Josphe Brigmo via Digitalmars-d-learn
x64 gives Privileged instruction but x86 gives First-chance exception: std.file.FileException "C:\": The filename, directory name, or volume label syntax is incorrect. at std\file.d(4573) which is much more informative... seems like a bug to me.