Be concise.
Be useful.
All contributions dictatorially edited by webmasters to match personal tastes.
Please do not paste any copyright violating material.
Please try to avoid dependencies to third-party libraries and frameworks.
- C#
- Dart
- Erlang
- Fortran
- Go
- Haskell
- JS
- Java
- Java
- Kotlin
- Perl
- Python
- Python
- Python
- Python
- Python
- Ruby
- Rust
var a = 42, b = "Hello", c = 5.0;
can be different types if using var to declare them. Dart will use type inference to assign the correct types to each variable.
{A, B, C} = {42, "hello", 5.0}.
integer :: a, b, c
If you put them on a line, they need to have the same attribute. Type is just one such attribute, you can also use dimension or allocatable or others.
a, b, c := 42, "hello", 5.0
a, b and c may have different types.
(a, b, c) = (42, "hello", 5.0)
const [a, b, c] = [42, "hello", 5.0];
a, b, and c may have different types.
int a, b, c = b = a = 123;
Object a = 42, b = "Hello", c = 5.;
my ($a, $b, $c) = (1, '2', 'three');
a, b, and c may have different types.
a, b, c = 42, 'hello', 5.0
a, b and c may have different types.
a, b, c = 'xyz'
a, b, *c = '110000'
This syntax is very useful in parsing "block code" data.
*a, b, c = '000011'
'... If the target list contains one target prefixed with an asterisk, called a “starred” target: The object must be an iterable with at least as many items as there are targets in the target list, minus one.'
a, b, c = 42, 'hello', 5.0
Types may differ.
let (a, b, c) = (42, "hello", 5.0);
a, b, and c may have different types.