Tuples and Plurals and Back Again

Took me a few minutes to find the notes I wrote myself on this before, so here’s a quick snippet on Tuples, Plurals, Tuple Strings, and converting between them.

tuple result
q: ( "3.1.0.0", "3.1" )
A: 3.1.0.0, 3.1
I: singular ( string, string )

tuple turned into a single string
q: (it as string) of ( "3.1.0.0", "3.1" )
A: 3.1.0.0, 3.1
I: singular string

from a tuple string, the tuple items can be retrieved as plural values
q: tuple items of (it as string) of ( "3.1.0.0", "3.1" )
A: 3.1.0.0
A: 3.1
I: plural tuple item

tuple items have indexing
q: (index of it, it) of tuple items of (it as string) of ( "3.1.0.0", "3.1" )
A: 0, 3.1.0.0
A: 1, 3.1
I: plural ( integer, tuple item )

retrieve the first tuple item
q: tuple items whose (index of it = 0) of (it as string) of ( "3.1.0.0", "3.1" )
A: 3.1.0.0
I: plural tuple item

retrieve the last tuple item
q: items 0 of (tuple items of it, maximum of indexes of tuple items of it ) whose (index of item 0 of it = item 1 of it) of (it as string) of ( "3.1.0.0", "3.1" )
A: 3.1
I: plural tuple item

from plural strings (but not directly from plural tuple items) we can go back to a tuple string
q: tuple string of (it as string) of (tuple items of (it as string) of ( "3.1.0.0", "3.1" ))
A: 3.1.0.0, 3.1
I: singular string

// count of tuple string items
q: number of tuple string items of tuple string of (it as string) of (tuple items of (it as string) of ( "3.1.0.0", "3.1" ))
A: 2
I: singular integer

// first tuple string item
q: tuple string item (0) of tuple string of (it as string) of (tuple items of (it as string) of ( "3.1.0.0", "3.1" ))
A: 3.1.0.0
I: singular string

// last tuple string item
q: tuple string item (number of tuple string items of it - 1) of tuple string of (it as string) of (tuple items of (it as string) of ( "3.1.0.0", "3.1" ))
A: 3.1
I: singular string
7 Likes

Can those be added as tuple examples within the relevance inspector search results? They are very helpful.

https://developer.bigfix.com/relevance/search/?query=tuple&platform=aix%2Chp-ux%2Cmac%2Credhat%2Csuse%2Csolaris%2Cwindows%2Cdebian%2Cubuntu%2Craspbian%2Ccentos%2Coracleenterprise%20linux%2Camazonlinux%202%2Clinux

1 Like