loreanvictor / kaashi

A turing complete JSON-like declarative language for data/config description
MIT License
17 stars 1 forks source link

constant-after-parametric key #6

Open sesajad opened 4 years ago

sesajad commented 4 years ago

do we need something like this?

{
    [x].twice : x * 2
}

it's currently not supported

loreanvictor commented 4 years ago

we have parametric specification, i.e.:

F[x][y]: ...

so I think we could also have constant key specification, i.e.:

F.x.y: ...

and combinations of them, i.e.:

F[x | ...].y: ...

the simplicity and combinability is nice, but I do have some concern about readability of code. I think parametric key specification already might cross that line but the convenience is worth it, so perhaps we should support this as well?