On Wed, Sep 19, 2018 at 12:19 PM Nils Goroll <[email protected]> wrote: > > my example was missing the point > > On 19/09/2018 12:14, Nils Goroll wrote: > > backend "b" which you now want to layer under director "d": all instances > > of "b" > > in the vcl now need to be replaced with something like "d.backend()". > > ... while, if we had a common accessor, b could be renamed to bb and the > director be called b.
That won't work when .backend() takes arguments *cough* hash *cough*. I think the confusion is mostly that we make an amalgam of the VMOD object and the underlying director. I'm not strictly against adding some magic to VCL, in this case saying that having a no-arg method returning a VCL_BACKEND could be used automagically when casting an "expression" to a backend and even enforce that the name of the no-arg method is .backend(). I suggested in the past that "vmod-object ~ arg" syntax could automatically be turned into "vmod-object.match(arg)" when we have a matching (pun intended) "BOOL .match(SINGLE-ARG)" method. In case it's not clear, I think it's a good idea, and I'm merely discussing caveats to consider. Mainly, disambiguation. Dridi _______________________________________________ varnish-dev mailing list [email protected] https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev
