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

Re: [PATCH] First try of null typeset

As you might be able to tell, the end of the USA long holiday weekend
has severely reduced my ability to pay attention to this.

On Tue, Dec 1, 2020 at 1:13 AM Felipe Contreras
<felipe.contreras@xxxxxxxxx> wrote:
> This achieves most of what Bart Schaefer's version achieves, except no extra hacks are needed, and
> integer and floats are not changed.

Applying the change to integers and floats is one of the reasons I
went in the direction I did.  What constitutes an "extra hack"?

> In my opinion a separate concept of "null" variable will be needed, and should be separate from
> PM_UNSET, since that changes a lot of behavior.

I don't think it's possible to introduce a separate concept of "null"
inside struct param without touching at least all the same places my
branch already did, and probably others.  I would not be unhappy to be
proven incorrect, but PM_UNSET already covers all the corner cases of
what to do when a parameter should be treated as having no value,
because that's how "local" followed by "unset" has always worked.

> Also, I don't think $empty[(i)] should return nothing, so probably paramsubst() would need to be tuned

Agree.  This may be easier than it seems, because (i)/(I) already work
on scalars: { thing="abcde"; print $thing[(I)] } yields 6.  I just ran
out of time to dig further.

> Addtionally, this patch doesn't change the behavior of the private module.

If by this you mean my branch changed something about "private" in a
way that doesn't correspond to the rest of the changes, then I've
overlooked something.

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