From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 30 10:12:43 2021 Received: (at 50878) by debbugs.gnu.org; 30 Sep 2021 14:12:44 +0000 Received: from localhost ([127.0.0.1]:53582 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVwnj-00014X-Lg for submit@debbugs.gnu.org; Thu, 30 Sep 2021 10:12:43 -0400 Received: from mail1.protonmail.ch ([185.70.40.18]:21316) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVwnf-00014A-8O for 50878@debbugs.gnu.org; Thu, 30 Sep 2021 10:12:42 -0400 Date: Thu, 30 Sep 2021 14:12:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lendvai.name; s=protonmail2; t=1633011152; bh=Duif9VAc48Siy2q8Q+EzT/v0Rg0DydqD0AKXWosJQLQ=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=Apm/84eFU7jyg7BNXgX19qs5Gok9V5s3reHnHZxxPyToA8TO51gXW1tkpjhGy7T+Y Ji6k0Nqjit9yQHogafxwRtrn10SESpZf43fkb35JnsfgEVScL0Eyqr8KiQwRJ1r9Wf 57iFcetccNFvBiCGGaSOk6xTAqigIsLkkzNYUtIsKnRqxzKTX78k4vhBo7Wt8D2Spo aGCoiIorYQxno6mArF/VipJlEthanioBDvHpXJDQ754zGP2TnIhO3jI/SqeDzgUMna qcpgjQbbar8zEYgzxapQzcF/nT3bo3qNqr/GAaWK91Ez30HZ89lJu72S3sJpPUMZcF iGSdk23ZE3nbA== To: Maxime Devos From: Attila Lendvai Subject: Re: [bug#50878] [PATCH] union: Resolve collisions by stable-sort'ing them. Message-ID: In-Reply-To: <9ab183637e8cd645267a37ba0f05319f8b3c72ff.camel@telenet.be> References: <20210928214044.437-1-attila@lendvai.name> <57f1435fd83da8c0e0acaef64d5f08e4ca7b3404.camel@gmail.com> <9ab183637e8cd645267a37ba0f05319f8b3c72ff.camel@telenet.be> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 50878 Cc: Liliana Marie Prikler , 50878@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Attila Lendvai Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > > the hash also needs to be dropped from the path for sorting to be > > useful, but the return value must be the full path, hence the > > complexity with sorting the indices, pointing both to the full paths > > and the cut parts. > > You can replace the 'less' argument of 'stable-sort'. > Example sorting by the second character of a string: > > (sort '("za" "yb" "xc") (lambda (x y) > (char>? (string-ref x 1) > (string-ref y 1))))) i don't know about the expected size of the collision list here, but that would cons much more, because that would cons up two substrings at each comparison, i.e. O(n^2) vs O(n) at least in GC load, probably in time also. i think it's not worth it, but let me know, and then i can simplify the code somewhat at the cost of more consing. sorting lists is probably also much slower than sorting vectors, but there may be some tricks i don't know about. random note: civodul said on IRC that there's a certain reluctancy to update the opaque binary blobs, and the bootstrap guile will be replaced by mes anyway. so, if we want to have this merged, then we will need to give up on testing it until mes becomes the bootstrap scheme (and assuming it will have srfi vectors). in the lights of the above, i think i'll stop pursuing this patch, but i'd be happy to implement something if you can give me highlevel guidance. with the above pointed out, are you still happy with the list sorting? i'd love to have idris packaged so that it has bin/idris symlinked to bin/idris-1.2.3, and installing multiple versions of it would pick the newest one for bin/idris. -- =E2=80=A2 attila lendvai =E2=80=A2 PGP: 963F 5D5F 45C7 DFCD 0A39 -- =E2=80=9CHave the courage to take your own thoughts seriously, for they wil= l shape you.=E2=80=9D =09=E2=80=94 Albert Einstein (1879=E2=80=931955)