You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As with your other issues, I think you need some rationales to suggest those macros. And I guess it is a better fit for the function (std::io::process::run_process perhaps).
Rust's libraries greatly favor composition over specific functions such as this. As with your other issues about new macros, these are mostly conveniences and don't particularly serve any fundamental purpose.
The existing macros in libstd/macros.rs should all exist because of a fundamental reason. For example, format! could never be a library function because it takes a variable number of arguments on which is has special constraints. The macros you have proposed often do not have a fundamental reason to be macros, and would work well with simple functions instead.
For this reason, I'm going to close this and the associated issues about macros. Issues can be created about adding convenience functions if you like, but I do not believe that this functionality belongs in macros.
@electricface Rust itself is not designed as a scripting language though. How about making your own macro library (see #11151) to provide additional macros like these?
Activity
lifthrasiir commentedon Mar 15, 2014
As with your other issues, I think you need some rationales to suggest those macros. And I guess it is a better fit for the function (
std::io::process::run_processperhaps).alexcrichton commentedon Mar 15, 2014
Rust's libraries greatly favor composition over specific functions such as this. As with your other issues about new macros, these are mostly conveniences and don't particularly serve any fundamental purpose.
The existing macros in
libstd/macros.rsshould all exist because of a fundamental reason. For example,format!could never be a library function because it takes a variable number of arguments on which is has special constraints. The macros you have proposed often do not have a fundamental reason to be macros, and would work well with simple functions instead.For this reason, I'm going to close this and the associated issues about macros. Issues can be created about adding convenience functions if you like, but I do not believe that this functionality belongs in macros.
electricface commentedon Mar 16, 2014
i think if you add these macro to std lib ,maybe programmers can use rust like a scripting languages.
lifthrasiir commentedon Mar 16, 2014
@electricface Rust itself is not designed as a scripting language though. How about making your own macro library (see #11151) to provide additional macros like these?
Auto merge of rust-lang#12915 - lnicola:promote-subtree, r=lnicola
Auto merge of rust-lang#12915 - belyakov-am:lint/single_char_add_str,…