From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 26414 invoked from network); 31 May 2021 18:18:43 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 31 May 2021 18:18:43 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1622485123; b=Ii4Uw70kaihUypeFk9dOG9gv/thB4Nlw+2rPUvJPLD66OC07FYvL17vBTcjc/cgeFlhhfEc/8x zq3GRkYI85B+7/ZWmEMd9NeVvg5PqZ7jsmJXRHRNzwZCE6TRKQO+Ercb5rfIuefGWOXzAPJSsK vCrWFhBBg+LnRL5mOWEOWiRjYDH0np0YfB0wyZNWwMri1tRqFpyM63TFL0yK8RJQaZELXy42X+ T4svYNOqUWeDeCnmY1l7dtwOq14l4hCj8N8QB/wvxdef9puqS27m/W0HfHKeUd3Iq9vliDuQmW e1aeLAsVGKyvlk+yqmS0oOKEdyeWkD1ZNXB4npfEa8yiiw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ot1-f46.google.com) smtp.remote-ip=209.85.210.46; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1622485123; bh=7DQs724/9uSi48D28OrKSs9jzBU7QHmIhetMI02pfmM=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=hBPcTQJMf/Z+lGXQu9+WmRCC4/ZxJWG+Ds2K5CIC9yBrHekKcClHOZ5KhA6zEZV5uaUVlhyQpP ypfEyMbydKQQb1R1JZn+q/+lUXSHsrWZqHkCJECh1Z7T2K7OLvVwEQ2/IvA3nDHbGBYhmXXgkC MZB+GERtgCfiEqAqSyFU3hFueXjrqPO8roV4w8eZySdKYmELuk00t59Rq9RDlU217oBwWbbRyd bZudOn1fVmLlIXUI0dKCg6BtomicNV/eipwOkVf1EU4uZy13gJr2YzR0DpzScTv1pVQn62nZj9 tSYZInZqtyXoNjoc5pnayeyar64jEfy1xyMxxfJX2fhe1g==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:To:Subject:Message-ID: Date:From:In-Reply-To:References:MIME-Version:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=1Apa3cc/u3JN4DgjANbDKiH+maDKJ2U7hp8QyRKzRCc=; b=WEF8uh3fo4vmXW8Yx9g2WusQpd nCuLWVc7YaJzrJcqKoPj2EEZOA4sIH8y819ct2VA2eYloIJGTLE2We5hBLWz0SpaD0IcaUhgD0dVV i/JxxSgZMYfGV5Bff36j/fAwpMgrd86li4sRnWCSFAQzJHWwjd7AjTLmW4e/SB9vjrMdEuUImhyNT /4Ba0SXIpXRSN+zGja7zir+xJEprXKLJfJTEWRIcwOnc56uqDEPPH6kKkXigeuuikQzjBWwD5A54s f9LPYg3BsLtKSJhmBoBQJW41DlcPSmu2kge+E/tDUk6D2OjcxRgpm5zLjTLe1vbNtExwxzO4Y31EE RnCK0ZcQ==; Received: from authenticated user by zero.zsh.org with local id 1lnmUs-000KEu-Qr; Mon, 31 May 2021 18:18:42 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ot1-f46.google.com) smtp.remote-ip=209.85.210.46; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ot1-f46.google.com ([209.85.210.46]:44748) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1lnmUZ-000Juo-OM; Mon, 31 May 2021 18:18:24 +0000 Received: by mail-ot1-f46.google.com with SMTP id r26-20020a056830121ab02902a5ff1c9b81so11798903otp.11 for ; Mon, 31 May 2021 11:18:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=1Apa3cc/u3JN4DgjANbDKiH+maDKJ2U7hp8QyRKzRCc=; b=zOeEpo5Qkj/swrdHnsL2JgYS2Nx0AmjahYGkcCAWkCVGr6AkIA43kPElc1dwpm1286 pevoA4hF0ffsqWMF4tmbghto6fMNSCbaWGbokWCtC3nBZf0btc8l2PEg6vdNeOZk5y+8 eOC7N9uyX0Uno1BbemZm9qdPOYLiBM6R6hXARPrydvS/BlUz6v2EYkI+fKDwAwg4Y8rV diGItCjP+ibewiHZnJYnrNYeG2pNCzyoxJaBEInp4eUkA569mOlacxZtzvd3jg8fN1ju 87VDj0jXeJ86dAyHMVMGT+sN1oRzGjdKrcR5xNYmpktyYp40qv7BGnZ0ldckj8reeyra jvOA== 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=1Apa3cc/u3JN4DgjANbDKiH+maDKJ2U7hp8QyRKzRCc=; b=FLhKphFPvl+7scoJp8KZAnfySAt/azwr5gjCMFQC07a7uPo/bYSNzIUp2+m3j1vard GQxCJx2D6l91BlDthEHOkCXABDbuqel9ryhX6nEWZIVBacxQtrnfcfDoGdAT//mkNmPT imZl71nn9gTgdx/4Vu/am7Bv2DdIyikig7WRz+tGh5kMDs+WefpLgZwO3zZrcLvlVuNe iwrtQZSW4M6fGXzidbcGD3XNjQI3ZPOl+6XqlgAayBtvS91Y2AwFK/lv1TDseV7EoJD+ ITmZAU0zwYV1vXF6nMoemvaJWXYiDxOPVlDsr2Q95SOlADhZ/x4LU4Ce2HPx1UT98Txe SEoA== X-Gm-Message-State: AOAM532Y6EECTKja/Dm0rkmJV3uxY1Klb0luZ/1FlzrROA+sEwsVZiLf eLjFGqml7sCr1tiboWvSxZXvK89kjtNJ7ZMnuaDfnw== X-Google-Smtp-Source: ABdhPJySAVwStEb/zOeHI0h0rFf90Eg+kJDl2ihdv5Zu1kNIOBAy6/Eo90e5hqOAlNsXyX9wa6yIjvu8OOBHdeZXsWI= X-Received: by 2002:a05:6830:16d3:: with SMTP id l19mr17911931otr.161.1622485102275; Mon, 31 May 2021 11:18:22 -0700 (PDT) MIME-Version: 1.0 References: <20191216211013.6opkv5sy4wvp3yn2@chaz.gmail.com> <20191216212706.i3xvf6hn5h3jwkjh@chaz.gmail.com> <20191217073846.4usg2hnsk66bhqvl@chaz.gmail.com> <20191217111113.z242f4g6sx7xdwru@chaz.gmail.com> <2ea6feb3-a686-4d83-ab27-6a582424487c@www.fastmail.com> <20200101140343.qwfx2xaojumuds3d@chaz.gmail.com> <20210430061117.buyhdhky5crqjrf2@chazelas.org> <20210505114521.bemoiekpophssbug@chazelas.org> In-Reply-To: <20210505114521.bemoiekpophssbug@chazelas.org> From: Bart Schaefer Date: Mon, 31 May 2021 11:18:11 -0700 Message-ID: Subject: Re: [PATCH v3] regexp-replace and ^, word boundary or look-behind operators (and more). To: Bart Schaefer , Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 48971 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On Wed, May 5, 2021 at 4:45 AM Stephane Chazelas wrote: > > > What do you think about replacing the final eval with typeset -g, as > > mentioned in workers/48760 ? > > [...] very legible. It has the benefit (or inconvenience > depending on PoV) of returning an error if the lvalue is not a > scalar. It reports an error (and exits the shell process) upon > incorrect lvalues (except ones such as "var=foo"). A major > drawback though is that if chokes on lvalue='array[n=1]' or > lvalue='assoc[keywith=characters]' Hmm, I wonder if that should be considered a bug. It seems the parsing in builtin.c:getasg() is not equivalent to what's done for the same input syntax elsewhere.