Login  Register

Re: Calendars

Posted by Simon Ibbotson - Straumur on May 06, 2008; 2:08pm
URL: http://quantlib.414.s1.nabble.com/Calendars-tp6072p6076.html


I don't think it needs to have copy semantics. Calendars are usually
static data so I wouldn't think that several versions of a calendar
would be necessary/desirable.

In other words, if we add a holiday to a given - specific - holiday
calendar, that should propagate into all instances of that calendar.
I can't think of a reason you might want two differing versions of the
same calendar (except for cases which could be resolved external to
QuantLib - measuring the impact of adding a missing holiday, for
example).

This would have the advantage of preserving the current behaviour (and
minimal code changes!).

Simon

-----Original Message-----
From: Luigi Ballabio [mailto:[hidden email]]
Sent: 06 May 2008 14:54
To: Simon Ibbotson - Straumur
Cc: Ferdinando Ametrano; a akpitidis;
[hidden email]
Subject: Re: [Quantlib-users] Calendars


On Fri, 2008-03-28 at 17:07 +0000, Simon Ibbotson wrote:
> I'd agree with "T", it would be nice to have a bespoke calendar... so
we
> can quickly add a calendar that isn't present in QuantLib without
having
> to release a new library. For instance, the calendar for the Kazakh
> Tenge isn't in QuantLib yet and adding a class with the relevant date
> rules would take time/effort and a library release.

This isn't entirely true (you could implement Kazakh Tenge and link it
to your application together with the main library) but I agree, we
might have a bespoke calendar.

It should have copy semantics, right? I mean, if we write:

BespokeCalendar c1;
... initialize c1 with holidays ...

Calendar c2 = c1;  // same holidays as c1

...later on...
c2.addHoliday(...);

c1 shouldn't be modified by the call through c2, I guess. Or should it?

Luigi


--

Testing can never demonstrate the absence of errors in software, only
their presence.
-- W.E. Dijkstra



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users