top of page
Search
Writer's pictureIvaylo Fiziev

Bit indexer gap for array elements

It has been a while since we had this gap. The bit indexers were simply not implemented in the context of array elements. The syntax was there but the interpretation part was missing. I got a complaint recently about this so it seems like the time has come to revisit the code.

Overall it seems like a simple thing to do but we have to cover all the possible use-cases (basically statements and expressions). Let's look at those in detail:


Use cases:

  1. Using bit indexers in expressions Examples: a) #arr[1].%X0 - read the first bit of element 1 in the array b) #arr[1].field.%X0 - read the first bit of a field inside a UDT stored in element 1 in the array c) #arr[1].field[2].%X0 - read the first bit of an array element inside a UDT stored in element 1 in the array

  2. Using bit indexers in statements Examples: a) #arr[1].%X0 := <expr>; - set the first bit of element 1 in the array to 1 b) #arr[1].field.%X0 := <expr>; - set the first bit of a field inside a UDT stored in element 1 in the array c) #arr[1].field[2].%X0 := <expr>; - set the first bit of an array element inside a UDT stored in element 1 in the array

In both cases the nesting of arrays and UDTs can be arbitrary. Expressions can vary in complexity as well. So you see why it was left behind...


Anyway this feature will be available in v2408.

Cheers!

15 views0 comments

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
bottom of page