From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22936 invoked by alias); 27 Nov 2015 02:59:41 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21003 Received: (qmail 12103 invoked from network); 27 Nov 2015 02:59:38 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Authority-Analysis: v=2.1 cv=X+5rdgje c=1 sm=1 tr=0 a=Uh/wpEIUX9UX0FOdpsyW1Q==:117 a=Uh/wpEIUX9UX0FOdpsyW1Q==:17 a=N659UExz7-8A:10 a=e9GbTgMGQ8yJeSh2y8IA:9 a=pILNOxqGKmIA:10 Message-id: <5657C00C.2010401@eastlink.ca> Date: Thu, 26 Nov 2015 18:29:32 -0800 From: Ray Andrews User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-version: 1.0 To: zsh-users@zsh.org Subject: Re: curiosity with here document. References: <56575158.1070303@eastlink.ca> <1330101448564591@web8j.yandex.ru> <5657939E.7070106@eastlink.ca> <151126175625.ZM22214@torch.brasslantern.com> In-reply-to: <151126175625.ZM22214@torch.brasslantern.com> Content-type: text/plain; charset=windows-1252; format=flowed Content-transfer-encoding: 7bit On 11/26/2015 05:56 PM, Bart Schaefer wrote: > On Nov 26, 3:19pm, Ray Andrews wrote: > } > } lesson learned. > > Except it's the wrong lesson! Well no, it is a lesson to be careful trying to use here-docs to comment blocks. As to why it goes off the rails, I was close to understanding it anyway--I'd expect legal code like that to have some sort of truth value, inconvenient as it may be. I'm not really surprised by the correct understanding. > function three_commands { > command1; command2; command3 > } > if three_commands; then ... Sure, but in practice I don't think we see that sort of 'list' after an 'if' very often. It seems that only the truth value of the last statement is acted upon as far as any 'if-then' structure, so as I said, the original 'if' seems to be orphaned. So what? It's me put the parser into that strange position, I'm not bitchin', it did what it had to do. Don't want orphan tests? Don't make them. > And second, that [[ ... ]] is just a command like any other command, > it's not magically connected to "if". That's the sort of fact that one might think one understands without really understanding it. I probably can't hardly help C-ing it the C way. I appreciate these deep corrections. > And third, that a here-document is just the standard input of the > command it follows, so > > : < some stuff > END > > is (again for purposes of determining truth value) the same as > > : Yeah, I'm really not as thick as I seem about this. Wanting the 'comment' to be available at any point wasn't realistic. Not one of my better questions. BTW, I wish there was a way of going back to the archives and deleting lousy questions, I'd sure cut out a pile of mine. Library of Babel.