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

Re: Should defining a reference to an autoload parameter load it?



On Tue, Jun 10, 2025 at 3:56 PM Philippe Altherr
<philippe.altherr@xxxxxxxxx> wrote:
>
> ... for the time being, I will rather ensure that the first script also loads SRANDOM at definition time.

That seems the most reasonable.  But that also explains why this happens:

>> zmodload -u zsh/random
>> () {
>>   typeset SRANDOM=foo
>>   echo $SRANDOM
>> }
>> Output:
>> foo

The existence of the local prevents the PM_AUTOLOAD flag (on the
hidden global) from ever being seen.

> It may only be in 2-3 days as I might be busy the next 2 days.

I will be busy (more like, even busier) for several days after the
next 2 days, so no hurry.




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