[rust-dev] rustdoc feature request: grouping methods

2013-05-02 Thread Niko Matsakis
I often find when writing code that I want to introduce sections into my file. Typically I do this like: // Node construction // // Methods for constructing new nodes. I find this helpful when browsing through the code. I

Re: [rust-dev] should '///' be a doc comment?

2013-05-02 Thread Diggory Hardy
I'm voicing my support for the nice docstring comments :). I'd be all for only having // comments and /// docstrings though, but I have a feeling a lot of people would strongly disagree. ___ Use /// to start a doc-string and / to continue one.

Re: [rust-dev] should '///' be a doc comment?

2013-05-02 Thread Steven Ashley
On Thu, May 2, 2013 at 1:50 PM, Erik S sw...@earthling.net wrote: John, I would suggest requiring *exactly* three slashes for a doc comment (or *exactly* two stars for a /** -- */ style doc comment). This matches with Doxygen's parsing (I think), and makes both the examples below parse

Re: [rust-dev] rustdoc feature request: grouping methods

2013-05-02 Thread Benjamin Striegel
Are explicit `mod`s too heavyweight for this? On Thu, May 2, 2013 at 6:18 AM, Niko Matsakis n...@alum.mit.edu wrote: I often find when writing code that I want to introduce sections into my file. Typically I do this like: //

Re: [rust-dev] should '///' be a doc comment?

2013-05-02 Thread Fredrik Håård
FWIW, I am very much in favor of having 'proper' docstrings instead of comment docstrings. I don't really see any upside to comment docstrings at all... 2013/5/2 Lucian Branescu lucian.brane...@gmail.com: Not necessarily: #[doc= Actual docs, free to contain almost any characters, without the

Re: [rust-dev] should '///' be a doc comment?

2013-05-02 Thread John Clements
On May 1, 2013, at 6:50 PM, Erik S wrote: John, I would suggest requiring *exactly* three slashes for a doc comment (or *exactly* two stars for a /** -- */ style doc comment). This matches with Doxygen's parsing (I think), and makes both the examples below parse correctly. Both of these

[rust-dev] String codecs

2013-05-02 Thread Fredrik Håård
Since there are no encoding support in Rust beyond utf-8/16, I've been toying around with str-[u8] codec generation using the specifications from unicode.org (inspired by the cpython implementation) as my first learning-Rust project. I'm now at the point where I can successfully generate a

Re: [rust-dev] rustdoc feature request: grouping methods

2013-05-02 Thread Brian Anderson
On 05/02/2013 03:18 AM, Niko Matsakis wrote: I often find when writing code that I want to introduce sections into my file. Typically I do this like: // Node construction // // Methods for constructing new nodes. I

Re: [rust-dev] should '///' be a doc comment?

2013-05-02 Thread Niko Matsakis
Anyone object to changing the parser in this way? To be clear, these two restrictions are (in my view) orthogonal to other possible changes. I'd still be delighted to get rid of some of the doc-string forms. Makes sense to me. Niko ___ Rust-dev

[rust-dev] RFC: Pattern matching binding operator

2013-05-02 Thread Patrick Walton
Hi everyone, There's consensus that `@` (imported from Haskell) is a bad binding operator for patterns, because it leads to the confusing-looking `@@` in, for example: struct Foo { field: int } ... match foo { foo@@Foo { field: x } = ... } However,

Re: [rust-dev] RFC: Pattern matching binding operator

2013-05-02 Thread Tim Chevalier
I don't particularly like any of the options here, but as seems like the least bad one. Matching on a casted constant seems like a pretty rare case, and you can always use if instead of match. I agree that the existing @ syntax is ugly, and I think using '=' for pattern binding muddies the waters

Re: [rust-dev] rustdoc feature request: grouping methods

2013-05-02 Thread Jack Moffitt
Maybe we can find a way to incorporate some sort of section to use when grouping items, methods, fields, etc. I imagine we could draw on Markdown's `#`, `##`, `###` notation to define sections, subsections, and so forth, but I'm just not sure how we would let rustdoc know about it, since

Re: [rust-dev] RFC: Pattern matching binding operator

2013-05-02 Thread Erick Tryzelaar
I'm not sure what I think about this, but we could do away with the `as` cast operator and replace it with `.to_f32()`. I was already planning on adding a ToInt/FromInt for casting to and from enums, so we'll probably grow `.to_f32()` and etc anyway. I doubt we could use `.to_f32()` in a pattern.