OpenArrays in Oxygene?

Hello guys,

would you consider introducing the FPC/Delphi princip of open-Arrays?

When I want to pass an Array, which length is determined at runtime, as it seems to me, this isnt possible now, I just can pass dynamic.-Arrays.

–Shpend

not sure i understand. we do have support for open arrays. https://docs.elementscompiler.com/API/StandardTypes/Arrays/

Mark, actually no, I dont mean this^^

I mean, more this:

https://www.freepascal.org/docs-html/ref/refsu68.html

What will this give us that dynamic arrays do not?

It will give you the possibility to pass a stack-array instead of heapallocated-array.

Are high level arrays syntactic sugar around a platform collection type ?

Yes. they are implemented in the Swift Base Library, as mapped type to the platform native List/NSArray classes.

Unfortunately the syntax FPC uses is already in use for regular arrays so we can’t support that. We might do a special reference type at some point in the future, but there are no plans to add this at this point.

1 Like

Ok, But better than nothing :smiley:

Btw, I know this is offtopic^^ but, can you tell me pls, when would you say, this Problem of casting an enum to ist basetype, like:

 var TRange = 0..1000;
 var Enm = enum(a = 20, b = 40, c = 100) of TRange;
 var myVar := TRange(Enm.a); //yet it raises an error

Would be fixed?

I understand it is offtopic, but I get to much Errors because of this and yes i can cast it to int32/int64 but it would currently just “pervert” the sourcecode when I Need to cast to int32 everywhere its used.

Hmm but shouldnt it be then a stack-allocated-array^^ ?

It’s logged, however I can’t say when it will be done.