Discussion about this post

User's avatar
Guyren Howe's avatar

Objects are not the most general thing to have at the base here.

A traditional object’s methods are a collection of functions that switch on the first argument’s type (we write the first argument before the function name with a dot in between:

myobject.a_function

We have a collection of versions of a_function that are distinguished by the type of that first argument (i.e. the class they’re defined in).

A more general version is functions that switch on multiple arguments — generally called Multimethods.

More general still, though, is just FP. Multimethods were invented in Common Lisp, and were just implemented in the language.

So, really, we want types on the data. For compound types, this is basically a relation (all the values of that type). And functions that can be applied to those types.

In my Frest project, you can attach triggers to tables, and this is much like having methods on classes.

Expand full comment
1 more comment...

No posts