Remaining conversions to std

Federico Schwindt fgsch at lodoss.net
Mon Jun 23 12:03:55 CEST 2014


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 <phk at phk.freebsd.dk>
wrote:

> In message <CAJV_h0avZU7M7ZsLmJhy9O0CGU95iE81ymNRsM2uR=
> GZ-6geSA at mail.gmail.com>
> , 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
> phk at FreeBSD.ORG         | TCP/IP since RFC 956
> FreeBSD committer       | BSD since 4.3-tahoe
> Never attribute to malice what can adequately be explained by incompetence.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-dev/attachments/20140623/4cdfb619/attachment.html>


More information about the varnish-dev mailing list