csharplang/meetings/2018/LDM-2018-01-10.md

16 lines
1 KiB
Markdown
Raw Normal View History

2018-03-20 17:03:16 +01:00
# C# Language Design Notes for Jan 10, 2018
2018-03-21 01:38:03 +01:00
## Agenda
2018-03-20 17:03:16 +01:00
2018-03-21 01:38:03 +01:00
1. Ranges and endpoint types
2018-03-20 17:03:16 +01:00
2018-03-21 01:38:03 +01:00
# Ranges and endpoint types
2018-03-20 17:03:16 +01:00
Wouldn't it be nice to have a range type that work on any comparable? Possibly, but we're not eager to solve this right now.
2018-03-21 01:38:03 +01:00
We need to believe that our future selves can extend the language with some form of target typing, for instance. There's a burden on them (us) to be able to do that without a compat break (silent semantic change), e.g.: There's a type in the future that has conversions so that it would work one way in 7.3 and a different way in the future.
2018-03-20 17:03:16 +01:00
2018-03-21 01:38:03 +01:00
We probably want `..(int, int)` and `..(long, long)`. We want to treat those as usual operators, so they have to allow user defined conversions of the end points. We could consider blocking off normal conversions of the operands, but that's extremely distasteful.
2018-03-20 17:03:16 +01:00
2018-03-21 01:38:03 +01:00
So first tentative decision: There's `Range` (for ints) and `LongRange`. The `..` operators are built-in. There's an implicit conversion one way, and an explicit the other, also both built-in.