Inspired by this Stack Overflow post:
I thought it might be useful to have helpers to update the struct fields, rather than manipulating the struct directly.
Instead of:
etc.
We could do:
I was thinking that one helper per struct field would be useful. Or maybe only adding a helper for query: `put_query/1` would be an option. Query seems useful, as there is currently no way to programmatically construct a URI with a safely-encoded query string using the `URI` module without manually updating the `query` property (or manually appending the query to a string and calling URI.new again).
In the case of `put_query`, it could have two versions: one that puts a string, and one that accepts an enumerable and wraps up encode_query/2.
Come to think of it, accepting a query enumerable to `new` might even be worth it.
I realise this is just syntax sugar, so there might not be desire for such a feature, hence this post. :)
--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/666650f2-7a75-4784-b79e-883bff6a3eb8n%40googlegroups.com.