If anyone cares, I've put up a little thing about why it's best not to use
D's arrays as stacks. This is drawn from a direct experience a few months
ago. Figured if I fell into that trap then others might too, so this could
be helpful for some people. There's a no-login-needed comments section
On Sunday, September 25, 2011 02:37:25 Nick Sabalausky wrote:
> If anyone cares, I've put up a little thing about why it's best not to use
> D's arrays as stacks. This is drawn from a direct experience a few months
> ago. Figured if I fell into that trap then others might too, so this could
> be he
On 9/25/11 1:37 AM, Nick Sabalausky wrote:
If anyone cares, I've put up a little thing about why it's best not to use
D's arrays as stacks. This is drawn from a direct experience a few months
ago. Figured if I fell into that trap then others might too, so this could
be helpful for some people. Th
"Nick Sabalausky" wrote in message
news:j5mi7l$1dtf$1...@digitalmars.com...
> If anyone cares, I've put up a little thing about why it's best not to use
> D's arrays as stacks. This is drawn from a direct experience a few months
> ago. Figured if I fell into that trap then others might too, so
On Sun, Sep 25, 2011 at 1:45 AM, Jonathan M Davis wrote:
> On Sunday, September 25, 2011 02:37:25 Nick Sabalausky wrote:
>> If anyone cares, I've put up a little thing about why it's best not to use
>> D's arrays as stacks. This is drawn from a direct experience a few months
>> ago. Figured if I f
On Sunday, September 25, 2011 03:18:29 Andrew Wiley wrote:
> On Sun, Sep 25, 2011 at 1:45 AM, Jonathan M Davis
wrote:
> > On Sunday, September 25, 2011 02:37:25 Nick Sabalausky wrote:
> >> If anyone cares, I've put up a little thing about why it's best not to
> >> use D's arrays as stacks. This i
"Jonathan M Davis" wrote in message
news:mailman.160.1316939358.26225.digitalmar...@puremagic.com...
> On Sunday, September 25, 2011 03:18:29 Andrew Wiley wrote:
>>
>> Isn't this exactly what assumeSafeAppend is for?
Hmm, I didn't know about that. (Actually, I remember hearing it mentioned
befo
On Sunday, September 25, 2011 07:05:34 Nick Sabalausky wrote:
> "Jonathan M Davis" wrote in message
> news:mailman.160.1316939358.26225.digitalmar...@puremagic.com...
>
> > On Sunday, September 25, 2011 03:18:29 Andrew Wiley wrote:
> >> Isn't this exactly what assumeSafeAppend is for?
>
> Hmm, I
Nick Sabalausky:
> https://www.semitwist.com/articles/article/view/don-t-use-arrays-as-stacks
Is it possible to write a function like:
ForeachType!A unsafePop(A)(A)if(isDynamicArray!A) { /*...*/ }
that contains both the popping (and something like assumeSafeAppend to mess
with the druntime dat
Nick Sabalausky wrote:
> "Jonathan M Davis" wrote in message
> news:mailman.160.1316939358.26225.digitalmar...@puremagic.com...
>> On Sunday, September 25, 2011 03:18:29 Andrew Wiley wrote:
>>>
>>> Isn't this exactly what assumeSafeAppend is for?
>
> Hmm, I didn't know about that. (Actually, I r
On Sun, 25 Sep 2011 02:37:25 -0400, Nick Sabalausky wrote:
If anyone cares, I've put up a little thing about why it's best not to
use
D's arrays as stacks. This is drawn from a direct experience a few months
ago. Figured if I fell into that trap then others might too, so this
could
be help
On Sun, 25 Sep 2011 07:05:34 -0400, Nick Sabalausky wrote:
"Jonathan M Davis" wrote in message
news:mailman.160.1316939358.26225.digitalmar...@puremagic.com...
On Sunday, September 25, 2011 03:18:29 Andrew Wiley wrote:
Isn't this exactly what assumeSafeAppend is for?
Hmm, I didn't know ab
"Steven Schveighoffer" wrote in message
news:op.v2e19fkieav7ka@localhost.localdomain...
> On Sun, 25 Sep 2011 02:37:25 -0400, Nick Sabalausky wrote:
>
>> If anyone cares, I've put up a little thing about why it's best not to
>> use
>> D's arrays as stacks. This is drawn from a direct experience
Nick Sabalausky:
> Not that slicing a stack would be all that common, but if it were done for
> whatever reason...
Is it possible to write a function like:
ForeachType!A unsafePop(A)(A)if(isDynamicArray!A) { /*...*/ }
that contains both the popping (and something like assumeSafeAppend to mess
"bearophile" wrote in message
news:j5rn5o$1q0g$1...@digitalmars.com...
> Nick Sabalausky:
>
>> Not that slicing a stack would be all that common, but if it were done
>> for
>> whatever reason...
>
> Is it possible to write a function like:
>
> ForeachType!A unsafePop(A)(A)if(isDynamicArray!A) {
On Tue, 27 Sep 2011 00:22:02 -0400, Nick Sabalausky wrote:
"Steven Schveighoffer" wrote in message
[1] Why is the capacity set to zero instead of the actual length of
four? I'm not certain, but my guess is that zeroing the value is
slightly faster than copying the length. Either that, or perh
"Steven Schveighoffer" wrote in message
news:op.v2ita9hseav7ka@localhost.localdomain...
> On Tue, 27 Sep 2011 00:22:02 -0400, Nick Sabalausky wrote:
>
> There's never a guarantee that a slice will always point at the current
> values. There can't be, because you can never guarantee it will not
On Wed, 28 Sep 2011 12:11:29 -0400, Nick Sabalausky wrote:
Of course, as it is now, the slice owner won't even know if
the values it points to have been pooped off and *not* been pushed back
on
again.
Freudian slip or simple typo? Either way, *hilarious* :) Gives a new
mental picture
"Steven Schveighoffer" wrote in message
news:op.v2i2yv0beav7ka@localhost.localdomain...
> On Wed, 28 Sep 2011 12:11:29 -0400, Nick Sabalausky wrote:
>
>> Of course, as it is now, the slice owner won't even know if
>> the values it points to have been pooped off and *not* been pushed back
>> on
"Nick Sabalausky" wrote in message
news:j5vte2$3ql$1...@digitalmars.com...
>
> ...Although I'm not [*sure*] I like the implications...
>
20 matches
Mail list logo