Re: is the array literal in a loop stack or heap allocated?

2023-10-12 Thread Steven Schveighoffer via Digitalmars-d-learn
On 10/10/23 10:54 PM, mw wrote: Hi, I want to confirm: in the following loop, is the array literal `a` vs. `b` stack or heap allocated? and how many times? ask the compiler: ```d void main() @nogc { int[2] a; int[] b; int i; while(++i <=100) { a = [i, i+1]; // array literal //b =

Re: dlang.org/spec/function.html#pure-functions example

2023-10-12 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, October 12, 2023 1:33:32 PM MDT Paul via Digitalmars-d-learn wrote: > The spec doc has the following statement and corresponding > example: > ***"Pure functions cannot directly access global or static > mutable state."*** > > ```d > int x; > immutable int y; > > pure int foo(int i) >

Re: The Power of Grammar Checkers: A Game-Changer for Writers!

2023-10-12 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, October 12, 2023 2:19:20 AM MDT Imperatorn via Digitalmars-d- learn wrote: > On Thursday, 12 October 2023 at 06:08:43 UTC, charles reiley > > wrote: > > I hope you're all doing well in your writing endeavors! Today, > > I wanted to share my thoughts and experiences with grammar > >

Re: The Power of Grammar Checkers: A Game-Changer for Writers!

2023-10-12 Thread Imperatorn via Digitalmars-d-learn
On Thursday, 12 October 2023 at 06:08:43 UTC, charles reiley wrote: I hope you're all doing well in your writing endeavors! Today, I wanted to share my thoughts and experiences with grammar checkers, and I can't emphasize enough how much of a game-changer they've been for me atÂ