Need Tuple Inspectors, No easy way to convert a plural set of objects into a tuple

There currently isn’t an easy way to turn a plural set of objects into a tuple.

There is currently tuple string item which allows you to convert a string that takes the form of a tuple back into individual components, but there isn’t an easy way to go the other direction.

There are 3 parts missing, and all are needed. The following are the proposed methods.

One is to escape a string to be able to be made apart of a tuple string.

Q: tuple string of ("string2, string3")
A: "( string2, string3 )"

The other is to make a plural set of objects into a tuple string.

Q: tuple string of ("string1";"string2, string3";"";"string,5")
A: "string1, ( string2, string3 ), , ( string,5 )"

The last is to convert a plural set of objects into a tuple.

Q: tuple of ("string1";"string2, string3";"";"string,5")
A: string1, ( string2, string3 ), , ( string,5 )

Here is my ugly workaround for this one: https://bigfix.me/relevance/details/3007530


It would also be extremely useful if there was an iterator for tuples.

It would also be useful if tuple string items would give you the index and not just the string result.

Q: (index of it, it) of tuple string items of "string1, ( string2, string3 ), , ( string,5 )"
A: 0, string1
A: 1, ( string2, string3 )
A: 2, 
A: 3, ( string,5 )

Related:


CC: @AlanM

1 Like

There are many inspectors that don’t have iterators in general that should.

There are also many inspectors that allow you to transform data one way, but not easily the other way which could be addressed.

I want to do a better job documenting some of these issues.

What is the difference between the tuple string and the tuple set? They seem the same or is one the object type of “tuple” ?

I think I answered my own question but I think you meant to do it this way?

Q: tuple of ("string1";"string2, string3";"";"string,5")
A: string1
A: ( string2, string3 )
A:
A: ( string,5 )

But that seems to be the same as tuple string items? Or am I missing something

The “tuple” operator doesn’t actually exist, I think that’s just an example of what @jgstew (and I as well) would like to see - an operator that would take the string set, properly escape each item with “( )” if necessary, and then treat it as an indexed tuple string.

Q: tuple of ("string1";"string2, string3";"";"string,5")
E: The operator "tuple" is not defined.
1 Like

Yes I know, I’m just looking at implementing them… maybe… :slight_smile: But the example there seems redundant as it would just give the same thing back, as the (“string1”;“string2, string3”;"";“string,5”) is just a way of representing multiple answers.

1 Like

I’m basically wanting a way to turn a plural result into a tuple, then add on to that tuple things that are of different type.

It should be possible to go from a tuple of the same object to a plural result and a plural result into a tuple.

a tuple string is different than a tuple but they are similar.

There should also be a way to turn a tuple string into a tuple like there is to turn a tuple into a tuple string.