As suggested in #11, this adds a protocol for interpolations that allows consumers to put other kinds of data in dictionaries than strings. It does not add any new features to Tongue - it does not support anything other than strings out of the box - but it gives users a bit more flexibility.
A few things to consider:
I debated between one or two interpolation functions, and decided it was best to separate them - one for maps, and one for positional arguments. It is two distinct features in Tongue, and leaving the decision up to the protocol would put too much knowledge about the internals of Tongue into the protocol.
I'm not ecstatic about the names interpolate-named and interpolate-positional (seems rather long), but they're accurate and the best I could think of.
The protocol could easily also be named IInterpolatable - Clojure uses both kinds of names internally, and I don't have a strong preference either or.
As suggested in #11, this adds a protocol for interpolations that allows consumers to put other kinds of data in dictionaries than strings. It does not add any new features to Tongue - it does not support anything other than strings out of the box - but it gives users a bit more flexibility.
A few things to consider:
interpolate-named
andinterpolate-positional
(seems rather long), but they're accurate and the best I could think of.IInterpolatable
- Clojure uses both kinds of names internally, and I don't have a strong preference either or.