Stupid little iota of an idea

Simen kjaeraas simen.kjaras at gmail.com
Sat Feb 12 18:44:55 PST 2011


Nick Sabalausky <a at a.a> wrote:

> f[1..5] // opSlice with ints, or opIndex with a range?

This is also an interesting point. If a..b were to be a separate type,
opSlice would no longer need to exist, it could be a simple overload
of opIndex. This would easily enable multi-dimensional slicing, which
currently is impossible in D (barring tricks like using opIndex behind
the scenes and a struct with overloaded slicing to create the slice
indices: foo[ _[0..1], _[2..3] ];).

-- 
Simen


More information about the Digitalmars-d mailing list