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=-1.0 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 25432 invoked from network); 8 Jul 2020 05:19:43 -0000 Received: from ns1.primenet.com.au (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with ESMTPUTF8; 8 Jul 2020 05:19:43 -0000 Received: (qmail 5464 invoked by alias); 8 Jul 2020 05:19:38 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: Sender: zsh-workers@zsh.org X-Seq: 46214 Received: (qmail 10697 invoked by uid 1010); 8 Jul 2020 05:19:38 -0000 X-Qmail-Scanner-Diagnostics: from mail-il1-f182.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.3/25863. spamassassin: 3.4.4. Clear:RC:0(209.85.166.182):SA:0(-2.0/5.0):. Processed in 4.259523 secs); 08 Jul 2020 05:19:38 -0000 X-Envelope-From: roman.perepelitsa@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.166.182 as permitted sender) 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:cc; bh=FJ3CRMTPLUYVPZplKkf2tNM02IgemCSUfloWHsnUz9s=; b=dQVNxzjpZMW3Vg174SIUxQp62/xH23tAa9vvF2h2gS+sPMzahLuf5Kx+vEkOwoeW2F pH6lpqbnVlephi7R8/AukDw1YjAGaOQfVDUXmibrVPRw13k4IYWUgt+LSMKgFhlb7QT/ iCPv7BBnCJ9n7tugNEqo90J/Pd8kToRLAB9YVTZCMU0ZAEcP9Gnvx3x0mxhaHfk4FHso jMfgCpbagOFbPu58VgbGl0W7Yg7vDulnadm5kyyztCZkGe68/OfMt6k2symAGwTJCv29 FxAihYjZrk/cqzUZY6m+fN5c2ozXloaospxak2Ovx7nTXjkkpMTmRCBzhOSjY/2+Owh6 AMmA== X-Gm-Message-State: AOAM530uXQ5GTzEPWTrBQZ8LP5xnkEsZ6ueT3q+iAfLQko8JoSgKFIsr ne5n1shNyYj0/z5PzD3rbgPMmhgGP2ZiiotBB+E= X-Google-Smtp-Source: ABdhPJxFWdci9HRMVWJI1D9VpVtPvabUiwTzsaExmvKkKrh7nFZ2h7nfI9LayIhCPQVLV8KS/L6hqBBYHJuZDfs37XA= X-Received: by 2002:a92:408c:: with SMTP id d12mr39074826ill.304.1594185540065; Tue, 07 Jul 2020 22:19:00 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Roman Perepelitsa Date: Wed, 8 Jul 2020 07:18:53 +0200 Message-ID: Subject: Re: zcompile does not expand aliases defined in the compiled script To: Mikael Magnusson Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" On Tue, Jul 7, 2020 at 10:28 PM Mikael Magnusson wrote: > It is possible that you changed the example in the mail without trying > what you changed; if you have the statements > alias x=: > x > in the file x, then sourcing it (non-compiled) will work Yes, that's exactly it. Given a script like this: alias x=: x Sourcing it without zcompile works (`x` on the second line is alias-expanded), but once the script is zcompiled an attempt to source it results in an error (`x` doesn't get expanded). I looked at the source code of zcompile and I understand why this happens. It makes perfect sense when zcompiling functions. It is, however, surprising when zcompiling scripts. Roman.