opened
jonsterling
username_0
Lean has a cool feature where not only can you embed terms into scripts in the usual way (analogous to our `exact` tactic), but you can also start scripting in the middle of a term.

For a long time, I thought that this wouldn't be possible, but now I see a way to do it. It may be a little tricky to get it just right with respect to binding, though.

Another thing I have been considering that may make it easier to do what I am describing is to get rid of the distinction between *hypotheses qua names* and *hypotheses qua variables*. I originally thought that this was crucial, but now I think that there may be a way to use only variables here without it getting too bad.
Support embedding scripts into terms (!)
issue
created
jonsterling
username_0
I am envisioning a mode-of-use where you can write scripts like this:

```
   `(lam [x] ,{let <a,b> = x. `(pair b a)})
```

In the above example, the backtick means "switch to `term` mode", and the comma means "switch to `tactic/refinement` mode". These can be interleaved as much as you want.

The idea is that when proving a well-formedness judgment `M in A`, if `M` is an "antiquoted" tactic expression, then we will have a rule that switches to proving `A true` using that tactic. The behavior of the backtick would remain the same as it is now.

This way we can get the best of both worlds between refinement and explicit term writing. And this will also allow us to put holes in terms!

(This is predicated on #301)
comment
created
jonsterling
username_0
Actually, this might not work as-designed. The issue is that we don't want these scripts to be in the realizers that are extracted. So, somehow we would have to have the membership judgments spit out extracts too, which represent the 'elaborated'/extracted form of their inputs. This is related to #208.
comment
closed
jonsterling
username_0
issue