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

feat: cascade for table/json obj #3

Open
hugosenari opened this issue Jan 29, 2021 · 1 comment
Open

feat: cascade for table/json obj #3

hugosenari opened this issue Jan 29, 2021 · 1 comment

Comments

@hugosenari
Copy link

Would be cool if it has any syntax sugar for []=

import cascade
import json

let myObj = cascade newJObject:
    myAttr = "myValue"
    myOther = cascade newJObject:
        innerAttr = "innerValue"
    myArray = cascade newJArray:
        - "first value"
        - "second value"

Maybe I just need a YAML but it has so nice features if/when and nice DSL for write JSON/YAML

@haltcase
Copy link
Owner

haltcase commented Feb 15, 2021

Seems cool, I'd accept a PR for this (I won't have the time to implement it myself currently).

I'm not sure about the unary - however, that would be a separate issue for RFC.

Edit: this would have to be disambiguated from the current assignment syntax, which is unconditionally transformed to a dot expression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants