Is there a shell that supports distinguishing between variable types and multidimensional arrays?
At a minimum, it should distinguish between Strings, Integers, Floats and Doubles.
The following commands should be different. command 1
and command "1"
if variable types were supported. Notice it would be similar to a c function like fun(1)
and fun("1")
. Alternatively it should have 2 separate syntaxes for shell and calling functions.
Best Answer
Perl Shell supports three types of variables: scalars, lists, and hashes.
and
It doesn't so much distinguish between Strings, Integers, Floats and Doubles[1], as seamlessly convert between them as needed, exactly as Perl does.
It's difficult to see any reason why a shell would need to distinguish between a number
1
and the string"1"
in any situation where auto-coversion was the Wrong Thing To Do, or where different operators for string vs numeric vs regexp comparison didn't suffice. Much likebash
or other shells do.[1] See specialist modules like Math::BigFloat if special handling of float types is required. or Math::Bigint for very large integers.