From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19513 invoked by alias); 19 Jun 2017 20:52:43 -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: X-Seq: 41326 Received: (qmail 22891 invoked from network); 19 Jun 2017 20:52:43 -0000 X-Qmail-Scanner-Diagnostics: from know-smtprelay-omc-1.server.virginmedia.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(80.0.253.65):SA:0(-1.0/5.0):. Processed in 1.031119 secs); 19 Jun 2017 20:52:43 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_PASS,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: p.w.stephenson@ntlworld.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _smtprelay.virginmedia.com designates 80.0.253.65 as permitted sender) X-Originating-IP: [86.21.219.59] X-Authenticated-User: p.w.stephenson@ntlworld.com X-Spam: 0 X-Authority: v=2.1 cv=NqQsCJpJ c=1 sm=1 tr=0 a=utowdAHh8RITBM/6U1BPxA==:117 a=utowdAHh8RITBM/6U1BPxA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=x7bEGLp0ZPQA:10 a=NLZqzBF-AAAA:8 a=BMDESN58cluqTdyRe24A:9 a=CjuIK1q_8ugA:10 a=wW_WBVUImv98JQXhvVPZ:22 Date: Mon, 19 Jun 2017 21:52:37 +0100 From: Peter Stephenson To: Zsh hackers list Subject: Re: Why sourcing a file is not faster than doing a loop with eval, zle -N Message-ID: <20170619215237.7e58707b@ntlworld.com> In-Reply-To: <20170619202835.7f207185@ntlworld.com> References: <20170619122413.GA9294@chaz.gmail.com> <170619083116.ZM17323__41722.0601499595$1497886320$gmane$org@torch.brasslantern.com> <20170619161601.GB9294@chaz.gmail.com> <20170619202835.7f207185@ntlworld.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.28; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ntlworld.com; s=meg.feb2017; t=1497905557; bh=XG0/bF9NQEcpJDyhf7OZkgQSpq9y0IdXZRo9VcVy4Qk=; h=Date:From:To:Subject:In-Reply-To:References; b=ah1NxT7VhOaJrUGBGbduZb6Lh61SoPpnrLtEtYrfmq8xHH97ucokutbu1TDJcbbV3 3ChPa7XUZD6gWYpQYuARn4QX8X116Hi+o2kCDQkMhsxnVKxU97LVWLZuIvinAVVNi0 ZrJWIRdff2mzjJE6tjdOREVpcG1iEiogTst3yNtEsBy1WAAdrS+uKa4o8FfnC+mXmg 6GkD6HATeXpoJm796vx5QiENubruWCerieOeNAWMQPWZiEOr/6vAhD1ZFuM/cnqDCz NlVoUZ3KwLN8116G4FvMDpTY9fPZgl6+mJeaaY/JeQCpc96cnfpTEQFgGcFCOAhJ2t v/CnVcIduXVzQ== On Mon, 19 Jun 2017 20:28:35 +0100 Peter Stephenson wrote: > How about something like this? As far as I can tell, fgets is designed > from the ground up as Gets Done Properly, so if you have it on your > system it will work correctly. I can't think of a case where this > wouldn't do the right thing --- fgets will read at most one line and if > it does we were going to get the big STDIO overhead at that point > anyway. I know what the problem with it is --- we can't tell the difference betwen a terminating '\0' and a '\0' that's part of the input stream. pws