These are chat archives for rust-lang/rust

6th
Oct 2015
Johan Larsson
@JohanLarsson
Oct 06 2015 18:23
Looks like a beautiful language
Johan Larsson
@JohanLarsson
Oct 06 2015 22:07
I think F# has ^
is also tight syntax, comes up often
panicbit
@panicbit
Oct 06 2015 23:16
@JohanLarsson There is something like that but the API is still unstable, see http://doc.rust-lang.org/nightly/core/ops/struct.RangeFrom.html#method.step_by
Johan Larsson
@JohanLarsson
Oct 06 2015 23:16
yep, saw it
panicbit
@panicbit
Oct 06 2015 23:17
Once the API is settled the discussion about syntactic additions can begin I guess :)
Maybe consider preparing an RFC?
Johan Larsson
@JohanLarsson
Oct 06 2015 23:17
tricky with 0..10 imo, F# and haskell are inclusive on the 10
iirc D is not
I prefer inclusive
panicbit
@panicbit
Oct 06 2015 23:18
IMO it matches nicely with the "i < coll.length" idiom
Johan Larsson
@JohanLarsson
Oct 06 2015 23:18
I see what you mean
panicbit
@panicbit
Oct 06 2015 23:18
So you if you need to you can write "for 0 .. coll.len()"
Johan Larsson
@JohanLarsson
Oct 06 2015 23:19
but then again if you introduce something new
also ideal if things can be standardized among languages
How is an RFC created btw? Github issue?
panicbit
@panicbit
Oct 06 2015 23:20
Yup, PR and template here: https://github.com/rust-lang/rfcs
The README.md should guide you towards a proper RFC
Johan Larsson
@JohanLarsson
Oct 06 2015 23:21
my esl will prevent me for ever coming up with one :)
Johan Larsson
@JohanLarsson
Oct 06 2015 23:29
the ship has sailed for inclusive right?
panicbit
@panicbit
Oct 06 2015 23:30
I remember the time Rust had range(from,to) and range_inclusive(from,to)
Not necessarily
As long as the new syntax/api is backwards compatible it can be added
Also, you could have a "range_inclusive" method like in the old Rust days
Johan Larsson
@JohanLarsson
Oct 06 2015 23:31
but 0..10 including 10 would be a huge breaking
panicbit
@panicbit
Oct 06 2015 23:31
Sure, that's why it would need to be a different, but compatible syntax
Johan Larsson
@JohanLarsson
Oct 06 2015 23:31
0..2..10 would have to be the same of course
panicbit
@panicbit
Oct 06 2015 23:35
There seems to be an RFC that recommends ... for inclusive ranges: https://github.com/rust-lang/rfcs/blob/master/text/1192-inclusive-ranges.md
(well it also discusses alternatives)
Johan Larsson
@JohanLarsson
Oct 06 2015 23:37
hmm, the difference between .. and ... is not huge
panicbit
@panicbit
Oct 06 2015 23:37
It could be easy to misread it
Johan Larsson
@JohanLarsson
Oct 06 2015 23:38
a--b
also ambiguous
a..b|
dunno
panicbit
@panicbit
Oct 06 2015 23:39
| could be confusing because of the || syntax for closures
Johan Larsson
@JohanLarsson
Oct 06 2015 23:40
ah
I don't know any Rust :)
panicbit
@panicbit
Oct 06 2015 23:40
Do you intend to learn it?
Johan Larsson
@JohanLarsson
Oct 06 2015 23:40
reading the book for fun
It looks really nice but not sure I will use it much. We are a .net shop
panicbit
@panicbit
Oct 06 2015 23:41
You said english wasn't your primary language, right? May I ask which language is?
Johan Larsson
@JohanLarsson
Oct 06 2015 23:41
Swedish
panicbit
@panicbit
Oct 06 2015 23:41
Ok. I hoped that I could point you to a translation of the book.
Johan Larsson
@JohanLarsson
Oct 06 2015 23:42
Np reading it
I just hesitate writing stuff on the internet
except for in chats, here I just close my eyes and press enter :)
panicbit
@panicbit
Oct 06 2015 23:42
I did too but talking in #rust (irc.mozilla.org) helped me in that regard :=
:)
Johan Larsson
@JohanLarsson
Oct 06 2015 23:43
where do I find discussions for RFCs btw?
I can only see the documents
panicbit
@panicbit
Oct 06 2015 23:44
I suppose eithe rin the PR or in the attached Issue (linked at the top of the RFC)
Johan Larsson
@JohanLarsson
Oct 06 2015 23:44
ah, yeah found it
added a comment about a..b|, think it looks somewhat clean
or a..b]