Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaces the free-standing functions in f32, &c. #7117

Closed
wants to merge 4 commits into from

Conversation

auroranockert
Copy link
Contributor

The free-standing functions in f32, f64, i8, i16, i32, i64, u8, u16,
u32, u64, float, int, and uint are replaced with generic functions in
num instead.

This means that instead of having to know everywhere what the type is, like

f64::sin(x)

You can simply write code that uses the type-generic versions in num instead, this works for all types that implement the corresponding trait in num.

num::sin(x)

Note 1: If you were previously using any of those functions, just replace them
with the corresponding function with the same name in num.

Note 2: If you were using a function that corresponds to an operator, use the
operator instead.

Note 3: This is just #7090 reopened against master.

@pcwalton
Copy link
Contributor

Do you plan to do this for range as well?

@thestinger
Copy link
Contributor

I plan on replacing the range functions with a Range iterator object, but I think @bjz was going to work on an enumerable trait to make it more generic.

@auroranockert
Copy link
Contributor Author

@pcwalton I haven't considered range specifically, but I think it would make sense to go through std and find what free-standing functions would make sense to unify.

@brendanzab
Copy link
Member

@pcwalton Yeah, I did have that change done, but stashed it because I thought it might be incompatible with what @thestinger was proposing.

@auroranockert
Copy link
Contributor Author

It has apparently gone stale already, I'll rebase on master tomorrow.

@emberian
Copy link
Member

emberian commented Jul 7, 2013

@jensnockert needs a rebase

@auroranockert
Copy link
Contributor Author

@cmr I know, sorry, been quite busy since the tree reopened.

The free-standing functions in f32, f64, i8, i16, i32, i64, u8, u16,
u32, u64, float, int, and uint are replaced with generic functions in
num instead.

If you were previously using any of those functions, just replace them
with the corresponding function with the same name in num.

Note: If you were using a function that corresponds to an operator, use
the operator instead.
@auroranockert
Copy link
Contributor Author

Rebased! Sorry that it took so long @cmr, @bjz.

Apparently yesterday wasn't my day, and I forgot to add the changes to
all the tests apparently, and in the end forgot the docs extra much.
Please documentation, forgive me, I really do love you, I hope you
forgive me.

Next time we'll meet tutorial, I promise to bring cookies and tea. I
really want to be best-friends-forever with you, <3.

XOXO
@auroranockert
Copy link
Contributor Author

@bors, the tutorial: I really hope you forgive me for failing you two. I don't know why I forgot the changes to the docs, I am really sorry. hugs

bors added a commit that referenced this pull request Jul 9, 2013
The free-standing functions in f32, f64, i8, i16, i32, i64, u8, u16,
u32, u64, float, int, and uint are replaced with generic functions in
num instead.

This means that instead of having to know everywhere what the type is, like

~~~
f64::sin(x)
~~~

You can simply write code that uses the type-generic versions in num instead, this works for all types that implement the corresponding trait in num.

~~~
num::sin(x)
~~~

Note 1: If you were previously using any of those functions, just replace them
with the corresponding function with the same name in num.

Note 2: If you were using a function that corresponds to an operator, use the
operator instead.

Note 3: This is just #7090 reopened against master.
@bors bors closed this Jul 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants