vapourlang / vapour

Typed superset of R
http://vapour.run
Apache License 2.0
190 stars 3 forks source link

OOP #42

Open JohnCoene opened 2 months ago

JohnCoene commented 2 months ago

How should vapour work with OOP (R6, S4, S7, ...)

JohnCoene commented 2 months ago

They'd have to be handled separately I suspect. R6 is an environment with locked bindings for privates me thinks.

ltuijnder commented 1 month ago

Hi I just discovered this project and it looks super exciting! I very much wonder how vapour would relate itself to S7.

Since with S7 we create typed class definitions it feels very similar to what is happening with the typed object definition in vapour. Ofcourse with S7 you have the addional syntax to define validator functions and getter/setters and custom constructors. But super interested to see how the S7 version of vapour would look like. Would be so cool for my IDE to know if I type obj@ which properties are available and that it knows which type the obj@prop is.

Would vapour types: https://vapour.run/docs/types be casted to S7 equivalents: https://github.com/RConsortium/S7/blob/main/R/base.R ?

Eg. vapour: num type -> S7::class_numeric