Re: AW: Excel add in

Posted by Luigi Ballabio-2 on
URL: http://quantlib.414.s1.nabble.com/bermudan-swaption-simplex-tp2377p2380.html

At 12:03 PM 2/5/03 +0100, Jens Thiel wrote:
> > Do you think this will work and can provide a general automatic wrapper
>for Excel?
>
>I could imagine that SWIG can be extended this way. C++ has been build on a
>functional language (cfront to c), Python and Perl are functional languages
>in their core. They all carry some kind of "this/self" ptr around, and
>attach functions to "this". A stringified "this" could be possible, and
>generating some mangled namespace_objecttype_methodname_overload functions
>that take this string as their first parameter as well.

Yes, this is what SWIG does already for Python---a string is passed to and
fro which encodes 'this', i.e., the address of the object.

>The problem I see here, is that a lot of code is going to be written in
>spreadsheet cells, which is very hard to maintain.

Which is the point I tried to make. My main concern with this
"functionified object interface" is usability. You'll need a cell to call
the constructor, and another to call the method you're interested in; and
you'll have to find a way to trigger recalculations, which might be hard to
maintain. For instance, if a market rate changes, any term structure using
it will be notified, as well as any swaps which are discounted on the
latter, so that the actual objects will be ready to recalculate their value
when they are asked for it. But they won't have a way to notify
Excel---they don't even *know* they're being used by Excel---so they will
*not* be asked for their new price, unless you keep track of all
dependencies on your spreadsheet...

Bye,
         Luigi