Hello Tim,
Anyway I like how you can get a slice of array that is just a view
into the original. If I modify the slice, it modifies the full
original array which can be very useful. If however I modify the
length of the slice which I was doing in an attempt to extend the
view, it becomes it's ow
Steven Schveighoffer wrote:
This is really not a good idea. You've removed one of the core features
of the array -- memory safety. Doing this is just asking for memory
corruption. You should either re-slice the original array, or create a
type that has a reference to the original array so it
On Wed, 08 Jul 2009 23:09:52 -0400, Tim Matthews
wrote:
Steven Schveighoffer wrote:
On Wed, 08 Jul 2009 02:48:31 -0400, Tim Matthews
wrote:
Was this a design choice, bug, undefined behavior, etc...?
design choice.
A slice *is* an array in the current design. Increasing the length
Steven Schveighoffer wrote:
On Wed, 08 Jul 2009 02:48:31 -0400, Tim Matthews
wrote:
Was this a design choice, bug, undefined behavior, etc...?
design choice.
A slice *is* an array in the current design. Increasing the length may
or may not make a copy of it. An array slice doesn't know
I want to extract some files from a game archive providing path strings
like "data/ai/campaign/leaders.csv".
So I tried mkdirRecurse to create the directory structure, this works
fine but also creates folders named after the files, "leaders.csv" in
this case.
So I added dirname:
mkdirRecurse(di
Jarrett Billingsley wrote:
> On Tue, Jul 7, 2009 at 8:29 AM, downs wrote:
>> But then isn't what he asks for kinda impossible by design? I mean,
>> interfaces are bound at runtime. That's what they _do_.
>>
>
> Now read *my* post, downs. ;)
:blushes:
Here I created a template for getting an arrays base type. I also made the
std.string.replaceSlice function accessible with wstrings.
May someone could use it or integrate it into phobos...
(module std.traits)
template ArrayBaseType(A : E[],E)
{
alias E ArrayBaseType;
}
(module std.str
Ellery Newcomer wrote:
I'm tired and witless just now, but I can't think of any reason why
assert should be an expression and not a statement.
Any clues?
assert only evaluates to void but maybe someone writes something like:
module test;
import std.stdio;
void main()
{
bool readyForMath
Kagamin wrote:
For this I use begin markers:
ubyte[] buff=new ubyte[100];
int half=buff.length/2;
ubyte[] buff1=buff[0..half];
ubyte[] buff2=buff[half..$];
I actually think this has nothing to do with my OP.
Jesse Phillips wrote:
On Tue, 07 Jul 2009 12:04:43 +0200, Lars T. Kyllingstad wrote:
Jesse Phillips wrote:
I don't know if I'm misunderstanding the use of shell() or if this is a
bug. Trying to run some programs with shell error with a could not
close file. Sadly it I can come to any reasonabl
Ellery Newcomer Wrote:
> I'm tired and witless just now, but I can't think of any reason why
> assert should be an expression and not a statement.
>
> Any clues?
A requirement for assert expression to be inside ExpressionStatement?
Kagamin Wrote:
> Tim Matthews Wrote:
>
> > Was this a design choice, bug, undefined behavior, etc...?
>
> Design choice. In order to widen slice to should recreate it from the
> original array.
For this I use begin markers:
ubyte[] buff=new ubyte[100];
int half=buff.length/2;
ubyte[] buff1=bu
Tim Matthews Wrote:
> Was this a design choice, bug, undefined behavior, etc...?
Design choice. In order to widen slice to should recreate it from the original
array.
I'm tired and witless just now, but I can't think of any reason why
assert should be an expression and not a statement.
Any clues?
14 matches
Mail list logo