Python syntax in Lisp and Scheme

Erann Gat my-first-name.my-last-name at jpl.nasa.gov
Wed Oct 8 15:01:41 EDT 2003


In article <xcvfzi3r2ge.fsf at famine.OCF.Berkeley.EDU>,
tfb at famine.OCF.Berkeley.EDU (Thomas F. Burdick) wrote:

> > method overloading,
> 
> How could you have both noncongruent argument lists, and multiple
> dispatch?

C++ seems to manage it somehow.

#include <stdio.h>

void foo(int x, int y) { printf("1\n"); }
void foo(double x, int y) { printf("2\n"); }
void foo(char* x) { printf("3\n"); }

main() {
  foo(1,2);
  foo(1.2,2);
  foo("foo");
}

compiles and runs without complaint.

E.




More information about the Python-list mailing list