From 3400efe29b4d318c77a8be34360efbcc72f31040 Mon Sep 17 00:00:00 2001 From: Jan Moringen Date: Sat, 13 Sep 2014 15:53:26 +0200 Subject: [PATCH] Documentation and news entry for SB-SEQUENCE:{MAP,CONCATENATE,MERGE} --- NEWS | 4 ++++ doc/manual/beyond-ansi.texinfo | 29 +++++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 552ada027..0725d3b03 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,9 @@ ;;;; -*- coding: utf-8; fill-column: 78 -*- changes relative to sbcl-1.2.3: + * enhancement: the sequence functions MAP, CONCATENATE and MERGE now call + the new generic functions SEQUENCE:MAP, SEQUENCE:CONCATENATE and + SEQUENCE:MERGE respectively when the specified result type designates an + extended sequence. * bug fix: Wrong binding order of supplied-p parameters in macro lambda lists. (lp#721135) * bug fix: VALIDATE-SUPERCLASS returns T when the superclass is the diff --git a/doc/manual/beyond-ansi.texinfo b/doc/manual/beyond-ansi.texinfo index 7c3c4d6ad..8ca9ef338 100644 --- a/doc/manual/beyond-ansi.texinfo +++ b/doc/manual/beyond-ansi.texinfo @@ -461,8 +461,24 @@ performance penalty @xref{Iterator Protocol}. @findex @cl{copy-seq} @findex @sequence{adjust-sequence} -In addition to the mandatory functions above, methods on the following -sequence functions can be defined: +In addition to the mandatory functions above, methods on the sequence +functions listed below can be defined. + +There are two noteworthy irregularities: +@itemize +@item +The function @code{sb-sequence:emptyp} does not have a counterpart in +the @code{cl} package. It is intended to be used instead of +@code{length} when working with lazy or infinite sequences. + +@item +The functions @code{map}, @code{concatenate} and @code{merge} receive a +type designator specifying the type of the constructed sequence as their +first argument. However, the corresponding generic functions +@code{sb-sequence:map}, @code{sb-sequence:concatenate} and +@code{sb-sequence:merge} receive a prototype instance of the requested +@code{sequence} subclass instead. +@end itemize @include fun-sb-sequence-emptyp.texinfo @@ -486,6 +502,9 @@ sequence functions can be defined: @code{sb-sequence:fill} @item +@include fun-sb-sequence-map.texinfo + +@item @code{sb-sequence:nsubstitute}, @code{sb-sequence:nsubstitute-if}, @code{sb-sequence:nsubstitute-if-not}, @code{sb-sequence:substitute}, @code{sb-sequence:substitute-if}, @code{sb-sequence:substitute-if-not} @@ -497,6 +516,9 @@ sequence functions can be defined: @code{sb-sequence:nreverse}, @code{sb-sequence:reverse} @item +@include fun-sb-sequence-concatenate.texinfo + +@item @code{sb-sequence:reduce} @item @@ -514,6 +536,9 @@ sequence functions can be defined: @item @code{sb-sequence:sort}, @code{sb-sequence:stable-sort} + +@item +@include fun-sb-sequence-merge.texinfo @end itemize In the spirit of @code{dolist}, generic sequences can be traversed using -- 2.11.4.GIT