►
From YouTube: .NET Design Review: Index and Range
Description
A
All
righty,
so
I
did
enough
drinks.
I,
hope
you
all
right.
So
we
hosted
the
public
design
for
range
I.
Think
a
while
ago,
and
so
what's
kind
of
missing
is
me
and
they
did
this.
The
we
started
with
what
the
compiler
guys
prototype,
defectively
and
so
the
API
should
the
compiler
guys
had
was
only
the
API
that
the
compiler
actually
needed
to
take
a
dependency
on
to
emedco.
A
They
didn't
do
anything
beyond
that,
and
so
I
know
I
added
a
few
api
in
the
spec
lit,
I,
guess
and
then
Turek
sat
down
and
actually
for
the
people.
Looking
what
we
want
to
add
my
cursor
again
here
we
go
and
then
wasn't
any
saying
people
think
it's
all
the
ones
that
say
well,
no,
oh
well
known
are
the
ones
that
the
compiler
use
in
here
all
right,
that's
perfect,
all
right!
So
that
means
this
is
the
base
of
the
API
shape
of
the
type
we
have
so
I'm
pretty
sure.
B
A
A
E
A
G
H
I
E
H
F
F
K
K
A
K
J
F
H
K
K
That
right,
it's
actually
the
dot
dot
operator
right
now
is
not
defined
as
calling
range
crate
with
arbitrary
types
right.
So
we
actually
have
to
go
to
the
language
design
and
confirm
that
every
physical
means
instead
of
index.
What
does
it
call
right
now?
It
looks
for
index
okay
so
like,
but
clearly
you
have
special
term
handling
for
the
carrot,
the
Harrison
operator,
but.
B
K
M
A
A
J
F
Zero
thought
that
one
we
don't
want,
let's
strip
off
last
character
of
a
string.
Why
can't
you
just
make
it
explicit,
because
explicit
operators
are
fine
to
throw
as
far
as
normal
framework
rules
and
the
compiler
has
to
it,
made
the
call
to
the
conversion
operator
whether
it's
infants,
it
or
explicit,
but.
A
K
Didn't
say:
I
didn't
say
that
was
look
like
a
priori,
but
like
you
still
want
to
be
able
to
convert
your
intz
indexes
implicitly
right
like
every
you,
don't
want
every
single
person
who
ever
wants
to
take
an
index
who
writes
an
index,
indexer
yeah,
to
write
an
index
inductor
and
an
int
index
er
that,
like
that's
just
stupid,
you
write
one
index
index
er
and
then
er.
It
works
for
everything.
If
you
don't
care
about
person
and.
K
L
B
G
A
M
When
we
have
the,
when
we
had
the
meeting
about
essentially
like
what's
what's
the
return
type
of
the
range
operator
on
string
and
array,
and
we
decided
that
it's
a
string
in
an
array
not
a
span
like
we've,
already
kind
of
leaned
to
the
proto
50
side
of
this
feature,
and
not
the
third
side
of
this
feature
to
some
degree.
Well,.
L
K
E
A
Well,
that
is
basically
what
this
is
right,
so
that
I
think
I
think
all
create,
and
from
start
and
to
end
there
are
probably
not
message
that
anybody
in
c-sharp
will
call
right,
because
the
idea
is
that,
well,
you
have
syntax
on
the
language,
that's
what
you
would
use
in
the
compiler
would
do
it
for
you.
Yes,
so
I,
don't
think
the
company
I
mean
the
compiler
could
do
whatever
they
have
they
want,
and
you
know
we
can
always.
We
can
only
have
index
based
things
and
they
could
turn
it
into
into
index.
A
J
A
The
other
problem
is
when
you
consider
like
well
I,
wanted
to
define
my
own
types
that
accept
those
things
right.
At
that
point
you
are
and
like
when
you
just
talk
about
indexing.
Odd
ranges
right.
In
that
case,
you
probably
care
about
the
fact
you
don't
want
to
have
a
gazillion
overlords.
Yeah,
like
I,
mean
take
substring,
for
example.
It
would
be
nice
if
you
could
just
say
you
know,
give
me
the
start
position
and
give
me
the
end
position
as
two
indexes
and
then
I
mean
on
string.
A
L
M
It's
a
question
of
if
we
did
its
work,
it's
the
question
of
it.
We
seem
to
be
kind
of
pushing
like
who's
the
responsibility
for
this
exception.
I
can
come
from
in
excess
or
carfax
and
if
there's
an
implicit
conversion,
if
there's
an
implicit
conversion
from
int
to
index,
then
we
would
just
use
that
and
corvex
would
be
the
one
throwing
an
exception.
If
we
explicitly
decided
essentially
to
only
support
two
overloads
range,
then
the
compiler
would
be
inserting
the
implicit
conversion
and
it's
that's
kind
of
like
it's
that's.
M
J
K
E
What
he
must
said
is
like
we
can
take
the
language
discussion
kind
of
assigned,
because
what
email,
in
my
opinion,
what
Iman
said,
which
is
there's
gonna,
be
languages
that
don't
support
the
special
syntax
we
put
ad
is
that
they
can
index.
What
are
they
supposed
to
do
now?
Can
they
just
in
this
language,
pass
an
end
and
we
will
automatically
convert
it
and
possibly
it
will
fail
or
we
explicit
them.
You
know
all
we
have
to
add
lots
of
overloads
or
in
the
in
those
languages
they
have
to
do
an
explicit
cast.
F
A
F
The
fact
that,
by
default
with
their
existing
syntax,
they
do
I
think
the
opposite
of
this.
Where
from
and
it's
effectively
length
and
they
do
implicit
for
the
end,
I,
don't
even
know
they
do.
They
have
already
spent
it
for
ages.
They've
got
some
syntax
I,
don't
remember
exactly
what
it
is,
but
I
know
that
they
do
input
inclusive,
inclusive
rather
than
inclusive
exclusive
thanks.
It
well.
L
Okay,
it
just
seems
strange
to
me
that
we'd
be
I,
mean
I,
understand
the
the
argument,
but
it
feels
weird
that
we're
saying
we've
defined
0
do
x,
dot
y
to
mean
all
right.
We're
gonna
implicitly
cast
the
thing
to
index,
but
that
syntax
could
mean
anything.
We
could
define
it
to
mean
construct
an
index
from
the
two
things
and
passed
that
to
range
not
create
right
right.
K
L
K
Approach
for
alignment
for
the
language
could
be.
You
know
we
have
language
to
find
conversions
that
don't
exist
at
the
runtime
level
or
whatever.
We
could
implement
a
language
divine
conversion
for
intz
to
indexes,
and
then
the
behavior
would
be
exactly
the
same
as
this
implicit
operator
that
we
would
propose
right
like
so.
What's
I
just
don't
understand
what
the
value
prop
is
that
I
think
I'm.
M
The
way
Steven
the
way
that
we
originally
kind
of
did
this
was
we
said
the
way
that
this
was
designed,
then
why
it
actually
requires
no
change.
If
you
moved
the
four
overloads
as
we
said
that
when
you
do
for
an
expression
like
x,
dot
y,
in
the
same
way
that
when
you
do
like
from
X
and
blonde
link,
we
just
say
take:
we
change
that
to
a
dot,
select
call
what
for
X,
not
Y.
M
We
just
turned
that
range
that
create
X,
comma
Y,
and
we
interpret
the
expression
in
that
way,
and
so,
when
there
was
an
implicit
conversion
from
int
to
index
it
just
fell
out.
We
had
to
do
no
other
work,
but
if
we
remove
that
implicit
conversion,
then
the
compiler
says
you
know
in
dot
index
or
in
table
and
like
this
just
fails,
because
we
can't
there's
no
apical
applicable
overload
of
range
not
create
which
takes
these
arguments
so.
B
This
would
take
a
variable
instead
of
a
little
right.
So
once
we
start
talking
about
x,
dot
y
is
an
actual
expression.
Sure
if
we
have
an
implicit
operator,
the
implicit
operator
will,
by
the
rules
of
our
conversion
operators,
will
throw
an
invalid
cast
exception.
If
you
give,
if
your
variable
holds
the
value
negative
1,
if
it
instead
calls
range,
create
and
come
a
range
or
in
common
index,
it
will
throw
arguments
out
of
range
exception,
because
we
have
very
defined
behaviors
for
operators
versus
methods.
So
why
don't
we
so
here's
the
thing.
E
E
So
let
me
I
was
thinking
about
this.
We
have
this
guidance
for
the
reason
that
Jeremy
described
it's
basically
super
surprising
in
IP
is
like
I
passed.
Some
you
know
value
like
an
int
and
I
get
some
cast
exception
and
I'm
like
what
the
heck
I
was
not
even
casting
and
in
a
lot
of
cases,
throwing
any
other
exception
doesn't
make
any
sense,
because
we
don't
know
the
context
in
this
case.
E
D
E
D
E
E
A
That
the
problem
that
you
have
of
invalid
operates
a
cast
point
is
that
we
don't
have
a
good
failure
point
usually
in
your
source
code,
like
you,
just
pass
an
argument
to
a
master.
This
is
an
implicit
conversion
for
the
argument
and
you've
no
idea
what's
going
on.
But
if
you
consider
the
case
here
right,
the
user
calls
a
method
that
expects
an
index
right
when
we
own
it
there's
a
conversion
there.
A
All
the
user
constructs
a
range,
in
which
case
the
same
thing
happens
right,
so
the
so
the
lie
in
your
source
code,
where
the
exception
occurs.
It
is
exactly
the
same
line
where
the
exception
would
occur
if
the
receiving
method
would
throw
an
argument
or
an
exception.
So
from
a
user
standpoint,
you
are
you're
still
pointing
at
the
line
where
effectively
your
block
is
right,
so
intense,
and
so
that
says,
I
think
the
user
experience
will
be
fine.
The
other
thing
is,
let's
say,
to
remove
the
implicit
conversion.
A
We
effectively
have
an
implicit
conversion
from
head
X
right
because
the
it's
the
same
thing
you
have,
you
have
an
item
on
the
right
hand,
side
of
type
int.
You
pre-visit
of
the
above
the
head
appliance.
If
the
compiler
says
great,
let
me
construct
an
index
for
that,
so
the
compiler
will
call
you
know
basically
new
index
with
the
value
and
then
the
form
and
tool.
So
what
is
the
variable
that
holds
X
actually
is
negative.
5
same
thing
happens
there
by
the
constructor
will
throw
so
the
so.
K
The
compiler
defines
the
conversion
and
therefore
it
knows
that
certain
values
statically
are
out
balance
of
an
INT
and
will
give
you
a
compiler
error.
If
you
come
to
declare
a
value
that
is
out
of
balance,
but
we
had
the
language
define
conversion,
then
we
could
statically.
If
you
say
negative
1
in
your
range
constructor,
we
could
statically
give
an
error
so.
M
Have
to
throw
you
something
through
because
and
I
don't
and
either.
We
think
that
even
we
think
that
going
from
an
int
to
an
index
implicitly
throwing
is
wrong.
That
should
be
a
yes/no
decision
and
it
doesn't
matter
if
it's
core
FX
or
the
compiler.
That
you
know
is
the
one
who
ends
up
holding
the
PACU.
That's
what
we
do
or
what
we
don't
do.
We
shouldn't
say
core
effects:
I,
don't
think
it's
right
to
say:
Corp
X
does
one
do
it,
but
the
compiler
can
do
it.
L
M
A
M
M
B
M
A
Like
how
lucky
a
people
using
negative
end,
you
say,
like
literally
like
I,
think
most
common
cases
is,
you
have
a
variable.
You
got
it
from
somewhere,
you
use
it
for
indexing
and
then
turns
out.
It
actually
holds
a
negative
value
on
time
right,
if
you
actually
digital,
divide,
negative
3,
dot,
dot,
negative
five
I
think
it's
about
two
literals.
M
E
M
K
K
B
B
B
D
A
J
D
I'm
talking
from
what
we're
not
that
man
from
like
we
care
about
it
internally
in
the
api's
that
we
write
correct
in
our
SDKs
and
I'm
wondering
if,
if
these
have
having
all
of
these
conversions
back
and
forth,
will
effectively
double
the
amount
of
work
we're
doing,
maybe
not
it
I
haven't
thought
through
it.
No.
A
G
M
E
E
E
E
B
A
E
No
I
was
kind
of
saying
you
know
from
their
perspective,
let's
say
with
the
designer
type
from
scratch
right
and
we
want
to
support
the
language
syntax
and
he
will
probably
have
me
the
way
to
design
the
feature
would
be
20
an
indexer
attributed
wave.
You
know
language,
syntax
of
dot.
Dot
should
be
passed
in
here
and
then
have
an
envelope
that
says
from
the
end.
A
The
polymers
that
works
great,
they
literally
write
open
bracket
close
bracket
right.
It
immediately
falls
apart
when
you
want
to
treat
the
language
of
it
as
an
expression
as
an
expression
inside
the
type,
what's
the
type
of
X
dot,
but
why
yeah
I
know
you
can
normally
like
take
this
thing,
assign
it
to
a
variable
and
positive.
A
K
E
K
B
Associated
with
this
right,
like
you,
can
use
this
on
an
older
compiler,
there's
a
type
here
yeah
it
does
this
type
F
value,
I.
Think
that's
Christoph's
question:
does
this
type
have
intrinsic
value,
or
are
you
adding
semantics
or
very
we're,
adding
types
for
your
symmetric
sure
I
think
it
does
that
concerns
with
nobody
like
take.
A
Take
substring
or
other
things
right,
I
think
it's
a
nice
fit.
If
you
can
say
like
take
a
race,
it
might
widen
your
brain
segments
because
it's
much
nicer
there
to
pass
3d
venues
as
individual
things
and
always
have
to
be
consistent
about
how
you
name
things
that
people
know
that
all
this
is
the
starting.
This
is
the
length
and
one
start
index
and
end
index
right.
All
types.
M
But
it's
like
this
is
where
the
language
comes
in,
because
doesn't,
since
the
type
had
value
outside
language,
absolutely
as
they've
said
start
and
end
is
used
everywhere
in
the
framework.
Why
do
we
keep
passing
them
as
ends
so
instead
of
creating
type
called
range?
Because
no
one
wants
to
fight
a
new
range.
You
know
like
they
just
wanted
to
start
length.
They
won't
do
any
range
start
link.
That's
why
the
lens
has
value,
because
it
takes
away
all
of
that
I.
B
F
B
H
D
K
D
K
K
K
B
Argh,
yes,
the
fact
I
was
like
I
completely
understand
why
exclusive
on
the
upper
bound,
yeah,
okay,
makes
sense
to
the
language
team.
It
just
makes
no
sense
to
anybody
who
writes
like
I
want
3.4,
because
you
know
half
the
languages
say
it's
inclusive,
half
the
like
we
just
say:
if
X
was
it
wrong?
I'm
sorry
patently
wrong.
Okay,
the
first
language
I
ever
saw
that
had
the
syntax
that
it
was
inclusive
and
it
was
wonderful,
three
dot
dot.
Three
was
if
you
wanted
the
range
of
only
the
third
element.
No.
B
N
M
D
D
H
H
D
B
B
D
M
Mean
that's
one
of
those
things
where,
when
it's
a
little
bitter
Eliab,
when
it's
a
little,
you
know
good
talk
like
it's
kind
of
on
the
verge.
So
the
problem
to
the
compiler
is
the
reason
we
do
it
for
life.
Certain
types
of
numeric
convergence,
because
there
is
that
is
not
left
to
the
implement
there
of
the
type
it's
a
it
like.
You
can't
like
you,
can't
put
a
long
dot
max
value.
D
M
Like
you
just
you're,
smacking
yourself
in
the
head,
the
problem
the
compiler
has
to
get
into
is
for
certain
types.
We
say
that
this
is
how
it
is
there's.
No.
This
is
an
this
is
how
it
works
you.
This
is
not
C++
different
people
don't
get
to
find
different
pages
for
him,
but
there
are
other
types
for
which,
like
link
lately
specifically
sailing,
we
have
no
effing
idea.
What's
left
us,
we.
C
M
No
implied
semantics
of
any
of
those
operators
and
what
we
have
to
kind
of
decide
for
a
lot
of
these
is
are
they're
kind
of
implied
semantics
for
these
operators
that
are,
the
operator
will
always
work
this
way.
For
instance,
if
we
like,
is
it
okay
for
someone,
and
there
are
people
out
there
who
make
their
own
korolev
to
have
a
range
that
allows
negatives
like
we
think
that
that
is
Oh
Hey
net?
Okay,
if
the
answer
is
no,
then
we
can
do
things
that,
like
say
hey.
M
These
are
literal
you're,
just
kind
of
punching
yourself
in
the
face
stop
doing
this,
but
if
the
answer
is
that
it
is
okay
for
people
to
find
ranges
that
do
different
things,
then
we
just
have
to
kind
of
put
our
hands
in
here
and
there's
no
hard
and
fast
rule.
So,
for
instance,
like
with
two
poles
with
two
poles,
he
made
the
distinction.
M
B
For
this
feature,
who's
responsible
for
ranges
that
are
the
empty
set
or
the
negative
set.
Is
that
something
that,
as
the
language
features
slash,
the
framework
feature
that
this
is
the
responsibility
of
every
color
individually?
Is
the
responsibility
of
this
great
method?
Is
that
a
combination
of
both
because,
as
we
buy
points
out,
we
can
tear
the
struct
and
you
can
do
all
sorts
of
terrible
things,
but
like
who's,
when
this
feature
was
being
designed?
Who,
who
was
saying
this
range,
makes
no
sense
whose
responsibility
is
that.
H
M
K
A
M
L
M
I'm,
just
I'm
not
spouting
an
opinion
here,
I'm
just
saying
that
that's
the
that's
kind
of
the
same
question
is
if,
if
we
end
up
doing
things
like
asserting,
if
we
end
up
saying
things
in
the
language
like
you
know
for
three
and
you,
if
we,
if
we'd,
have
sort
of
warning,
if
you
did
4.3-
and
you
all
said,
no,
we
think
that,
like
weird-ass
collection
should
exist,
and
one
of
us
is
wrong.
I
would
generally.
A
Say
like
it's
similar
to
negative
areas
like
it
seems
fringy
in
nature,
and
it
seems
you'll
be
bad
to
impose
this
on
everybody,
so
I
think
in
general,
when
women
range
and
detect
that
you
have
long
sensical
arguments,
I
think
it
seems
beneficial
to
throw
if
you
ever
feel
like
we
really
want
to
enable
you
know.
Reverse
ranges,
I
think
at
that
point.
We
have
to
think
about
what
we
do
of
all
the
other
types
in
the
firm.
Where
do
we
want
to
raise
to
support
them?
A
F
F
G
F
K
A
E
J
E
Going
right
off
the
bat
right,
so
that's
to
kind
of
you
know
enable
because
we
already
have
them.
Let's
say
we
add
a
new
tie
here
and
we
adding
an
indexer.
Would
we
take
both
an
INT
and
an
index
if
we
have
a
slice
who
do
who
would
we
had
power?
One
method
that
takes
ins
and
the
other
in
10
takes
event.
Probably.
E
L
B
L
G
E
So
you
know,
then
we
could
discuss
if
an
ID
I
wants
to
enable
kind
of
from
the
end
indexing.
Then
maybe
you
add
the
overload,
but
my
problem
is
that
you
know
like
so.
Let's
say
we
had
two
two
overloads.
We
take
one
that
takes
two
ends
and
one
that
takes
the
range.
Well,
even
if
I
don't
index
from
the
end,
I
do
three
five.
D
E
B
Indexer
constructor,
so
especially
if
you
across
to
somebody
a
Mexican
structure
at
the
time
you
call
it's
gonna:
do
it
ready
to
check
on
your
integer
and
possibly
throw
an
exception?
Then,
when
you,
then
it's
gonna
build
the
range.
We
don't
do
anything
on
the
range,
but
we
now
take
two
variables
we
pack
them
into
another
one.
So
gotta
go
somewhere
now
you
pass
that
into
somewhere
else.
They
call
resolve
or
clothes
or
whatever
it
gets
called,
and
that
turns
it
into
something
else
possible,
leaving
it
the
same.
B
E
E
More
so
I,
don't
know
why
the
compiler
feature
would
be
expensive
and
I'll.
Tell
you
why
I
worry
about
kind
of
panting.
Probably
it
won't
be
a
performance
problem,
because
we
had
the
same
discussion
with
string
interpolation
and
now,
two
years
later,
we
are
fixing
performance
problem
with
this
thing
in
for
interpolation,
like
you
know
like
what,
with
what
do
you
mean
what
like
like?
What
what.
E
K
K
E
So
anyway,
there
are
some
performance
problems.
People
are
fixing
it
there's
all
my
argument
for
this.
One
is
like
why
don't
we
like
is
the
compiler
feature,
be
so
expensive
that
we
don't
want
be
like?
What
is
the
reason
that,
for
for
us
not
doing
the
feature,
I
can
have
two
overloads
one
to
experience
and
we
attribute-
and
we
say
this
is
equivalent
to
you
know
this
is
an
indexer
but
okay.
I
K
K
K
E
A
A
Think,
from
from
my
point
of
view,
like
the
way
I
see,
it
is
that
I
think
they're
not
completely
independent,
like
if
you
want
to
define
a
language
type
that
is
used
by
the
border
community
I
think
you
need
to
be
able
to
exchange
with
the
analyzer.
Otherwise
it's
very
good
I
think
the
type
is
not
quite
as
useful,
so
not
to
topple
some
other
things
where
you
know,
if
you
don't
allow
you
to
deconstruct
framework
types
and
the
topper
that
gets
a
lot
less.
You
know
usable,
but
I.
A
Think
I
am
also
in
agreeing
with
I
think
most
of
language.
People
is
that
I
think
fundamentally,
the
type
will
be
fairly
useful
and
I.
Don't
think
that
performance
for
those
kind
of
things
is
the
key
concern
because,
as
I
said
before,
like
if
you
really,
they
give
it
like,
if
you
think
of
range,
what
it
does
but
range
is
really
about
making
it
really
easy
for
the
consumer
and
the
producer
to
to
have
a
wide
variety
of
encodings.
Of
what
part
of
the
thing
do
you
want?
C
L
K
L
Saying
like
there
aren't
features
we're
like
we
will
probably
not
use
this
in
court
effects
like
we
might
expose
some
api's
to
make.
You
know
it
easier
to
use,
but
this
is
gonna
be
a
flag
for
me
like
if
I
see
people
using
this
feature,
it's
gonna
be
a
flag
for
making
sure
you're
doing
proper
performance
testing.
That's.