Re: [rust-dev] lib: Is anybody working on the datetime library?

2013-09-19 Thread Chris Peterson
A Rust datetime library has been on my to-do list for a long time. :) JSR-310 is a very complete solution, but it carries a lot of Java baggage. C++11's std::chrono library [1] defines a smaller API for time points and durations without calendars (i.e. the hard part). std::chrono's API might

[rust-dev] no warnings about variable redeclarations: feature or bug?

2013-02-16 Thread Chris Peterson
The following code snippet does not emit any compilation warnings about redeclaring variable names or types: fn x(y: int) - ~str { let y = y + 1; let x = y == 2; let x = x.to_str(); x } Is this a feature or a bug? The Rust manual has no comment. This

[rust-dev] Question about lifetime names

2013-02-04 Thread Chris Peterson
After reading the recent discussions about lifetime notation, I was wondering why lifetimes need their own names. Lifetimes refer to variables that already have names. For example, given this fn from the borrowed pointers tutorial: fn selectT(shape: Shape, threshold: float,

[rust-dev] Container framework?

2013-02-01 Thread Chris Peterson
strcat and I have been casually brainstorming about container traits. Has there been previous discussion about standardizing a container trait hierarchy and method naming convention? Below is a rough sketch of a simple container framework, inspired by Scala, Python, and C++ STL. Scala has a

Re: [rust-dev] Container framework?

2013-02-01 Thread Chris Peterson
On 2/1/13 11:24 AM, Graydon Hoare wrote: - I think the double-ended circular vec struct (implemented unsafely) should probably be called Buf. It's the replacement for DVec. Alternatively call it Queue and come up with another name for the can access at either end trait. Deque

Re: [rust-dev] Container framework?

2013-02-01 Thread Chris Peterson
On 2/1/13 11:48 AM, Erick Tryzelaar wrote: FYI, I'm in the process of converting fun_treemap into an AA Tree and implement much of the container traits. In the process, I've extracted out the mutation functions from Map and Set into their own Mutable{Map,Set} trait, and added

Re: [rust-dev] relax type checking of ints and uints?

2012-03-20 Thread Chris Peterson
On 3/19/12 7:22 PM, Graydon Hoare wrote: Beyond this, I think the widening rules or any form of in-expression promotion in general is too hazardous. Literals are the pain point. Sounds good. Safely promoting literals would be a big help. chris ___