Subject: Re: read-only functions
From: Bart Schaefer <[email-masked]>
To: [email-masked]
Date: Tue, 2 Feb 2016 17:32:00 -0800
List-Id: Zsh Workers List <zsh-workers.zsh.org>

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.