jonocarroll,
@jonocarroll@fosstodon.org avatar

How have I not made this connection before??? #rstats' S3 dispatch mechanism is strikingly similar to #rust's trait system (provided your mental model is sufficiently flexible and can compare function call vs method, that distinction perhaps being the reason I hadn't).

Barely a handful of minutes into https://youtu.be/EXd-bHyk0dM and I had to pause to contemplate.

With that said, #julia's approach is even nicer; multiple dispatch with no ceremony; just write out the definition for each signature.

brodriguesco,
@brodriguesco@fosstodon.org avatar

@jonocarroll What is your opinion on this being called "functional oop" in the #RStats ecosystem? Is it a synonym for multiple dispatch? is it something else, but close enough?

jonocarroll,
@jonocarroll@fosstodon.org avatar

@brodriguesco I'm not one to place labels on these. S4 is multiple dispatch so that's slightly different (and more similar to what Julia offers). I think the focus on types (classes for R) - especially for multiple arguments to a function - really make for an incompatibility with anything you could call traditional "OOP". I can't say I've studied the other side of that so much, so I could very well be mistaken.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • rust
  • DreamBathrooms
  • everett
  • InstantRegret
  • magazineikmin
  • thenastyranch
  • rosin
  • GTA5RPClips
  • Durango
  • Youngstown
  • slotface
  • khanakhh
  • kavyap
  • ngwrru68w68
  • tacticalgear
  • JUstTest
  • osvaldo12
  • tester
  • cubers
  • cisconetworking
  • mdbf
  • ethstaker
  • modclub
  • Leos
  • anitta
  • normalnudes
  • megavids
  • provamag3
  • lostlight
  • All magazines