[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: succinctness = power
Paul Prescod writes:
> Paul Graham wrote:
> >
> > Certainly you want to look at what can make program*s* shorter,
> > not just a particular program. Is there stuff you can do that
> > makes all or most programs shorter and yet is a bad idea?
>
> Yes, you can capture common special cases, but make the language
> less reliable and harder to reason about. I've brought up the
> example of making vector->list optional in Scheme.
Dylan has a semantics that's basically OO Scheme, and in it <vector>
and <list> are subclasses of the <sequence> type. So you can write
easily write functions that work on both <vector> and <list> by using
the operations that work on <sequence>. This doesn't make it any
harder to write reliable or succint code -- in fact, it makes both
easier. (I don't know enough C++ or Perl to comment about your other
examples.)
--
Neel Krishnaswami
neelk@alum.mit.edu