Hi, I am working on a little domain specific language and had written a parser with Menhir that delivers an AST. The language has the concept “predicate” that is very similar to a ocaml class so I would like to use ocaml class to represent it. Predicates must be instantiate by events, in fact the type of event will define the type of class. Event types are defined inside of predicates, is this possible? I mean, the type of class that will be instantiated can be defined by some ocaml code?
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Why my subclass(inheritance) cannot be passed to a function requiring its super class? | 2 | 782 | January 3, 2022 | |
| Modelling event-based system in OCaml | 5 | 668 | February 2, 2025 | |
| Defining several similar classes by inheritance | 5 | 1915 | May 22, 2019 | |
| How to model a DOM attributes hierarchy? | 5 | 195 | June 2, 2025 | |
| OCaml classes: required to define all methods on the spot? | 2 | 409 | March 27, 2023 |