From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Elpa: Pinpoint semantics of `seq-subseq' for streams Date: Tue, 13 Sep 2016 21:24:34 -0400 Message-ID: <27962aa1-ae40-99f8-64ad-ae21012fb36e@gmail.com> References: <87bmzrahvg.fsf@web.de> <79c6ccd6-9808-f4fd-071a-58559f72ecdc@gmail.com> <8737l3a4ab.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="48Ub6e4KOONwM3u0LXDi4NHDqRs2dnkEo" X-Trace: blaine.gmane.org 1473816342 8252 195.159.176.226 (14 Sep 2016 01:25:42 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 14 Sep 2016 01:25:42 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 Cc: emacs-devel@gnu.org To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 14 03:25:38 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bjyxD-0001JE-E1 for ged-emacs-devel@m.gmane.org; Wed, 14 Sep 2016 03:25:35 +0200 Original-Received: from localhost ([::1]:52501 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjyxB-0004m6-9Q for ged-emacs-devel@m.gmane.org; Tue, 13 Sep 2016 21:25:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46914) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjywW-0004lp-L9 for emacs-devel@gnu.org; Tue, 13 Sep 2016 21:24:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjywT-00044c-9E for emacs-devel@gnu.org; Tue, 13 Sep 2016 21:24:52 -0400 Original-Received: from mout.kundenserver.de ([217.72.192.74]:63006) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjywS-00044T-WF for emacs-devel@gnu.org; Tue, 13 Sep 2016 21:24:49 -0400 Original-Received: from [18.189.118.169] ([18.189.118.169]) by mrelayeu.kundenserver.de (mreue101) with ESMTPSA (Nemesis) id 0MeShL-1bNnU012tD-00Q8VN; Wed, 14 Sep 2016 03:24:47 +0200 In-Reply-To: <8737l3a4ab.fsf@web.de> X-Provags-ID: V03:K0:cT0C0sWuOY1M+idIV5ta195LgqJu4BSu56i2iMQzPFOJE3nFcd4 yQg3zi6qSNCKp62j7xilzmanmsz/yJa9HrhinebY1HeVYyLcqb0D6nY3I1+8zzzY0WVCrlV 6sRx1U8460TyyJ5MQ1mKM0grboAAUkbrA34Ovvfe2LHKoX99INb7gdF5AYfrMhTN54v8/TI hWfHp27CyzqGAMLnYIlEg== X-UI-Out-Filterresults: notjunk:1;V01:K0:armN34RCbPo=:rWYVY4seqxiEjfin0CQuzK d9aZ3Zvykmd8u5Pd0AkhF0O+ef1sBfnBCzxa3TKBZneBl6CCJ5JHUlnckFpJQON9nzud23D+n uSEB1FkrSqYyZae6JfMjic/QO0FSMejZ5DTTODo3WpiI4AIL+a+MGyCTofrfCmOBTKynSQKKM kvv5tcbnmiuY0JAznPCzO5eIhmpbrS+6u3OaIgIM2F4rthoJ5M7v9l9/Eeuewd+IIGKeBqNUW azUouxhmDMo4HMq61GFw+J38kmKSbdy2LsvQtpAeUXrZ77tIR4JoDKKE4LTR0gpwTRv1czZSX SMwqREd7mVMQ2AR7OetcTreJDLk1sf/Uh0IbLcQ5EorXOm0DgQ9ye4h3kdvbpZky04pU60Qc9 Gp9OmjSDUgZoadvZUnX1nYoSjxRcc3xxs0DeJJRdT0rc37vgOhCem31QUeGYOJ3EzLaFcoTsW zkoqG87EVSscaxxWl7axxNUEviiDkgwpE0CcvkzZaAJR3/oP1bhm9cxGeMEoCIiua5ZvdwPfC E12rTbKURBFvCredinvtD0r3QoOPo5do01MlocNbU1aafMtJFEdaHX5eCaAMpfwJruKi4Exgl sNCr9btcLkh1siAEXkvdjbm/kptjhPOvuUXr+pfWT+nCDg+MMR3uJ01CGOVEhp7MVb6Om8JE3 fXaEbB3sGPmEyigfT1P8jkE65ZEL+diPr6nGq4p/NxC6OxpHc88IO//JTZIR/L9nOBr4= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 217.72.192.74 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:207425 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --48Ub6e4KOONwM3u0LXDi4NHDqRs2dnkEo Content-Type: multipart/mixed; boundary="eSHl5v8d57FgI78KnXh7lKsUpK3fVgSBb"; protected-headers="v1" From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= To: Michael Heerdegen Cc: emacs-devel@gnu.org Message-ID: <27962aa1-ae40-99f8-64ad-ae21012fb36e@gmail.com> Subject: Re: [PATCH] Elpa: Pinpoint semantics of `seq-subseq' for streams References: <87bmzrahvg.fsf@web.de> <79c6ccd6-9808-f4fd-071a-58559f72ecdc@gmail.com> <8737l3a4ab.fsf@web.de> In-Reply-To: <8737l3a4ab.fsf@web.de> --eSHl5v8d57FgI78KnXh7lKsUpK3fVgSBb Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Michael, On 2016-09-13 17:17, Michael Heerdegen wrote: > Yes, I want to forbid them, unless there are realistic use cases. > No, we don't have something like `tail' for streams. If you want > something like that, you are in general better done with lists (i.e. > convert the stream into a list), I think. I don't think converting to list would be a good idea. When operating on= text files, for example, it's often convenient to get the last n lines o= f a file. If the file is represented as a stream of lines, then tail mak= es sense. Doesn't it? Converting the file to a list of lines beforehand= sounds like a bad idea, memory wise. > Streams are a mean to program in a certain way (called data flow > control or something like that). Negative indexes for `seq-subseq' > collide with this model. I don't see why; isn't it common to implement slyding-window-style algori= thms on data streams? 'tail' is just one such example. =20 I do agree, however, that the return value of these silding-window algori= thms is not commonly a stream (rather a list, or a function of that list)= =2E But I'm not sure that this is enough to make subseq with negative ar= guments irrelevant. Otherwise, what's a point of subseq vs. e.g. drop + t= ake? Let me know what you think of the 'last n lines of a file' example. Mayb= e I'm missing something :) Cheers, Cl=C3=A9ment. --eSHl5v8d57FgI78KnXh7lKsUpK3fVgSBb-- --48Ub6e4KOONwM3u0LXDi4NHDqRs2dnkEo Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJX2KbSAAoJEPqg+cTm90wj7+4P/2Kp8eIWg4BQEakouzJzhp6T WBB/f3G4wdn37sNqUSzqDt+Z2UdG7RqqflTPvjVG4/jf3H7jQlG+IyhrG5PiIQJj sxtsd5QRE96snP5Xt6O/8YZNyhkWpUH5R6JNIebLnVxxeDB34ZDHwFWCbP37D5ko cidTtcxZbKEwOytOpW8U4epwYgsw/U+a4m0EHpnh5Bfl0LlY/cyURubWg8ECgdDW t/OqDyHQc1kM7EaGcg7a7mbrpFcTwxB4RXLOqwg7Kd26b3MVNtdeAJVGnaN79PCf JViy/LlsK9+x6IOsx0F7i3foBqLVrNxX4pQQVjfjcWfamB3CUhVIIirfiC1DEdUe TqvvdYwIq+7iQuN7jQnkuSTlTSFPDdHFKHozOkwmeLLAqwiT4ZYJcVAi4Szeq1Vx Wmfln6Nn3ZLuuhgdlSHkSCsnGgqZVb4Ld1jqKXNUBeoQQpwYo6FK53eitvrxeN2D HoSoZm2e2q0k+ty6TM6T4YmJ3jai/miSh2XyzDuirPIPTkET/eFyqbADkZoxeIhT DtKQeeiuaZMyNrPZTOuZUWFRadKUqmsKBKoolRFyNH5QVUeYJrVIRiLiCeCY7Kto sraOczixeda46K1nbh119U20ZOW+lJtwRwt8jooC8Z4oITpgcOKZOASgzIQVI/yL kAzLTZ01uXlXy+2IldRz =3S3e -----END PGP SIGNATURE----- --48Ub6e4KOONwM3u0LXDi4NHDqRs2dnkEo--