expr icon indicating copy to clipboard operation
expr copied to clipboard

suggestion: built in syntax for array indexing

Open bjorndm opened this issue 1 year ago • 1 comments

Sorry, but here is another suggestion. Now, expr has arrays, which is very useful. But there is no built in syntax right now to index them. While it is possible to use the Extender to add an index or similar function, built-in support would simplify the syntax for non-programmer end users. I was thinking that perhaps a .<integer> syntax could be used, like in your great gjson libary, although .[integer] now also works though the Extender. Again, I can probably contribute a PR but I'd like to ask if you consider this an acceptable feature?

Thanks again for your consideration!

bjorndm avatar Mar 15 '24 06:03 bjorndm

Ideally an array could be accessed using the standard accessor syntax, like arr[10].

tidwall avatar Jan 14 '25 18:01 tidwall