Asking questions about PPX attrs and extensions

I’m not exactly sure where to ask questions about PPX attributes and extensions. Would this be the place? Or maybe some other, more specialized mailing-list? For concreteness, the example that drove my post was:

It seems that “algebraic attributes” on a class-signature method-decl, are the same as “item attributes” on that decl. Is this intended? I assume so, but figure it’s good to check.

{| class type ct = object method [@argle] foo : int [@@bargle] end ;; |} |> Official.Implem.pa |> Official.Implem.pr |> print_string ;;
class type ct = object method  foo : int[@@argle ][@@bargle ] end- : unit = ()

Yeah, I think they are equivalent. Search for “infix syntax” in this manual page.

O.I.C. Thank you! I’m slowly working thru attributes, and this is -very- helpful. Cheers!

Another question (and truly, this is just for education – I’ve checked all the relevant locations, and am not confused, just curious):

It seems (checking the menhir parser as well as the manual) "letop"s (for monads) do not enjoy attributes the way that "let"s do? Looking at the AST, it seems that there’s a “Pexp_letop” constructor (to mirror the “Pexp_let”), but nowhere in the “binding_op” (vs. “value_binding”) to stash attributes.

Was this intentional?

I’m also curious about this, enough so that I raised an issue on the OCaml bug tracker the other day: https://github.com/ocaml/ocaml/issues/9301

Posting it here if you wanna follow it by subscribing.

@Chet_Murthy I don’t believe it was intentional; would you like to submit a PR to implement attribute support for binding operators, solving @anmonteiro’s issue?

grin Yep, I’d be happy to! I’ll get on that right away. I also found a couple of bugs (erm … typos, omissions) in the manual in the section on attributes – I assume I can submit a PR to fix those also?

The only one that was material was about the “open” statement. In structures, the open statement does not take a module-path, but rather a module-expression:

open struct let x = 3 end ;;
# x ;;
- : int = 3

in this sense, open is to be contrasted with include, I guess.

include struct let x = 4 end ;;
val x : int = 4
# x ;;
- : int = 4

Extended opens are documented in the extension chapter: https://caml.inria.fr/pub/docs/manual-ocaml/generalizedopens.html .

oops! My bad! Sorry, I’m working thru the manual line-by-line, and hadn’t gotten to that part of the extensions yet.