Re: __vector(ubyte[32]) misalignment

2020-08-08 Thread user1234 via Digitalmars-d-learn
On Sunday, 9 August 2020 at 01:56:54 UTC, Bruce Carneal wrote: On Sunday, 9 August 2020 at 01:03:51 UTC, Bruce Carneal wrote: The .alignof attribute of __vector(ubyte[32]) is 32 but initializing an array of such vectors via an assignment to .length has given me 16 byte alignment (and

Re: __vector(ubyte[32]) misalignment

2020-08-08 Thread Bruce Carneal via Digitalmars-d-learn
On Sunday, 9 August 2020 at 01:03:51 UTC, Bruce Carneal wrote: The .alignof attribute of __vector(ubyte[32]) is 32 but initializing an array of such vectors via an assignment to .length has given me 16 byte alignment (and subsequent seg faults which I suspect are related). Is sub .alignof

__vector(ubyte[32]) misalignment

2020-08-08 Thread Bruce Carneal via Digitalmars-d-learn
The .alignof attribute of __vector(ubyte[32]) is 32 but initializing an array of such vectors via an assignment to .length has given me 16 byte alignment (and subsequent seg faults which I suspect are related). Is sub .alignof alignment expected here? IOW, do I have to manually manage

String argument with optional value in std.getopt

2020-08-08 Thread Hassan via Digitalmars-d-learn
Hello I'm trying to get getopt to recognize an argument that may or may not take a value. Here's an example : ./hashtrack --list ./hashtrack --list filter The problem is that if I point list to a string variable, the first call fails with "Missing value for argument --list". I tried

Re: How does D's templated functions implementation differ from generics in C#/Java?

2020-08-08 Thread 12345swordy via Digitalmars-d-learn
On Friday, 7 August 2020 at 21:03:47 UTC, aberba wrote: Syntactically they look the same (although D's can do more things) so I'm trying to understand how why in D it's called template but in languages like C#/Java they're generics. I guess I have fair understanding of D's code generation

Re: problem using std.format on Arm

2020-08-08 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/8/20 1:00 PM, Jeremiah Glover wrote: What can I do to fix this and get the most recent version of phobos that will compile? You are using an old version of the compiler. formattedRead used to accept only pointers, not by ref. See https://github.com/dlang/phobos/pull/5009 Try doing:

Re: problem using std.format on Arm

2020-08-08 Thread Johan via Digitalmars-d-learn
On Saturday, 8 August 2020 at 17:00:17 UTC, Jeremiah Glover wrote: I've been wanting to put together a programming to teach D. The raspberry pi seemed like a good computer to use so everyone could be guaranteed to have a computer to practice on. I've had some trouble, however, getting a test

problem using std.format on Arm

2020-08-08 Thread Jeremiah Glover via Digitalmars-d-learn
I've been wanting to put together a programming to teach D. The raspberry pi seemed like a good computer to use so everyone could be guaranteed to have a computer to practice on. I've had some trouble, however, getting a test project to compile, and the first culprit lives in std.format. I

Re: dpldocs not update

2020-08-08 Thread Per Nordlöw via Digitalmars-d-learn
On Friday, 7 August 2020 at 23:58:03 UTC, Adam D. Ruppe wrote: Maybe someday we can link in dub's update to click that button for you but for the foreseeable future you need to hit it yourself to update the docs. Got it. Thanks a lot for now, anyway.

Re: iopipe code to count lines in gzipped file works with v 0.1.7 but fails with 0.2.1

2020-08-08 Thread Andrew via Digitalmars-d-learn
On Saturday, 8 August 2020 at 02:06:36 UTC, Steven Schveighoffer wrote: On 8/7/20 9:31 PM, Steven Schveighoffer wrote: On 8/7/20 8:57 PM, Steven Schveighoffer wrote: I think this is an issue with dub when using an inline recipe file, but I don't know? ugh. This is an issue with iopipe

Re: How does D's templated functions implementation differ from generics in C#/Java?

2020-08-08 Thread Jacob Carlborg via Digitalmars-d-learn
On 2020-08-07 23:03, aberba wrote: Syntactically they look the same (although D's can do more things) so I'm trying to understand how why in D it's called template but in languages like C#/Java they're generics. I guess I have fair understanding of D's code generation but isn't it same as

Re: How does D's templated functions implementation differ from generics in C#/Java?

2020-08-08 Thread Jacob Carlborg via Digitalmars-d-learn
On 2020-08-07 23:39, H. S. Teoh wrote: They are *very* different. Java generics are based on "type erasure", i.e., at the syntactic level, containers are parametrized with the element types, but at the implementation level, the element types are merely "erased" and replaced with Object (a top

Re: How does D's templated functions implementation differ from generics in C#/Java?

2020-08-08 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, Aug 08, 2020 at 01:47:27AM +, jmh530 via Digitalmars-d-learn wrote: > On Friday, 7 August 2020 at 21:39:44 UTC, H. S. Teoh wrote: > > [snip] > > "Furthermore, it can dispatch to a type-erased implementation ala Java > -- at your choice;" > > This is interesting. Would you just cast