`["a", "b", "c"].join(iterable)` was rejected because it forces every iterable to implement iterable functions.
Additionally some iterables, like generators, are mutated when you iterate over them:
", ".join(streaming_api.fetch_names())
UFCS let's you write join as a free function and still use "".join(iterable)
NaN guarding:
import std.traits;
auto unwrap(T)(T input) if (isFloatingPoint!T) {
// Asserts cost nothing when turned off with -check=assert=off
// The compiler can fully inline this function, so it isn't expensive
assert(input !== input.nan);
return input;
}
Use like this:
if (objSize.unwrap < cellSize) {
// Allocate a new cell for the object
} else {
// Insert into current cell
}
https://mail.python.org/archives/list/[email protected]... https://mail.python.org/archives/list/[email protected]... https://mail.python.org/archives/list/[email protected]... https://mail.python.org/archives/list/[email protected]...
`["a", "b", "c"].join(iterable)` was rejected because it forces every iterable to implement iterable functions.
Additionally some iterables, like generators, are mutated when you iterate over them:
UFCS let's you write join as a free function and still use "".join(iterable)NaN guarding:
Use like this: The parentheses are omitted because Dlang has https://dlang.org/spec/function.html#optional-parenthesis. The above compiles into this: