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

type-checking for metafiedness? (was: Re: Cores almost on demand in patcompile())



Bart Schaefer wrote on Mon, Oct 10, 2016 at 19:46:18 -0700:
> The comments say that this argument is expected to be metafied
> (pattern.c 522), but as best I can tell it's passed down from
> paramsubst() tokenized but not metafied.

Pardon me if this has been discussed before, but why don't we introduce
the type definitions
.
    struct metafied_t { char *v; };
    struct unmetafied_t { char *v; };
.
and start incrementally replacing uses of "char *" with uses of these
types?  This will gain type checking for metafied v. unmetafied strings,
as these two types do not implicitly convert into each other (attempts
to do so generate a compiler warning).

Cheers,

Daniel



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