[Devel] Extension URI vs extension prefix (a compatibility vs nuisance decision)
Bent Bisballe Nyeng
deva at aasimon.org
Thu Nov 17 23:44:56 PST 2011
Hi David and others
Making a general design decision like is is a good thing and I agree
that the hash should always be part of the extension URI.
I think many LV2 plugins implementations use local copies of the
extension header files instead of relying on the distros to include them
(gentoo portage doesn't supply the ones I personally use at the time of
Therefore the problem of compatibility breakage is not that great since
it will not occur until a manual header file update is performed.
However; since the change will not render compile-time errors it might
cause some serious headaches in those cases where they do apply.
Would it be an idea to not only append the # to the URI define but also
change the name of it in order to make sure that the compiler will
report the error?
// Bent Bisballe Nyeng
On 11/18/11 04:46, David Robillard wrote:
> Hi all,
> So, as probably many of you have encountered, there is a nuisance that
> crops up writing LV2 code that stems from the fact that the URI for an
> extension and the namespace prefix for that extension are not the same.
> For example, an extension URI:
> and a thing defined in that extension:
> i.e. the prefix is:
> This was a screw up. A convention in other vocabularies is to include
> the trailing hash in the extension itself, so the extension URI and the
> namespace prefix are the same. That way, we can define in headers
> something like
> #define LV2_FOO_URI "http://lv2plug.in/ns/ext/foo#"
> and use it as both the URI of that extension and a prefix, e.g.:
> do_stuff(LV2_FOO_URI "thing")
> There is only one define so the double-hash and missing-hash errors
> should more or less go away.
> I could update things to use this convention, but it would theoretically
> be a compatibility break. However, most things that actually use URIs
> use something defined in the extension, and not the extension itself.
> The few that do are usually using extension URIs that are doubling as
> feature URIs, which is a bad practice anyway.
> Basically, I'm just throwing out a feeler to see how people feel about a
> change like this. The conservative thing to do is, of course, leave
> everything as-is. Always doing the conservative thing to do gets you
> Windows ME, though. :)
> -dr (who wants to just stick all extensions in lv2plug.in/ns while we're
> being crazy)
> Devel mailing list
> Devel at lists.lv2plug.in
More information about the Devel