Question: I'm not sure how to call the ".." operator in D. I have seen it for:

```
// Slicing 
int[] t = list[3..$];

// Looping
foreach (x; 1..10) {}

```

But it seems I can't use it in some "logical" places, for example:

```
int[] test = 1..N;
auto harmonic_serie = map!"1 / a"(1..1000);

```

Is ".." only syntaxic sugar that can only be used in slicing and looping? Are we forced to use the less readable std.range.iota?

Answer: 
`..` is only used for slicing, `foreach`, and ranged case statements. None of those contexts requires creating any kind of struct or list to do what it does. Slicing is basically just take and using two indices, and `foreach` is simply lowered to a `for` loop with a counter which starts at the first value and increments until it reaches the second. For `..` to work in other contexts, it would need to be lowered to actual object of some kind or have some kind of list generated from the values, which is much more complicated (at least as far as the implementation goes). So, the language doesn't do any of that. For it to do something like what you're looking for, the compiler would have to actually be able to generate ranges, and all it understands about ranges is what's required to iterate over them with `foreach`.

`std.range.iota` actually creates a struct which is a range and doesn't require that the compiler or language understand anything about how it works. So, it can be used in places where you need an object to represent a range of values and `..` won't work.

I'm sure that it's technically possible to make `..` generate something like `iota` in other circumstances, but the approach taken by the D language designers at this point is that if something can be done in the library rather the the language, it should be done in the library, and if anything, they regret adding some features to the language rather than putting them in the library.
in the current grammar it is syntactic sugar

both the [Slice Expression](http://dlang.org/expression.html#SliceExpression) and the [foreach range expression](http://dlang.org/statement.html#ForeachRangeStatement) explicitly use the `..` operator,

granted creating an explicit IntRangeExpression that results in std.range.itoa would be handy