From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Peter Stephenson <p.stephenson@samsung.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: zsh at perl conference and few questions
Date: Mon, 30 Apr 2018 05:30:09 +0200 [thread overview]
Message-ID: <CAKc7PVAMYg0ALgaFSiLReJydBQFN5_-BFX2WU90MpS=YO6Hbog@mail.gmail.com> (raw)
In-Reply-To: <20180423110642.0e0a5ebe@camnpupstephen.cam.scsc.local>
[-- Attachment #1: Type: text/plain, Size: 1430 bytes --]
On 23 April 2018 at 12:06, Peter Stephenson <p.stephenson@samsung.com>
wrote:
> > for x in {1..20}; do
> > print "$x * 2 = $[x * 2]"
> > done
> >
> > seems terrible to me compared to
> >
> > for x ({1..20}) print "$x * 2 = $[x * 2]"
>
> I don't really know how widely it's used, but you get a certain amount
> using short loops without having to remember novel syntax.
>
> for x in {1..20}; print "$x * 2 = $[x * 2]"
>
>
Mikael always reminds that having short_loops enabled weakens the parser
ability to detect errors, so maybe it's worth mentioning here.
> d) is there a plan to have something like namespaces ?
>
> It was first discussed a long time ago, but no one has bitten the
> bullet. Simple minded namespaces --- allow dots in the variable works
> --- are trivial, but the variable code is very complicated and working
> out how to do it properly is a big task that no one has been prepared to
> look at (saying "someone else ought to do this" does not count as
> looking at it" :-)).
>
It's an occasion to me to tell the observation that function namespaces
would be rather more needed than variable ones. The point is that hook
plugins like z-sy-h and zsh-autosuggestions copy each widget to hook into
it. So it's ${#widgets}**2 functions out there with those plugins loaded,
and times of "lets see my functions print -rl -- ${(k)functions}" are over.
--
Best regards,
Sebastian Gniazdowski
next prev parent reply other threads:[~2018-04-30 3:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20180423093610epcas4p2248cf6f0e76bd3e81ff6fa0ef55f5c25@epcas4p2.samsung.com>
2018-04-23 9:24 ` Marc Chantreux
2018-04-23 10:06 ` Peter Stephenson
2018-04-28 10:14 ` Marc Chantreux
2018-04-30 3:30 ` Sebastian Gniazdowski [this message]
2018-04-30 12:52 ` Marc Chantreux
2018-04-30 5:28 ` Bart Schaefer
2018-04-30 12:57 ` Marc Chantreux
2018-04-30 3:06 ` Sebastian Gniazdowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAKc7PVAMYg0ALgaFSiLReJydBQFN5_-BFX2WU90MpS=YO6Hbog@mail.gmail.com' \
--to=sgniazdowski@gmail.com \
--cc=p.stephenson@samsung.com \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).