Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh at perl conference and few questions
- X-seq: zsh-users 23375
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- Subject: Re: zsh at perl conference and few questions
- Date: Mon, 30 Apr 2018 05:30:09 +0200
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=CZuXvSN79y+WcsVPjZiDbLZ3WFGHJNZxJaRFCGFHN+4=; b=ndiDTEZtRyaHKSDgBPnC6VEzmwJ2Nvuk5A0JZC0jr/YiEHLjTPdGeAXpf6cb3lntgp kUyY0y8o2u9ak73BbttaNmv9EyfDQwvpTix3O0CvjCfMkKU4Ky9btIP2snoJSxoB5gDx veaWoQGZQqrGeJtw2DAg8SSkg5A8nYy++e7DSyi5OeGbTH77CE81FekpytZHr/O7LWPJ hn5glKXHnWlqjqUM+htIwWPb+fwWb5KyAuJYcclv5/clPRsZqizNORBCgS66tExedXTq Q09R3trsc80gewmmlW9PtAjymDYQlAoKb9/98N18hYdbpPSfK/92KWYM9p1uBIBCm26K n5zw==
- In-reply-to: <20180423110642.0e0a5ebe@camnpupstephen.cam.scsc.local>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CGME20180423093610epcas4p2248cf6f0e76bd3e81ff6fa0ef55f5c25@epcas4p2.samsung.com> <20180422204849.GA30387@prometheus.u-strasbg.fr> <20180423110642.0e0a5ebe@camnpupstephen.cam.scsc.local>
On 23 April 2018 at 12:06, Peter Stephenson <p.stephenson@xxxxxxxxxxx>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author