summary refs log tree commit diff
path: root/src/test/run-pass/numeric-method-autoexport.rs
AgeCommit message (Collapse)AuthorLines
2012-09-25Demode Num trait and implsTim Chevalier-10/+10
2012-07-10Get rid of places that expected foo.bar to implicitly bind.Michael Sullivan-10/+10
2012-07-05A new `times` method on numeric typesBen Striegel-2/+15
This method is intended to elegantly subsume two common iteration functions. The first is `iter::range`, which is used identically to the method introduced in this commit, but currently works only on uints. The second is a common case of `{int, i8, uint, etc.}::range`, in the case where the inductive variable is ignored. Compare the usage of the three: ``` for iter::range(100u) { // do whatever } for int::range(0, 100) |_i| { // do whatever } for 100.times { // do whatever } ``` I feel that the latter reads much more nicely than the first two approaches, and unlike the first two the new method allows the user to ignore the specific type of the number (ineed, if we're throwing away the inductive variable, who cares what type it is?). A minor benefit is that this new method will be somewhat familiar to users of Ruby, from which we borrow the name "times".
2012-06-25Remove redundant 'extension' mods from numeric modsBrian Anderson-3/+5
2012-06-25Automatically export methods on core numeric typesBen Striegel-0/+24
Each numeric type now contains an extensions module that is automatically exported. At the moment each extensions module contains only the impl for the `num::num` iface. Other impls soon to follow (hopefully).