[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Vectors as functions



At Fri, 15 Aug 2003 14:11:56 -0400 (EDT), mike@newhall.net wrote:
> > At Fri, 15 Aug 2003 01:36:53 -0400 (EDT), mike@newhall.net wrote:
> > No, it's not *just* the syntax is what I said. You need the values to
> > be different. If I had a special syntax for mutating vectors and a
> > special syntax for extracting the elemnts, but they were merely
> > "syntactic sugar" for function applications, I wouldn't really get much
> > benefit out of that. Sure, I'd get some (I could make my intentions
> > clear to other people who were reading the code) but it wouldn't be as
> > useful as if the vectors actually were not functions.
> 
>     That's what I'm not clear on -- what benefits would you get?
> 

Better error messages when things go wrong (in fact more information
about errors in general for debuggin). The ability for a type checker
or contract system to enforce invariants about your program (rather
than just letting bad values flow around after programmer errors could
have been discovered).

Robby