I was thinking we edit the expression in vcc instead of erroring with "Wrong argument type" if formats don't match. Allowed conversions would be:
TIME to REAL and INT REAL to TIME and INT INT to TIME and REAL I believe it would be relatively easy but do we want it? On Mon, Jun 23, 2014 at 10:35 AM, Poul-Henning Kamp <[email protected]> wrote: > In message <CAJV_h0avZU7M7ZsLmJhy9O0CGU95iE81ymNRsM2uR= > [email protected]> > , Federico Schwindt writes: > > >Hi, > > > >As discussed on the latest VDD I added .real (was .strtod) to the std > vmod. > >There are 3 remaining conversions from our list: > > > >$Function REAL time2real(TIME) > >$Function INT time2integer(TIME) > >$Function TIME real2time(REAL) > > > >They are nothing more than returning their input: > > > >VCL_TIME __match_proto__(td_std_real2time) > >vmod_real2time(const struct vrt_ctx *ctx, VCL_REAL r) > >{ > > (void)ctx; > > return (r); > >} > > > >Before I go ahead and add them are we happy with this or should we > consider > >a different route like automagic promotion for certain types? > > I'm not sure I can see how that would work ? > > We don't have a way to force the conversion in VCL (ie: no casts) so > I think it will have to be explicit > > -- > Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 > [email protected] | TCP/IP since RFC 956 > FreeBSD committer | BSD since 4.3-tahoe > Never attribute to malice what can adequately be explained by incompetence. >
_______________________________________________ varnish-dev mailing list [email protected] https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev
