Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upimprovements #1
Comments
This comment has been minimized.
This comment has been minimized.
ArtemGr
commented
Mar 20, 2015
|
Erm. Compiling the regular expression every time isn't cool, so I hope there will be some On a side note, a no-brainer version would've looked |
This comment has been minimized.
This comment has been minimized.
|
Alternate constructors seem very appropriate. |
This comment has been minimized.
This comment has been minimized.
|
@BurntSushi do you know when |
This comment has been minimized.
This comment has been minimized.
|
@kstep Of course it's a loss! :-) Stabilization on a schedule isn't free---we have to make sacrifices somewhere. The I don't know the time table. Compiler plugins are really nice to have, but it will take some work to turn them into a stable feature. |
This comment has been minimized.
This comment has been minimized.
|
Ok, check out version 0.2.0, please. @BurntSushi, it wasn't quite possible to implement let a = &"abbcccdddd"[ri!["bc+"]];This is as far eye-candy as possible without bothering |
This comment has been minimized.
This comment has been minimized.
ArtemGr
commented
Mar 21, 2015
|
Looks like you don't need |
This comment has been minimized.
This comment has been minimized.
|
After a little thought (bf732a39) I decided to add convenience |
This comment has been minimized.
This comment has been minimized.
|
@ArtemGr, you are right, now that I don't use |
BurntSushi commentedMar 20, 2015
So I love the experiment, and I just wanted to suggest a couple things that might increase its chances of succeeding.
Firstly, you might want to consider using just the standard
regexcrate without the macro. This is becauseregex!is a compiler plugin, which means it will not work on the beta/stable channels of Rust 1.0.Secondly, to increase the ergonomics of indexing, I'd recommend that you change your
ReIdx::newconstructor to take a&str, which would then call theRegex::newconstructor for the user. e.g.,Or even better (I should probably change
Regex::newto use a similar interface):Then you could index like
"hello"[ReIdx::new(r"el")]. You might go even further and define a short macro,rei!(or something):"hello"[rei!(r"el")].