litrs icon indicating copy to clipboard operation
litrs copied to clipboard

Community Feedback

Open LukasKalbertodt opened this issue 4 years ago • 7 comments

Do you have any opinions, complaints, suggestions, ideas, ... about litrs? Let me know! This issue is less formal and more relaxed than "normal issues", so feel free to just dump your thoughts here.

LukasKalbertodt avatar May 24 '21 19:05 LukasKalbertodt

I haven't had a chance to test this out yet, but I think having TryFrom impls could be quite convenient. It would avoid the match with a single type expected with the rest panicking (.expect could be used or some other error handling).

jhpratt avatar May 25 '21 20:05 jhpratt

I assume you are talking about TryFrom<X> for Y where Y is litrs::StringLit, litrs::IntegerLit and so on? That's a great idea! What could X be then? proc_macro[2]::Literal for sure. But also String and &str? Probably all four options, right?

EDIT: no, I wasn't thinking straight. The &str and String cases are already covered by parse, of course. But yeah, for the proc_macro[2]::Literal types it makes perfect sense!

LukasKalbertodt avatar May 25 '21 20:05 LukasKalbertodt

I was imagining proc_macro::Literal and proc_macro::TokenTree (along with proc_macro2 equivalents).

jhpratt avatar May 25 '21 20:05 jhpratt

Yeah TokenTree also makes sense. Sweet, thanks.

LukasKalbertodt avatar May 25 '21 20:05 LukasKalbertodt

@jhpratt I just published 0.2.0 which contains a large number of From and TryFrom impls. It was actually more work than expected, but I think they really improve the library and make lots of real world uses cases easier. Thanks for the suggestion again!

LukasKalbertodt avatar May 28 '21 18:05 LukasKalbertodt

@LukasKalbertodt I stumbled across this crate and really love it. Thank you so much for doing this!

wycats avatar Oct 02 '21 00:10 wycats

I'm working on my own programming language https://github.com/xiyuzhai-husky-lang/husky/. I shall work out the literal part of my language based on this project. Amazing work!!!

xiyuzhai avatar Dec 26 '22 03:12 xiyuzhai