[rust-dev] 2 possible simplifications: reverse application, records as arguments

Nate Bragg jonathan.bragg at alum.rpi.edu
Mon Apr 16 14:09:04 PDT 2012


On Mon, Apr 16, 2012 at 3:22 PM, Graydon Hoare <graydon at mozilla.com> wrote:

>  - Our records are order-sensitive, to be C-structure compatible.
>   Keyword arguments are usually argued-for (as you are doing here) as
>   a way to make function arguments order-insensitive. We'd need to
>   decide whether we wanted order to matter or not.
>

Could the compiler just reorder them behind the scenes?
Then records could remain order-sensitive internally, and
order mattering would be a non-issue.

As a tangent, I have found the best use of keyword args
to be made by Python, where they enable arbitrary
parameters to have defaults (as opposed to c++ style,
where default arguments can only be given from the
final parameter backwards).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20120416/c466fad8/attachment.html>


More information about the Rust-dev mailing list