Skip to Content.
Sympa Menu

cc-devel - Re: [cc-devel] API changes for liblicense: drop ll_get_name() and friends

cc-devel AT lists.ibiblio.org

Subject: Developer discussion for Creative Commons technology and tools

List archive

Chronological Thread  
  • From: Asheesh Laroia <asheesh AT creativecommons.org>
  • To: Peter Miller <millerp AT canb.auug.org.au>
  • Cc: cc-devel AT lists.ibiblio.org
  • Subject: Re: [cc-devel] API changes for liblicense: drop ll_get_name() and friends
  • Date: Tue, 8 Jan 2008 09:47:45 -0800 (PST)

On Tue, 8 Jan 2008, Peter Miller wrote:


On Mon, 2008-01-07 at 19:14 -0800, Asheesh Laroia wrote:
We have some ll_get_* functions, like ll_get_name, ll_get_jurisdiction,
and ll_get_version, and also a general ll_get_attribute() function. I
would like to remove the named ll_get_* functions and require users of the
license to use the ll_get_attribute(license_uri, LL_ATTRIBUTE_URI_PERMITS)
syntax.

I know I resisted before, but I've almost changed my mind.
Go ahead and nuke them.

Impact on speed:

* None: If you use our (e.g.) LL_ATTRIBUTE_URI_PERMITS constant, then we
can do a pointer equailty check instead of a string check, which is
practically free, so there should be no speed loss from switching to this..

I'd still use the strcmp, some folks do *really* dumb things. And some
things that look dumb are not (e.g. behind a plugin for another
language, or swig, etc)

Absolutely, we agree:

the logic would look like

if (action_uri == LL_SOME_CONSTANT || strncmp(...)) {
... stuff ...
}

That way, short circuiting gives us speed where possible and generality where not. (-:

I'm
okay with shortening e.g. LL_ATTRIBUTE_URI_REQUIRES to
LL_ATTRIBUTE_REQUIRES or LL_ATTR_REQUIRES or even LL_REQUIRES.

No shorter than LL_ATTR_REQUIRES please, need to emphasize that its only
useful as an apptibute name. Reminding users it is also a URI wouldn't
be bad, so maybe LL_ATTR_URI_REQUIRES

I'm confused - what do you mean "only useful as an attribute name"? Isn't that obvious from the way it is used? (And it's actually useful in theory as a URI to other RDF aware apps, but that's a Very Advanced Usage that should be handled with care.)

One API change I'd very much like to see is to replace
ll_license_chooser_t with char** because (a) this is more consistent
with every other ll_ function, and (b) it makes more sense when talking
about the corresponding bitmap, and (c) the absence of a
ll_license_chooser_free function is less obvious.

I'll take a look at that and let you know what I think.

-- Asheesh.

--
Q: How many Martians does it take to screw in a light bulb?
A: One and a half.




Archive powered by MHonArc 2.6.24.

Top of Page