Hi John,
Pardon my nit-picking; I think any of the proposals will work fine.
>> > The general syntax is: define_client_redirect(name, from, to);
I wonder how often the from regexp would be used. I notice your example
does not, presumably because it's more reliable to match against the
decomposed url in the function.
>> It seems a little confusing that the transform can go in either
>> argument, depending on usage. How about:
>>
>> define_client_redirect(name, transform, predicate)
>>
>> where the transform is a function and the predicate is an optional
>> regexp.
>
> Yes, that was my biggest misgiving about this module, but I hesitate to
> change the order because redirects have nice left-to-right readability,
> and changing it would make it read backwards.
What if the predicate was a keyword argument; then the caller has the
option to place the parameters in order:
define_client_redirect("foo", $predicate=/foo/, function(){})
> define_client_redirect(name, transform ...);
>
> Where all transforms get composed together. Each can be a regexp or a
> function; the final result must be a string url.
>
> We would probably never need all that power, but maybe this way of looking
> at it helps to explain the confusing type signature, and could guide the
> documentation of the module.
That works too, but it might still be confusing.
Regards, David
_______________________________________________
Conkeror mailing list
[email protected]
https://www.mozdev.org/mailman/listinfo/conkeror