Version française
Home     About     Download     Resources     Contact us    
Browse thread
RE: additions to standard library?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: John Max Skaller <skaller@m...>
Subject: Re: additions to standard library?
Don Syme wrote:
> 
> I've often wondered why languages don't support "extensions" to library
> namespaces (and perhaps even to functors).  e.g. one could define
> 
> let String.explode s = ....
> let String.implode s = ...
> let myfun = ...

The reason is that it is hard to localise these changes.
It isn't acceptable to extend the actual module, since two clients
could provide conflicting "extensions". This would break the
Open/Closed principle [Meyer, OOSC]

-- 
John (Max) Skaller, mailto:skaller@maxtal.com.au
10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850
checkout Vyper http://Vyper.sourceforge.net
download Interscript http://Interscript.sourceforge.net