James

Results 371 comments of James

> I'd try this: Indeed there's an issue! Actually I found a sort-of related bug. Hmmm... Well here's the interesting point: plumbing through sctx would be very complicated... Which leads...

Yes, but if we have to have an sctx inside of Unify, that means we need to plumb this into the unification engine... I feel like the right approach might...

From our phone conversation: https://github.com/purpleidea/mgmt/blob/6a6546db8d3d481cfaf5adcb71c2329d1284cbd3/lang/ast/structs.go#L8802 https://github.com/purpleidea/mgmt/blob/6a6546db8d3d481cfaf5adcb71c2329d1284cbd3/lang/ast/structs.go#L8685 Both of these ExprParam and ExprPoly return nil, nil. Which we probably don't want. This might come from here: https://github.com/purpleidea/mgmt/blob/6a6546db8d3d481cfaf5adcb71c2329d1284cbd3/lang/ast/structs.go#L8539

(I will add a patch to add that test in and add errors on those two nils.)

Here's the patch (just testing) https://github.com/purpleidea/mgmt/commit/a23312a913cb5263a2cbb90b2c4c3403276b2886 Sort of related: ``` import "fmt" $format = "%d" # should get ignored $fn = func($format) { fmt.printf($format, 42) } test $fn("%s") {} #...

> lang/funcs/facts/func.go:90:18: obj.Fact.Call undefined (type Fact has no field or method Call) Oh, hm weird. Maybe I forgot to include something in my commit? if you need it LMK and...

> Did we decide whether we would implement FakeTxn or if we would change Graph() to receive a Txn instead of returning a Graph? We didn't decide, and I'm also...

> I can't visualize all the implications yet. Which really means, we should go with whatever you think is best, and hopefully we don't discover some reason that makes us...

Sounds perfect! Note that TestAstFunc1 has sub tests, so you can `-run TestAstFunc1/test_#11_` (or whatever number it is) to just run the one test. If you run the test with...