From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#58669: 28.2; bindat: str and strz not operating on vectors Date: Fri, 21 Oct 2022 20:16:24 +0300 Message-ID: <83sfjhumfr.fsf@gnu.org> References: <87tu3ymm51.fsf@cern.ch> <83y1t9upv1.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33295"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58669@debbugs.gnu.org, nacho.barrientos@cern.ch To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 21 21:18:18 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1olxX6-0008Cr-Ic for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 21 Oct 2022 21:18:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olxSo-0006bh-Pq; Fri, 21 Oct 2022 15:13:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1olvdm-0005U7-CE for bug-gnu-emacs@gnu.org; Fri, 21 Oct 2022 13:17:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1olvdm-0005ue-0D for bug-gnu-emacs@gnu.org; Fri, 21 Oct 2022 13:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1olvdl-0000qg-S7 for bug-gnu-emacs@gnu.org; Fri, 21 Oct 2022 13:17:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Oct 2022 17:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58669 X-GNU-PR-Package: emacs Original-Received: via spool by 58669-submit@debbugs.gnu.org id=B58669.16663726123245 (code B ref 58669); Fri, 21 Oct 2022 17:17:01 +0000 Original-Received: (at 58669) by debbugs.gnu.org; 21 Oct 2022 17:16:52 +0000 Original-Received: from localhost ([127.0.0.1]:38955 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1olvdc-0000qG-1n for submit@debbugs.gnu.org; Fri, 21 Oct 2022 13:16:52 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:46566) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1olvda-0000q2-LX for 58669@debbugs.gnu.org; Fri, 21 Oct 2022 13:16:51 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1olvdT-0005nc-Kf; Fri, 21 Oct 2022 13:16:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=z6WnTGLzxMlxyUiTvQzbJ8hZHG7l+iyZT9NxABTUmGM=; b=V6flvOu/GspH IsJy543WS/ftMFPIEhaCDc85Opac4adgNrwJQ/RUhdnSIM6qYibkmqGbRD/syddhm9d+BzkkYapJk x5dr2IPOcknbIkHurFBcmNxoIU6zg+aFjMruH9gTFej79G3aN27C/O9YMC+PRlJtdi7HSGvvmr1F8 Ig1HPegFdAWnZenBXeQ7WUIhCcL9y5rdI4jnFSrPjj7tAWwlzsXwimdYUkxfNVwlVWISoXix6DVj6 QYRKKINKgbijXN/db2wF02bZqxSvQm/oNtxtvInC2jnVejTfu4oysbwamleCPtGcZAE3ROsVKYJ/J okVosScIV3Cd/VZ30QSXlA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1olvdA-000841-P5; Fri, 21 Oct 2022 13:16:39 -0400 In-Reply-To: (message from Stefan Monnier on Fri, 21 Oct 2022 12:47:37 -0400) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246005 Archived-At: > From: Stefan Monnier > Cc: 58669@debbugs.gnu.org, nacho.barrientos@cern.ch > Date: Fri, 21 Oct 2022 12:47:37 -0400 > > >> Yes, I'm actually surprised I left this code in there as-is because > >> I remember wondering how to make a unibyte string from a vector of bytes > >> in an efficient way (and concluding that there's currently no good way > >> to do that :-( ). > > > > Maybe I'm missing something, but what's wrong with > > > > (apply 'string (append VECTOR nil)) > > `append` takes the vector, turns it into a list (thus allocating N cons > cells), then `apply` turns the list back into an on-stack "vector", and > all of that just to create a 4x or 8x smaller string. It's silly. It gets the job done, doesn't it?