This is the mail archive of the
guile@cygnus.com
mailing list for the Guile project.
Re: records
Miroslav Silovic <silovic@zesoi.fer.hr> writes:
> So, since C++ uses something like vtable[function_id](arguments) to
In this case C++ vtable() function is generic, yes.
> dispatch by type, C++ also simulates inheritance through genericity?!
No. That is just a implementation issue. Your vtable() function
is not a user-visible function and it is not necessary to extend the
vtable() function to accept new types.
If display, + and others were not user visible we would not have any
problem whith them. But they are visible to the user and you
can't create a polymorphic system on top of an generic interface.
The problem is that you can't extend display and + to accept new
types unless you switch to polymorphism.
For example the following + is polymorphic:
((integer +) 1 2)
((string +) "hello" "you")
But the default scheme + is not.
Jost
- References:
- records
- From: thi <ttn@mingle.glug.org>
- Re: records
- From: Jim Blandy <jimb@red-bean.com>
- Re: records
- From: Jost Boekemeier <jostobfe@linux.zrz.TU-Berlin.DE>
- Re: records
- From: Jost Boekemeier <jostobfe@linux.zrz.TU-Berlin.DE>
- Re: records
- From: Chris Bitmead <chris@tech.com.au>
- Re: records
- From: Jost Boekemeier <jostobfe@linux.zrz.TU-Berlin.DE>
- Re: records
- From: Chris Bitmead <chris@tech.com.au>
- Re: records
- From: Jost Boekemeier <jostobfe@linux.zrz.TU-Berlin.DE>
- Re: records
- From: Miroslav Silovic <silovic@zesoi.fer.hr>