lang: types: Misc function changes

This will probably change up again in the future, but this is what we
need for now to make lambdas work.

Co-authored-by: Samuel Gélineau <gelisam@gmail.com>
This commit is contained in:
James Shubin
2023-09-25 16:39:22 -04:00
parent 8d63b98212
commit 5440ef7eb2
2 changed files with 102 additions and 99 deletions

View File

@@ -196,15 +196,15 @@ func ValueToExpr(val types.Value) (interfaces.Expr, error) {
Fields: fields,
}
case *types.FuncValue:
// TODO: this particular case is particularly untested!
expr = &ExprFunc{
Title: "<func from ValueToExpr>", // TODO: change this?
// TODO: symmetrically, it would have used x.Func() here
Values: []*types.FuncValue{
x, // just one!
},
}
//case *types.FuncValue:
// // TODO: this particular case is particularly untested!
// expr = &ExprFunc{
// Title: "<func from ValueToExpr>", // TODO: change this?
// // TODO: symmetrically, it would have used x.Func() here
// Values: []*types.FuncValue{
// x, // just one!
// },
// }
case *types.VariantValue:
// TODO: should this be allowed, or should we unwrap them?