Re: 2-D array initialization

2020-08-01 Thread Andy Balba via Digitalmars-d-learn
On Saturday, 1 August 2020 at 22:00:43 UTC, Ali Çehreli wrote: On 8/1/20 12:57 PM, Andy Balba wrote: > On Saturday, 1 August 2020 at 00:08:33 UTC, MoonlightSentinel wrote: >> On Friday, 31 July 2020 at 23:42:45 UTC, Andy Balba wrote: >>> How does one initialize c in D ? >> >> ubyte[3][4] c = [

Re: D on lm32-CPU: string argument on stack instead of register

2020-08-01 Thread Chad Joan via Digitalmars-d-learn
On Saturday, 1 August 2020 at 08:58:03 UTC, Michael Reese wrote: [...] So the compiler knows how to use r1 and r2 for arguments. I checked again in the lm32 manual (https://www.latticesemi.com/view_document?document_id=52077), and it says: "As illustrated in Table 3 on page 8, the first

Re: 2-D array initialization

2020-08-01 Thread Ali Çehreli via Digitalmars-d-learn
On 8/1/20 12:57 PM, Andy Balba wrote: > On Saturday, 1 August 2020 at 00:08:33 UTC, MoonlightSentinel wrote: >> On Friday, 31 July 2020 at 23:42:45 UTC, Andy Balba wrote: >>> How does one initialize c in D ? >> >> ubyte[3][4] c = [ [5, 5, 5], [15, 15,15], [25, 25,25], [35, 35,35] ]; > I'm a D

Re: 2-D array initialization

2020-08-01 Thread Andy Balba via Digitalmars-d-learn
On Saturday, 1 August 2020 at 00:08:33 UTC, MoonlightSentinel wrote: On Friday, 31 July 2020 at 23:42:45 UTC, Andy Balba wrote: How does one initialize c in D ? ubyte[3][4] c = [ [5, 5, 5], [15, 15,15], [25, 25,25], [35, 35,35] ]; none of the statements below works c = cast(ubyte) [

Re: Lack of asm volatile qualifier (explicitly) again.

2020-08-01 Thread Iain Buclaw via Digitalmars-d-learn
On Saturday, 1 August 2020 at 02:36:41 UTC, Cecil Ward wrote: On Thursday, 30 July 2020 at 07:05:39 UTC, Iain Buclaw wrote: [...] Ah. I wasn’t thinking about pure, although I do use it everywhere I can as a matter of course. The absence of something doesn’t hit you in the eye as an

Re: dynamic array .length vs .reserve - what's the difference?

2020-08-01 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/31/20 12:32 PM, wjoe wrote: On Friday, 31 July 2020 at 04:28:57 UTC, Ali Çehreli wrote: Another option, which is curiously said to be more performant in memory allocation than native arrays, is std.array.Appender. I've used function-local static Appenders to cut down on memory allocation.

Re: Overload comparison operators for "nullable" types

2020-08-01 Thread Oleg B via Digitalmars-d-learn
On Thursday, 30 July 2020 at 14:52:17 UTC, H. S. Teoh wrote: On Thu, Jul 30, 2020 at 01:41:05PM +, Oleg B via Digitalmars-d-learn wrote: [...] Logically we can compare versions, but what must return `opCmp` if one of versions has 'not comparible' state? [...] opCmp is allowed to return

Re: D on lm32-CPU: string argument on stack instead of register

2020-08-01 Thread Michael Reese via Digitalmars-d-learn
On Friday, 31 July 2020 at 15:13:29 UTC, Chad Joan wrote: THAT SAID, I think there are things to try and I hope we can get you what you want. If you're willing to entertain more experimentation, here are my thoughts: Thanks a lot for the suggestions and explanations. I tried them all but