From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: avoid narrow-to-region (was: Re: replace-regexp) Date: Sun, 9 May 2021 17:06:33 +0700 Message-ID: References: <87tunf1mz5.fsf@zoho.eu> <87v97v6mxg.fsf@gnu.org> <87wnsaz9df.fsf@zoho.eu> <877dkaytwu.fsf@zoho.eu> <87eeegx25w.fsf_-_@zoho.eu> <87fsywtp3f.fsf@zoho.eu> <87bl9ktms2.fsf@zoho.eu> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24618"; mail-complaints-to="usenet@ciao.gmane.io" To: Emanuel Berg , help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 09 12:07:33 2021 Return-path: Envelope-to: geh-help-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 1lfgLV-0006It-DV for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 09 May 2021 12:07:33 +0200 Original-Received: from localhost ([::1]:54094 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lfgLQ-0004Tr-Qi for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 09 May 2021 06:07:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58464) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lfgKl-0004TX-45 for help-gnu-emacs@gnu.org; Sun, 09 May 2021 06:06:47 -0400 Original-Received: from mail-vs1-xe30.google.com ([2607:f8b0:4864:20::e30]:35749) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lfgKj-0002po-Hx for help-gnu-emacs@gnu.org; Sun, 09 May 2021 06:06:46 -0400 Original-Received: by mail-vs1-xe30.google.com with SMTP id j13so6956324vsf.2 for ; Sun, 09 May 2021 03:06:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=vweuAEN2tp+kNThrljddzg0j8VL92jCfHf3xYR7tPeg=; b=PwcjeDJhP02ywx1DyXAEDS7CfA96FDUwtnOY2FTHlJBsZoczcuJEWLg5Ao5erFrjgg 3ETynxRC3FLSAMXm7nYMnSFtBMhWCmFLXIGoeC1PHSvwZwpL+n7md0EJoZfQzMA+Dgcj tzmYq1PvAi8PB2fnkslQJRbvyUuAXb7fW/3xyN0jaumnCRjrAeFRaKOpT5lj9fARRtFo l+/hcwTYl3hQvuyA85oQh5XfJkQMcIZuReObuoqzoxLwD8JkOpvwgEYW4lOg/JtdgiDU j9//aIH6dB57HWRVnh88LALkPbIjuiIx6FnEy50Z0QZJ5DHIkTKxlaxVb6becjnRNwa2 fCzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=vweuAEN2tp+kNThrljddzg0j8VL92jCfHf3xYR7tPeg=; b=DLbntRqleF+jhIYtNt6PESP+g1krKxIUTX4FekxI/omwmPsa6GjMYplo18x0cNKrJz IRfx/+aYCpp15jtZasoGv5zrurOtQF9QZgd8CJbC0kTdK7SNSyrcnSvg27G9/FrOGlNl TMwX78QTvgrFz0Bg0ditw+k2rF+k5AQ+QoQtKBhNctCA9OI582cRXDpeBLVnN0woXViQ ak9qszDdMEa5MmVPPJ8IomE2UUdjyWONGzw2xzTdHUxzLXuafYhpKXQpjeH0cSg+YdG8 7PJ9U3Ad9GXMJr3HNjR8D3gjvrxVLNxniD5QdOa//reOK8/bk48x9+yKocxHPCgbF6r2 hJ6g== X-Gm-Message-State: AOAM531RVW1ihE3pre6B3nquwMXNOAB4AyJieG1+To7mW5yHnQfv21H9 St8Zd6cdKrvIfgI51uuLH0sCRAkKhu0AA6kb+nY= X-Google-Smtp-Source: ABdhPJz3rTOyzDagELq0r3ijBtwNzQNsN72OiTMQK+Aut5cUmb5gB8R9rddQRmssnKchZQ9+AopwzbS9gTImXq06tfc= X-Received: by 2002:a05:6102:c4:: with SMTP id u4mr16036245vsp.51.1620554804616; Sun, 09 May 2021 03:06:44 -0700 (PDT) In-Reply-To: <87bl9ktms2.fsf@zoho.eu> Received-SPF: pass client-ip=2607:f8b0:4864:20::e30; envelope-from=yurivkhan@gmail.com; helo=mail-vs1-xe30.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:129610 Archived-At: On Sun, 9 May 2021 at 14:00, Emanuel Berg via Users list for the GNU Emacs text editor wrote: > >>> Consistency: If (f a b) returns t once, it must return > >>> t when called again with the same arguments. [...] > >> > >> But here, we want to randomize _every time_. > > > > Every time you do a random shuffle, but not within > > a single shuffle. > > Why not? >From the Wikipedia article I linked to previously, which you apparently chose to read later: === In principle this shuffling method can even result in program failures like endless loops or access violations, because the correctness of a sorting algorithm may depend on properties of the order relation (like transitivity) that a comparison producing random values will certainly not have.[12] While this kind of behaviour should not occur with sorting routines that never perform a comparison whose outcome can be predicted with certainty (based on previous comparisons), there can be valid reasons for deliberately making such comparisons. For instance the fact that any element should compare equal to itself allows using them as sentinel value for efficiency reasons, and if this is the case, a random comparison function would break the sorting algorithm. ===