Re: problems with std.bitmanip.append (bug?)

2015-03-27 Thread Hugo via Digitalmars-d-learn
On Friday, 27 March 2015 at 08:43:56 UTC, John Colvin wrote: Think of it as compile-time arguments and run-time arguments. First set of parenthesis are compile-time, second are run-time. The parenthesis are optional for compile-time arguments iff there's only one of them. I really appreci

Re: problems with std.bitmanip.append (bug?)

2015-03-27 Thread John Colvin via Digitalmars-d-learn
On Friday, 27 March 2015 at 00:50:34 UTC, Hugo wrote: On Thursday, 26 March 2015 at 12:29:03 UTC, John Colvin wrote: On Thursday, 26 March 2015 at 12:21:23 UTC, Hugo wrote: Also, can anyone provide a similar example but using little endian order? If only to contrast differences between modes

Re: problems with std.bitmanip.append (bug?)

2015-03-26 Thread Hugo via Digitalmars-d-learn
On Thursday, 26 March 2015 at 12:29:03 UTC, John Colvin wrote: On Thursday, 26 March 2015 at 12:21:23 UTC, Hugo wrote: Also, can anyone provide a similar example but using little endian order? If only to contrast differences between modes of invocation... void main() { import std.stdio,

Re: problems with std.bitmanip.append (bug?)

2015-03-26 Thread John Colvin via Digitalmars-d-learn
On Thursday, 26 March 2015 at 12:21:23 UTC, Hugo wrote: On Thursday, 26 March 2015 at 10:07:07 UTC, Hugo wrote: If only the documentation and/or test units were more clear... OK, I made a simpler test, using an example from the documentation: void main() { import std.stdio, std.array,

Re: problems with std.bitmanip.append (bug?)

2015-03-26 Thread Hugo via Digitalmars-d-learn
On Thursday, 26 March 2015 at 10:07:07 UTC, Hugo wrote: If only the documentation and/or test units were more clear... OK, I made a simpler test, using an example from the documentation: void main() { import std.stdio, std.array, std.bitmanip; auto buffer = appender!(const ubyte[])()

Re: problems with std.bitmanip.append (bug?)

2015-03-26 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/26/15 6:07 AM, Hugo wrote: On Thursday, 26 March 2015 at 02:39:56 UTC, Steven Schveighoffer wrote: An array as an output range writes to the front. You can use std.array.Appender to get appending behavior. I know, it's weird. Alternatively, you can add more bytes to the array, and append

Re: problems with std.bitmanip.append (bug?)

2015-03-26 Thread Hugo via Digitalmars-d-learn
On Thursday, 26 March 2015 at 02:39:56 UTC, Steven Schveighoffer wrote: An array as an output range writes to the front. You can use std.array.Appender to get appending behavior. I know, it's weird. Alternatively, you can add more bytes to the array, and append to the slice, but that may be