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
I'm glad to hear that. What about something like the following? It may not be ideal, but it's a possibility at least. (Perhaps I've missed an obvious issue with structs, so excuse me...)
@alexreg, you also need a syntax for tuple structs
Talking about syntax, it would be nice to require (or at least accept) commas after blocks for each enum variant.
Yes, but in a macro, we don't have nice error reporting. So errors like missing comma are displayed in a very ugly way. So it was observed that without them there are fewer errors.
Talking about syntax, it would be nice to require (or at least accept) commas after blocks for each enum variant.
Yes, but in a macro, we don't have nice error reporting. So errors like missing comma are displayed in a very ugly way. So it was observed that without them there are fewer errors.
I talked with some people on IRC about this, and it seems that an imperfect implementation is doable at least. Could we at least aim for a “bad” temporary solution? :)
I talked with some people on IRC about this, and it seems that an imperfect implementation is doable at least. Could we at least aim for a “bad” temporary solution? :)
You are talking about the generics, right? (this is a wrong issue) I'm probably okay with a contribution, if it will not double the size of the macro or something like that. But I'm not sure if I can find some time for that myself.
I am, yes. And sorry to sidetrack. Maybe I’ll have a go, but the current code is basically magic heh. Perhaps a syntax extension/custom derive is the way to go for the future...
I talked with some people on IRC about this, and it seems that an imperfect implementation is doable at least. Could we at least aim for a “bad” temporary solution? :)
You are talking about the generics, right? (this is a wrong issue) I'm probably okay with a contribution, if it will not double the size of the macro or something like that. But I'm not sure if I can find some time for that myself.
Activity
tailhook commentedon Jul 4, 2016
I have no specific plans.And I think it might be useful.
So pull requests are accepted. I'm not sure what syntax should be, though. So we can probably bikeshed on the syntax here.
alexreg commentedon Jul 6, 2016
I'm glad to hear that. What about something like the following? It may not be ideal, but it's a possibility at least. (Perhaps I've missed an obvious issue with structs, so excuse me...)
Talking about syntax, it would be nice to require (or at least accept) commas after blocks for each enum variant.
tailhook commentedon Jul 6, 2016
@alexreg, you also need a syntax for tuple structs
Yes, but in a macro, we don't have nice error reporting. So errors like missing comma are displayed in a very ugly way. So it was observed that without them there are fewer errors.
alexreg commentedon Jul 6, 2016
Hmm okay, that’s a shame. Would be nice to have a feature maybe that required the comma (but by default without them, no comma). Just a thought.
Tuple-structs could be a problem yes… what about the following, though?
Possibly with a keyword in-between the two scopes?
tailhook commentedon Jul 6, 2016
Yes. Looks good enough for me. I'm not sure what keyword can be there, and we don't have a keyword after the struct enum member.
alexreg commentedon Jul 6, 2016
Right. You’d probably want a keyword after enum members too in that case… but having no keyword for anything might be fine.
alexreg commentedon Jul 9, 2016
By the way, generic enum types aren't currently supported, are they?
tailhook commentedon Jul 10, 2016
No, because it's hard to implement with current macro system.
alexreg commentedon Jul 10, 2016
I talked with some people on IRC about this, and it seems that an imperfect implementation is doable at least. Could we at least aim for a “bad” temporary solution? :)
tailhook commentedon Jul 10, 2016
You are talking about the generics, right? (this is a wrong issue) I'm probably okay with a contribution, if it will not double the size of the macro or something like that. But I'm not sure if I can find some time for that myself.
alexreg commentedon Jul 10, 2016
I am, yes. And sorry to sidetrack. Maybe I’ll have a go, but the current code is basically magic heh. Perhaps a syntax extension/custom derive is the way to go for the future...