I’m looking for a succinct expression for evaluating whether or not all the items in a list are either Longs or may be converted to Longs. I’m looking for a compact expression, but I prefer readability over mere code golf.
Examples:
assert expr([1,2,'3'])
assert expr([1,'fish',3]) == false
assert expr([null]) == false
assert expr([' ', 17]) == false
For readability, I would do something like:
Just for the lulz, this other solution is horrible, but it’s very succinct and covers all the test cases: