zsh-workers
 help / color / mirror / code / Atom feed
* Missing keyword 'tied'
@ 2022-01-04 15:15 Jim
  2022-01-04 15:33 ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Jim @ 2022-01-04 15:15 UTC (permalink / raw)
  To: devs

[-- Attachment #1: Type: text/plain, Size: 358 bytes --]

Hi Devs,

Parameter expansion flag 't' when applied to parameters PATH, path, ...,
outputs '*-tied*'.  Yet, the zshexpn man page under 'Parameter Expansion
Flags' for the 't' flag does not define keyword 'tied'.

Is this an oversight or left out for some other reason?
My ZSH_VERSION 5.8

Thanks,

Jim

P.S. Thanks for all the work everyone does on z-shell.

[-- Attachment #2: Type: text/html, Size: 1364 bytes --]

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

* Re: Missing keyword 'tied'
  2022-01-04 15:15 Missing keyword 'tied' Jim
@ 2022-01-04 15:33 ` Peter Stephenson
  2022-01-04 16:22   ` Jim
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Stephenson @ 2022-01-04 15:33 UTC (permalink / raw)
  To: linuxtechguy, Jim, devs

> On 04 January 2022 at 15:15 Jim <linux.tech.guy@gmail.com> wrote:
> Parameter expansion flag 't' when applied to parameters PATH, path, ...,
> outputs '*-tied*'.  Yet, the zshexpn man page under 'Parameter Expansion
> Flags' for the 't' flag does not define keyword 'tied'.
> 
> Is this an oversight or left out for some other reason?
> My ZSH_VERSION 5.8

That'll be a long-standing oversight, good to track it down.  Thanks.

See if this reads OK.  I've put it in the position in the list that
it would appear in the actual output.

pws

diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo
index 753e5a008..93ae3001d 100644
--- a/Doc/Zsh/expn.yo
+++ b/Doc/Zsh/expn.yo
@@ -1205,6 +1205,11 @@ for readonly parameters
 item(tt(tag))(
 for tagged parameters
 )
+item(tt(tied))(
+for parameters tied to another parameter in the manner of tt(PATH)
+(colon-separated list) and tt(path) (array), whether these are
+special parameters or user-defined with `tt(typeset -T)'
+)
 item(tt(export))(
 for exported parameters
 )


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

* Re: Missing keyword 'tied'
  2022-01-04 15:33 ` Peter Stephenson
@ 2022-01-04 16:22   ` Jim
  2022-01-04 16:57     ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Jim @ 2022-01-04 16:22 UTC (permalink / raw)
  To: devs

[-- Attachment #1: Type: text/plain, Size: 607 bytes --]

Your patch triggered something.  The keyword 'special' for the parameter
flag 't' is defined as "for special parameters defined by the shell".
Should it
also include user-defined parameters? Case in point, parameters used by
ztie to "tie" to a gdbm file. Technically, the parameter itself is defined
by the
user, yet it has the 'special' keyword.  Sorry if this seems to be
nitpicking,
but 57 years of computer logic it's hard to break the habit.

Also when I first started using ztie I expected the parameter to include the
key word 'tied'. Had to train myself to check parameter zgdbm_tied.

Thanks,

Jim

[-- Attachment #2: Type: text/html, Size: 1145 bytes --]

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

* Re: Missing keyword 'tied'
  2022-01-04 16:22   ` Jim
@ 2022-01-04 16:57     ` Peter Stephenson
  2022-01-04 17:22       ` Jim
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Stephenson @ 2022-01-04 16:57 UTC (permalink / raw)
  To: linuxtechguy, Jim, devs

> On 04 January 2022 at 16:22 Jim <linux.tech.guy@gmail.com> wrote:
> Your patch triggered something.  The keyword 'special' for the parameter
> flag 't' is defined as "for special parameters defined by the shell".
> Should it
> also include user-defined parameters? Case in point, parameters used by
> ztie to "tie" to a gdbm file. Technically, the parameter itself is defined
> by the
> user, yet it has the 'special' keyword.  Sorry if this seems to be
> nitpicking,
> but 57 years of computer logic it's hard to break the habit.
> 
> Also when I first started using ztie I expected the parameter to include the
> key word 'tied'. Had to train myself to check parameter zgdbm_tied.

In this case the generic parameter code is getting confused by the details
of the ztie interface, so that would take some special casing to sort out ---
unless we simply document that ztie creates special parameters, which is
probably the way to go.  If the (t) flag says they're special, they're special,
no matter how they were created; it's the same flag that the shell uses everywhere
to test this.

"Tied" in the sense in the generic parameter code has a different meaning, which
doesn't apply to database ties (we should have been more careful about the language).
I don't think it's possible for the (t) code to detect the existence of a database
link without doing a lot more work than it's designed for.

pws


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

* Re: Missing keyword 'tied'
  2022-01-04 16:57     ` Peter Stephenson
@ 2022-01-04 17:22       ` Jim
  0 siblings, 0 replies; 5+ messages in thread
From: Jim @ 2022-01-04 17:22 UTC (permalink / raw)
  To: devs

[-- Attachment #1: Type: text/plain, Size: 232 bytes --]

Know the feeling.  But we are only human.  Asked myself many times why
I wrote or did something one way or another. But at the time I did it, it
seemed OK.

Clarifying ztie seems to be the way to go.

Thanks for your response.

Jim

[-- Attachment #2: Type: text/html, Size: 400 bytes --]

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

end of thread, other threads:[~2022-01-04 17:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-04 15:15 Missing keyword 'tied' Jim
2022-01-04 15:33 ` Peter Stephenson
2022-01-04 16:22   ` Jim
2022-01-04 16:57     ` Peter Stephenson
2022-01-04 17:22       ` Jim

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