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

Allow local definition in comprehension syntax #90

Open
oconnorr opened this issue Jan 5, 2016 · 5 comments
Open

Allow local definition in comprehension syntax #90

oconnorr opened this issue Jan 5, 2016 · 5 comments

Comments

@oconnorr
Copy link
Contributor

oconnorr commented Jan 5, 2016

For example I could replace the expression

{ [k]: processedField[k]
for field in std.objectFields(feature)
for processedField in [processFeature(field)]
for k in std.objectFields(processedField) }

with

{ [k]: processedField[k]
  for field in std.objectFields(feature)
  local processedField = processFeature(field)
  for k in std.objectFields(processedField) }

which is a bit more clear syntactically.

@sparkprime
Copy link
Contributor

Yeah this seems like a good idea.

@hausdorff
Copy link

@sparkprime Is there still appetite for this? This is useful enough that I think (assuming our POC goes well) we could devote some attention to it.

@sparkprime
Copy link
Contributor

Heh I didn't see your comment until now. Yeah it would be nice, and it's probably no harder than tweaking the desugaring rule for comprehensions

@zxc122333
Copy link

Any update on this?

@sparkprime
Copy link
Contributor

No update. The problem with doing language changes now is that they need to be done in both the Go and C++ branch. Anyone is welcome to do it though.

sbarzowski added a commit to sbarzowski/jsonnet that referenced this issue Jun 10, 2024
* Fix comprehensions

Only first and last forspec was used due to a parser bug.
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

4 participants