<div dir="ltr"><div>I was thinking we edit the expression in vcc instead of erroring with "Wrong argument type" if formats don't match.<br>Allowed conversions would be:<br><br>TIME to REAL and INT<br>REAL to TIME and INT<br>
INT to TIME and REAL<br><br></div>I believe it would be relatively easy but do we want it?<br><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 23, 2014 at 10:35 AM, Poul-Henning Kamp <span dir="ltr"><<a href="mailto:phk@phk.freebsd.dk" target="_blank">phk@phk.freebsd.dk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In message <CAJV_h0avZU7M7ZsLmJhy9O0CGU95iE81ymNRsM2uR=<a href="mailto:GZ-6geSA@mail.gmail.com">GZ-6geSA@mail.gmail.com</a>><br>
<div><div class="h5">, Federico Schwindt writes:<br>
<br>
>Hi,<br>
><br>
>As discussed on the latest VDD I added .real (was .strtod) to the std vmod.<br>
>There are 3 remaining conversions from our list:<br>
><br>
>$Function REAL time2real(TIME)<br>
>$Function INT time2integer(TIME)<br>
>$Function TIME real2time(REAL)<br>
><br>
>They are nothing more than returning their input:<br>
><br>
>VCL_TIME __match_proto__(td_std_real2time)<br>
>vmod_real2time(const struct vrt_ctx *ctx, VCL_REAL r)<br>
>{<br>
> (void)ctx;<br>
> return (r);<br>
>}<br>
><br>
>Before I go ahead and add them are we happy with this or should we consider<br>
>a different route like automagic promotion for certain types?<br>
<br>
</div></div>I'm not sure I can see how that would work ?<br>
<br>
We don't have a way to force the conversion in VCL (ie: no casts) so<br>
I think it will have to be explicit<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20<br>
phk@FreeBSD.ORG | TCP/IP since RFC 956<br>
FreeBSD committer | BSD since 4.3-tahoe<br>
Never attribute to malice what can adequately be explained by incompetence.<br>
</font></span></blockquote></div><br></div>