Macro kdb::list[][src]

macro_rules! list {
    ($($expr:expr),+$(,)?) => { ... };
    ($t:ty; $($expr:expr),+$(,)?) => { ... };
}

Create a list from a set of supplied values.

#Example

use kdb::{Any, KBox, List, Timestamp, list, symbol};
// A list of ints, using type inference
let a = list![i32; 1, 2, 3, 4, 5];
assert_eq!(15, a.iter().copied().sum());

// Same list, without an explicit type in the macro
let b: KBox<List<i32>> = list![1, 2, 3, 4, 5];

// Creating a mixed list requires the type
let c = list![Any; 1, symbol("Hello"), Timestamp::from(SystemTime::now())];
assert_eq!(c.len(), 3)