From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5447 invoked by alias); 14 Jan 2017 20:16:55 -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: 22385 Received: (qmail 5155 invoked from network); 14 Jan 2017 20:16:55 -0000 X-Qmail-Scanner-Diagnostics: from out2-smtp.messagingengine.com 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(66.111.4.26):SA:0(-0.7/5.0):. Processed in 2.098742 secs); 14 Jan 2017 20:16:55 -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=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= mesmtp; bh=nICGCSN8kmr/TftVPg8/f2ZjYJg=; b=N4AI0gs0SXkCJr/nrdHa2 eXdn4EX2kIDLPk7fWzSAiee4FLfoNZJoFqN835beLdGXXSozSZGuFrJEmdSn6nNm c5GnZWl/rKxTLVWRnygPbFeQuD1ZlbFvxidynroYv12l1+g/VmgCDmeQegW+Qg4b IoTMnjXaF2X4I3m4OQ/cPU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= smtpout; bh=nICGCSN8kmr/TftVPg8/f2ZjYJg=; b=P979blHuv2SkVRrlQeEH lNBZJLW98n6cn2fetGalMIZ11rPxBBxokMP+PoBa4caw2zZ0gysb9GjZ1wJfNXJH 6vIcLB4vINIcHnOtCJN/UFMeAfFhAsJUl2jmVvsOFf9oR3HW3i8MlnWC1q9EJhdD 1nk/ng6LvW8IQpBVEvAvNys= X-ME-Sender: X-Sasl-enc: xtxkmULMC+YMrxfHb6MRhCjuJYY6hhAdt3P7eczkChbM 1484425008 Date: Sat, 14 Jan 2017 20:13:19 +0000 From: Daniel Shahaf To: zsh-users@zsh.org Subject: Re: whence question Message-ID: <20170114201319.GA6210@fujitsu.shahaf.local2> References: <652bcc3f-7365-2e52-d39c-8576278606bc@eastlink.ca> <7b890e89-d01b-ab5c-32bf-b75bfa8d945c__41234.9168131643$1484374276$gmane$org@eastlink.ca> <20170114064807.GA31410@fujitsu.shahaf.local2> <20170114174622.GA12641@trex.cs.ovgu.de> <6237271484420924@web15h.yandex.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6237271484420924@web15h.yandex.ru> User-Agent: Mutt/1.5.23 (2014-03-12) Nikolay Aleksandrovich Pavlov (ZyX) wrote on Sat, Jan 14, 2017 at 22:08:44 +0300: > \* E.g. when you issue `vim *.foo` you most likely do not want to > open `*.foo` file if you happen to spell glob wrong or `tar cf foo.tar > *.foo` will create empty archive if glob is spelled wrong and it > received unexistent file as an argument. Semantically, the glob «*.foo» and the literal filename «'*.foo'» would be different types, if the shell language were strongly typed. The former would be a function that returns a list of words and the latter would be (is) a word. You could in principle define a pattern matching flavour where the regexp /αλφα/ matches the plaintext «alfa», and then — let's assume for the moment that all your filenames are ASCII — the commands . % ls αλφα % ls alfa . would very clearly be different: one of them has a glob argument and one of them has a literal string argument. Now, the shell language is _not_ strongly typed, but nonetheless, when people write «*.foo» intending a pattern that expands to one or more filenames, it usually doesn't make sense to just use the pattern instead — not any more than it would be logical for . % echo αλφα > list-of-important-files.txt . to dump the Greek into the .txt file, in the example where all filenames were ASCII. Cheers, Daniel