-
Notifications
You must be signed in to change notification settings - Fork 55
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
Add support for tailstrict #257
base: master
Are you sure you want to change the base?
Conversation
b9b25c8
to
938d7e9
Compare
938d7e9
to
4eb8b30
Compare
case class Apply0(pos: Position, value: Expr, tailstrict: Boolean) extends Expr | ||
case class Apply1(pos: Position, value: Expr, a1: Expr, tailstrict: Boolean) extends Expr | ||
case class Apply2(pos: Position, value: Expr, a1: Expr, a2: Expr, tailstrict: Boolean) extends Expr | ||
case class Apply3(pos: Position, value: Expr, a1: Expr, a2: Expr, a3: Expr, tailstrict: Boolean) extends Expr | ||
case class ApplyBuiltin(pos: Position, func: Val.Builtin, argExprs: Array[Expr]) extends Expr { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious about the interaction between tail strict mode, built-in function application, and potential lazy evaluation in built-ins.
For example, it is possible to have a tailstrict
user-defined function which invokes a built-in function which returns lazy values which in turn reference user defined functions that could potentially be affected by tail strict mode? i.e. do we need "memory" of whether tail strict mode was in effect at the time of creation of a lazy value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe? I'm not sure to be honest. I'm trying to find an example where this would cause an issue.
As far as I can see, arguments to builtins are always forced (see Builtin classes in Val)
With this PR, I'm implementing tailstrict in sjsonnet.
I'm following the guidance from google/jsonnet#343 (comment):
Quote:
Resolves #189.