On Fri, July 18, 2008 8:07 pm, Carl Lowenstein wrote:

> If I may allude to an old discussion, isn't this an argument for
> embedding people-readable tags in object files?
>
>     carl

This is a clever and valid use of key words. Something like:

static char* OBJVER="$Version";

That's from dim memory, so it may be syntactically wrong, but it gets the
idea across.

My problem with that, and with all key words is this: at check in/commit,
the system will usually do a diff _before_ to see if the file's changed.
But any diff _after_ will say the files are different, even if they
aren't. A human can easily spot that it's just a key word, but it's plain
hell to script:

  set return [exec diff $a $b]
  if {return != 0} {
    # do something
  }

... or ...

  set return [exec diff $a $b]
  if {return != 0} {
    if {[some goddam thing to scan for keywords]} {
      # do something
    }
  }

If key words are to be expanded, it's perhaps better to segregate them in
a header included in all source: keywords.h. Then the diffs are true, the
objects have the data strings, and the other source files remain true.

Given a choice between key words and accurate diffs (and I have been given
that choice in the past), I'll always go with sacrosanct source.

I really need to stay out of this discussion and learn from the list.

-- 
Lan Barnes

SCM Analyst              Linux Guy
Tcl/Tk Enthusiast        Biodiesel Brewer


-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to