zsh-workers
 help / color / mirror / code / Atom feed
* bug, limitation, ...?
@ 1996-07-26  8:44 Peter Stephenson
  1996-07-26 12:00 ` Zoltan Hidvegi
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Stephenson @ 1996-07-26  8:44 UTC (permalink / raw)
  To: Zsh hackers list

Somebody was complaining to me on the S-Bahn yesterday evening that he
couldn't do:

% set foo
% print ${1[0]}
zsh: closing brace expected

(I think this question has cropped up before, in fact, but that was
long before Zoltan's parameter substitution improvements.)  It would
be nice if numerical parameters were as much like `other' scalar
parameters as possible.  (OK, they're really array elements, but the
mode of addressing suggests that should be hidden from the user; after
all, direct assignment works.)  Still, the world is not a nice place.
If it turns out a change would be tantamount to allowing ${argv[0][0]}
it's probably too much, at least for now.

P.S. no need to post workarounds.

-- 
Peter Stephenson <pws@ifh.de>       Tel: +49 33762 77366
WWW:  http://www.ifh.de/~pws/       Fax: +49 33762 77330
Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.



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

* Re: bug, limitation, ...?
  1996-07-26  8:44 bug, limitation, ...? Peter Stephenson
@ 1996-07-26 12:00 ` Zoltan Hidvegi
  0 siblings, 0 replies; 2+ messages in thread
From: Zoltan Hidvegi @ 1996-07-26 12:00 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-workers

> Somebody was complaining to me on the S-Bahn yesterday evening that he
> couldn't do:
> 
> % set foo
> % print ${1[0]}
> zsh: closing brace expected
> 
> (I think this question has cropped up before, in fact, but that was
> long before Zoltan's parameter substitution improvements.)  It would
> be nice if numerical parameters were as much like `other' scalar
> parameters as possible.  (OK, they're really array elements, but the
> mode of addressing suggests that should be hidden from the user; after
> all, direct assignment works.)  Still, the world is not a nice place.
> If it turns out a change would be tantamount to allowing ${argv[0][0]}
> it's probably too much, at least for now.

Well, I have already fixed this, and in fact ${argv[0][0]} will work in pre4,
and more:

"${${(M)${(f@)$(<builtin.pro)}:%char*}[2][(w)3]}"

expands to the third word of the second line of builtin.pro which begins
with char.

This is really a side effect of a fix to the ${foo[1]} bug when foo is
unset.  Peter had a fix for that as well but I did not like that much.  It
was quite easy to do that, but big chunks of the code had to be reindented
so the diff's may look big.

Zoltan



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

end of thread, other threads:[~1996-07-26 12:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-07-26  8:44 bug, limitation, ...? Peter Stephenson
1996-07-26 12:00 ` Zoltan Hidvegi

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