zsh-workers
 help / color / mirror / code / Atom feed
* Re: ideas
       [not found] <351000F6.8144C90D@rrz.uni-hamburg.de>
@ 1998-03-19  8:55 ` Peter Stephenson
  1998-03-19 12:36   ` ideas Geoff Wing
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Stephenson @ 1998-03-19  8:55 UTC (permalink / raw)
  To: Zsh hackers list

Bernd Eggink wrote:
> > You could just use $i(:s/foo/bar).
> 
> Great! I, too, was wondering why there isn't such a thing. Now I wonder
> if this feature is considered top secret. I can't find anything about it
> in the docu.

I've been waiting and waiting for someone to point out that
${i:s/foo/bar/} does work (and has worked for years and years), you
just need the final / (though I'm working on that, too), but no-one
has.  I can't believe no-one else knew?

Looking at the documentation, I can see the confusion:  it's mentioned
in the history section that modifiers also work on parameters, but not
in the parameter section.

*** Doc/Zsh/expn.yo.pmod	Fri Feb  6 10:22:26 1998
--- Doc/Zsh/expn.yo	Thu Mar 19 09:49:58 1998
***************
*** 167,173 ****
  for a description of parameters.
  In the expansions discussed below that require a pattern, the form of
  the pattern is the same as that used for filename generation;
! see noderef(Filename Generation).
  
  startitem()
  item(tt(${)var(name)tt(}))(
--- 167,176 ----
  for a description of parameters.
  In the expansions discussed below that require a pattern, the form of
  the pattern is the same as that used for filename generation;
! see noderef(Filename Generation).  In addition to the following
! operations, the file modifiers described in noderef(Modifiers) can be
! applied:  for example, tt(${i:s/foo/bar/}) performs string
! substitution on the value of parameter tt($i).
  
  startitem()
  item(tt(${)var(name)tt(}))(

-- 
Peter Stephenson <pws@ifh.de>       Tel: +39 50 844536
WWW:  http://www.ifh.de/~pws/
Gruppo Teorico, Dipartimento di Fisica
Piazza Torricelli 2, 56100 Pisa, Italy


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: ideas
  1998-03-19  8:55 ` ideas Peter Stephenson
@ 1998-03-19 12:36   ` Geoff Wing
  0 siblings, 0 replies; 2+ messages in thread
From: Geoff Wing @ 1998-03-19 12:36 UTC (permalink / raw)
  To: zsh-workers

Peter Stephenson <pws@ifh.de> typed:
:Bernd Eggink wrote:
:> > You could just use $i(:s/foo/bar).
:> Great! I, too, was wondering why there isn't such a thing. Now I wonder
:> if this feature is considered top secret. I can't find anything about it
:> in the docu.
:I've been waiting and waiting for someone to point out that
:${i:s/foo/bar/} does work (and has worked for years and years), you
:just need the final / (though I'm working on that, too), but no-one
:has.  I can't believe no-one else knew?

We just didn't want to add noise to the discussion.  I've always used
${i:s/foo/bar/} and didn't really know about $i(:s/foo/bar) until this
discussion.  But finding out $i(:....) is good too, not that I'll ever use
it since I've been typing ${i:...} for years.  See, now you've just got
more noise on the list :-)
-- 
Geoff Wing   <gcw@pobox.com>            Mobile : blown up, in for repairs
Work URL: http://www.primenet.com.au/   Ego URL: http://pobox.com/~gcw/


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-03-19 12:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <351000F6.8144C90D@rrz.uni-hamburg.de>
1998-03-19  8:55 ` ideas Peter Stephenson
1998-03-19 12:36   ` ideas Geoff Wing

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).