Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

Multimethods in JavaScript

This is a project I created while learning about Clojure. Multimethods seem pretty cool and I wanted implement them in JavaScript to learn more about them & understand them better, i.e. Just For Fun.

Features

Basic

  • register (attach) methods
  • dispatch to methods

More general stuff

  • de-register (detach) methods [2018-05-23]
  • default method [2018-05-23]

Dispatch hierarchy

  • "derive" method ("is a" type hierarchy of dispatch types) [2018-06-19]
  • resolve a child type to a parent type for function dispatch [2018-06-19]

Multiple dispatch!!

  • basic 2-item dispatch
  • each item respects hierarchy

Utility

  • get methods map
  • get dispatcher
  • "handles" function to see if a call is handle-able (what to do if there's a default method?) [2018-06-19]

"Phase II" 😏

  • Underive
  • method to pass a dispatch hierarchy in/replace one (for sharing) (low priority)
  • get dispatch hierarchy
  • replace methods (hold on this 'til later; not currently clear it's a problem to just allow methods to be overwritten)

About

No description, website, or topics provided.

Resources

Releases

No releases published

Packages

No packages published