Proposal: Improve error messages for (!!) (include index and length of list)

Herbert Valerio Riedel hvr at gnu.org
Thu Oct 16 11:46:09 UTC 2014


On 2014-10-16 at 08:20:55 +0200, Simon Hengel wrote:

[...]

> I propose to change the error messages for the non-report version to
> include index and list length, something that is functionally equivalent
> to:

While I'm very sympathetic to better error messages; doesn't the
implementation you gave defer garbage-collecting the start of the list,
by keeping the head of the list alive until either the desired index has
been reached or end-of-list is detected?

e.g. consider something (silly) like ([1..] !! 10000000)

Cheers,
  hvr


More information about the Libraries mailing list