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

Decide on syntax for mesh! macro #13

Open
LukasKalbertodt opened this issue Jan 13, 2019 · 0 comments
Open

Decide on syntax for mesh! macro #13

LukasKalbertodt opened this issue Jan 13, 2019 · 0 comments
Labels
area:macros Area: proc macros in lox-macros category:improvement Category: Improvement needs:bikeshed Needs: small decisions of some kind priority:low Priority: Low
Milestone

Comments

@LukasKalbertodt
Copy link
Owner

LukasKalbertodt commented Jan 13, 2019

We have two arrays: vertices and faces. For each element we can specify additional properties after the "core info". The question is how to specify multiple properties. Potential syntaxes:

  • As tuple:

    vertices: [
        v0: (prop0, prop1, prop2), // multiple
        v1 : (prop0), // single
    ]
    

    Simple, but feels like too many parenthesis, especially for a single element.

  • As tuple with special casing single value:

    vertices: [
        v0: (prop0, prop1, prop2), // multiple
        v1 : prop0, // single
    ]
    

    Problem: if someone tries to specify a position as tuple (after all (f32, f32, f32) implements Pos3Like), strange errors will occur (it will be parsed as three properties instead of one). Generally, it feels like too much magic IMO.

  • Comma separated, with semicolon seperated elements

    vertices: [
        v0: prop0, prop1, prop2; // multiple
        v1 : prop0; // single
    ]
    

    This diverges from the normal Rust "list like syntax": [a, b, c].

@LukasKalbertodt LukasKalbertodt added category:improvement Category: Improvement priority:low Priority: Low needs:bikeshed Needs: small decisions of some kind labels Jan 13, 2019
@LukasKalbertodt LukasKalbertodt added the area:macros Area: proc macros in lox-macros label Feb 8, 2019
@LukasKalbertodt LukasKalbertodt added this to the v0.1.0 milestone Jun 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:macros Area: proc macros in lox-macros category:improvement Category: Improvement needs:bikeshed Needs: small decisions of some kind priority:low Priority: Low
Projects
None yet
Development

No branches or pull requests

1 participant