Skip to content

Instantly share code, notes, and snippets.

@jnthn
Created July 1, 2015 09:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jnthn/fa6a9a3618ae322cb581 to your computer and use it in GitHub Desktop.
Save jnthn/fa6a9a3618ae322cb581 to your computer and use it in GitHub Desktop.
S09 - the dubious bits

Things I've spotted in S09 that want a review

Array is compact?

We pretty solidly have Array as a reference type. However, it's in the list of things that make a compact array:

my Array @ragged2d;

I guess this is fossil?

Native arrays and buffers

S09 says, "A compact array is for most purposes interchangeable with the corresponding buffer type.". It then goes on to note that these are supposedly the same:

my uint8 @buffer;
my buf8 $buffer;

This is odd for one before we never vivified a buf8 in $buffer (so it'd seem you need a ".= new"), but more generally we need to decide how much we believe this section. If we really do then it'd mean that (lowercase) array goes away, but then that buf can also be instantiated with nums and the like.

The || flattener

How much do we still believe in || as a semi-colon level argument flattener? It's used like this:

@shape = 4, 2;
my int @ints[ ||@shape ];

At the moment we don't parse | or || in subscripts in general, and || isn't implemented.

Assignment vs binding

Surely these have to use binding rather than assignment?

my num @nums = Array of num.new(:shape(3;3;3));
my num @nums .=new():shape(3;3;3); # same thing

**

How does this:

my @grid[**];                      # Any number of dimensions

Differ from not having ** there at all, or from:

my @grid[*];

Semantically, and from:

my @grind;

Since in all these cases, we can auto-viv an Array to get another dimension?

.shape on [] and {}

I don't see how this can possibly work:

@array[].shape      # the integer indices
@array{}.shape      # the user-defined indices

Since a zen slice simply hands back a Parcel (List after GLR?) of the values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment