Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: read-only functions



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.



Messages sorted by: Reverse Date, Date, Thread, Author