-
-
Notifications
You must be signed in to change notification settings - Fork 806
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
VIP: Change Mapping Syntax #564
Comments
@fubuloubu Could you add an example of how nested mappings would look |
The harder part is how to represent the access e.g. There's also something like this in Haskell (I believe): |
Meeting Notes: Syntax would be more explicit like this my_mapping1: map(basetype1 -> type2)
my_mapping2: map(basetype1 -> basetype2 -> type3)
my_mapping3: map(bytes <= 20 -> type2) |
I like the syntax proposed by @jacqueswww : |
I sorta like it, although the syntax of structures using braces is also fairly close. Only difference is that only types can be used. Seems confusing. |
I'm actually a fan of the syntax now. It's one of the things that I genuinely think is an improvement over most major languages. It's short, simple, and intuitive once you do it once or twice. It could be interesting to use something else to enclose it perhaps. Maybe a declaration along the lines of |
@jacqueswww I think we need to discuss this one on our next call. Lots of options here. |
This proposal was updated per discussion in #1076 |
I'm a fan of the new proposed |
Starting on this. |
@jacqueswww maybe we should deprecate the old syntax with a warning to move to the new one so people know to switch? |
Preamble
VIP: 564
Title: Change Mapping Syntax
Author: @fubuloubu @grosu
Type: Standard
Status: Draft
Created: 2017-12-08
Requires: #563
Abstract
Mapping syntax looks very similar to the array syntax, so we should change the syntax so it is not confusing
Motivation
See above
Specification
Change Mapping Syntax to
my_mapping: map(basetype1, type2)
Nested map Syntax to look as follows:
my_mapping: map(basetype1, map(basetype1, basetype2))
Backwards Compatibility
Not Backwards compatible
Copyright
Copyright and related rights waived via CC0
EDIT: Previous proposed syntax was
my_mapping: basetype1 -> type2
The text was updated successfully, but these errors were encountered: