On 10/01/2011 01:03 PM, Matthew Flatt wrote:
At Sat, 01 Oct 2011 14:18:08 -0400, Neil Van Dyke wrote:
2. Make the APIs for the old library and new library not conflict, by
making any necessary changes to the new API, and put both APIs together
in single library named "plot" that users get with "(require plot)".
Document the old API parts as deprecated.
I had thought of this, but not seriously checked it out until you
suggested it just now.
Sounds like option #2 would be messy and a lot of work -- bogging down
innovation.
FWIW, this is the option that I usually pick. It's usually some work,
support for the old API is usually less than 100%, and the combination
is always less pretty than a clean slate. At the same time, it's often
a good compromise between progress and backward compatibility.
I'm trying it in pieces.
The part I thought would be hardest, making vector-field accept an
argument 'f' with the contract
(or/c (real? real? . -> . (vector/c real? real?))
((vector/c real? real?) . -> . (vector/c real? real?))
was actually really easy. I use procedure-arity-includes? to test which
case 'f' is, and the contract system raises an exception when the actual
signature of 'f' is ambiguous.
That's just awesome.
Neil T
_________________________________________________
For list-related administrative tasks:
http://lists.racket-lang.org/listinfo/users