This is the mail archive of the guile@cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]