Dan it seems you are using the term "quosure" in place of "expression". This is not right as quosures are meant to be expression wrappers. This is why you'd use get_expr() to get an actual expression like the one you have represented in this diagram.

I mean to be using it as the root of the AST for an expression, though that isn't clear in my post.

But a quosure is an expression because you can evaluate it just as you can a bare expression, albeit with a different mechanism. Or maybe it's better to say that it's an expression in the language model of R that the rlang package uses.

rlang::is_expr returns TRUE when applied to a quosure and also when applied to the object returned by get_expr. So the rlang package sees quosures as expressions. But rlang is working on a language model of, not the syntax of R. Each has a different idea of what an expression is.

So to me quosure means get me the AST for an expression along with the context of the expression.

The thing I find interesting is that the quosure seems to be a proxy for a lisp list. It, in effect, translates an expression like a * b + c * d, which is a syntax you can use in R but doesn't exist in lisp (or HP RPN calculators for that matter), into a syntax lisp can use, which would be

(+(* a b)(* c d))

That's what the tree I generated and then drew with DiagrammeR is showing.

The first item in a lisp list is returned by rlang::head, and the rest of the list is returned by rlang::tail. These correspond to car and cdr in lisp (I think, sort of) which is a terminology for parts of the architecture of the machines early versions of lisp ran on. Even though I have designed computers I've never, and still don't, understand how car and cdr help explain how lisp works. But as soon as I saw the lang_head and lang_tail functions it all made sense to me.

So mostly what I've been looking at lately is the language model of R which is surfaced by the rlang package.

I see what you mean but that is not an expression that I "drew". It was drawn by a function I'm working on that extracts an AST from a quosure.

The model of the R language that rlang uses does not see a literal expression like a + b as an expression, rlang::is _expr produces an error when some like a + b is passed to it. About the only thing is sees as an expression is a quosure or something that is like a quosure.

It's part of the split between the syntax of a language and a module of the languge.

In R when you "program on the language" you don't program on the syntax of it, you program on some model of the language you get from somewhere. In R the model comes from the rlang package. In the model of R a quosure is an expression.

You can program on the syntax of a language but it is hard to do except for simple things. Defines in c are sort of like programming on the c language... that let you insert your own syntax. But defines have a lot more limitations than, for example, programming on the language in R.

html is another example. There is a syntax for html (actually a sgml typedef for it) which doesn't allow any custom tag or attributes. But the W3C DOM (document object model) for web pages which html is translated into in a web page doesn't care about the restrictions put on html by sgml typedef. So in a web page, i.e. javascript, you create and interpret any elements or attributes you want.

If you render in RStudio then you can export it to an image or pdf or put it on the clipboard. From there you can add it to an html page or pdf. If you put the rendering on a clipboard you paste it into a lot of things like messages here in the RStudio community, or a lot of image editors like Photoshop.

There is an export dropdown in the RStudio viewer window when there is an image in it.