Languages Features Creators Calendar CSV Resources Blog About Donate Add Language
GitHub icon

Single Dispatch

< >
Example from Common Lisp:
; (defclass Person () ()) (defmethod frobnicate ((p Person) record spreadsheet) (format t "~a ~a ~a~&" (type-of p) (type-of record) (type-of spreadsheet))) (defclass Asteroid () ()) (defmethod frobnicate ((a Asteroid) velocity size) ; do stuff ) ; At runtime these 2 would be routed to respective methods: (frobnicate a-person his-record big-spreadsheet) (frobnicate an-asteroid very-fast pretty-small)

Languages with Single Dispatch include Java, JavaScript, Python, C++, Swift, TypeScript, Objective-C, Elixir, Common Lisp, Cython, Pizza, Deesel, cooC, Real-Time Concurrent C, Static Typescript

Languages without Single Dispatch include progsbase

Read more about Single Dispatch on the web: 1.

HTML of this page generated by Features.ts

hasSets.html 路 hasSingleDispatch.html 路 hasSingleTypeArrays.html

View source

PLDB - Build the next great programming language Search v2023 Day 157 Docs Acknowledgements Traffic Today Traffic Trends Mirrors GitHub