zsh-workers
 help / color / mirror / code / Atom feed
* read-only functions
@ 2016-02-03  0:22 Martijn Dekker
  2016-02-03  1:32 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Martijn Dekker @ 2016-02-03  0:22 UTC (permalink / raw)
  To: zsh-workers

bash and yash have read-only functions using:

	readonly -f function_name

Could this be a feature worth adding to zsh?

TIA,

- M.


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

* Re: read-only functions
  2016-02-03  0:22 read-only functions Martijn Dekker
@ 2016-02-03  1:32 ` Bart Schaefer
  2016-02-03  4:59   ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 2016-02-03  1:32 UTC (permalink / raw)
  To: zsh-workers

On Feb 3, 12:22am, Martijn Dekker wrote:
} Subject: read-only functions
}
} bash and yash have read-only functions using:
} 
} 	readonly -f function_name
} 
} Could this be a feature worth adding to zsh?
} 
} TIA,
} 
} - M.
}-- End of excerpt from Martijn Dekker

On Feb 3, 12:22am, Martijn Dekker wrote:
}
} 	readonly -f function_name
} 
} Could this be a feature worth adding to zsh?

Related question:  Given that presently it doesn't mean that, why does
reaonly even accept the -f option?  All it does is the wrong thing,
i.e., makes "readonly -f" behave like "functions" (it should at least
behave like "functions -r" which is currently an error).

Obviously typeset -r accepts -f because both -r and -f independently do
mean something and in general we haven't rigorously coded for mutually
exclusive options.

Anyway there doesn't seem to be any particular obstacle to applying
the PM_READONLY flag to shfunc nodes.


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

* Re: read-only functions
  2016-02-03  1:32 ` Bart Schaefer
@ 2016-02-03  4:59   ` Bart Schaefer
  0 siblings, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 2016-02-03  4:59 UTC (permalink / raw)
  To: zsh-workers

[Sorry about the double-inclusion in the previous message; something
strange happened in the handshake between email client and external
text editor.]

On Feb 2,  5:32pm, Bart Schaefer wrote:
}
} Anyway there doesn't seem to be any particular obstacle to applying
} the PM_READONLY flag to shfunc nodes.

After a few minute staring at code and the accompanying further thought,
this seems to be fundamentally not compatible with autoloading.  The
number of special cases to handle is doubled, among other things.


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

end of thread, other threads:[~2016-02-03  4:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-03  0:22 read-only functions Martijn Dekker
2016-02-03  1:32 ` Bart Schaefer
2016-02-03  4:59   ` Bart Schaefer

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