Skip to content

Terminology: overloading versus multiple dispatch #1

Description

@rauschma

Overloading dispatches statically, via static type information (Java). A better term for what you are doing is “multiple dispatch [1]” (Common Lisp, Clojure). You could structure your API like this (possibly with different names):

var createPerson = createMultiMethod();
createPerson.addMethod([String], function (name) { ... });
createPerson.addMethod([String, Number], function (name, age) { ... });
...

[1] http://en.wikipedia.org/wiki/Multiple_dispatch

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions