axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-developer] findSpadFiles problem


From: Ralf Hemmecke
Subject: Re: [Axiom-developer] findSpadFiles problem
Date: Mon, 02 Jan 2006 18:08:48 +0100
User-agent: Thunderbird 1.5 (X11/20051201)

Happy New Year...

On 01/02/2006 02:25 AM, root wrote:
Bill,

I'm building Axiom for another release and I've discovered a problem
that needs to be fixed. The findSpadFiles routine in the
src/algebra/Makefile.pamphlet file is generating duplicate targets
resulting in the error messages:

Makefile: NNNN: warning: ignoring old commands for target `.....`

after investigating the problem it appears that there is a built-in
assumption that the chunk names are unique. However, a document style
I use has violated that. This is the first time I've used it in the
algebra so it never happened before.
In noweb you can say


mumble, mumble, ...
<<foo>>=
chunk, chunk
@

more words
<<foo>>=
  continued chunk
@

etc. That is, you can insert documentation inline in a chunk by just using the same chunkname. The second chunk gets concatenated
with the first. In src/algebra/combfunc.spad.pamphlet I've done:

<<package COMBF CominatorialFunction>>=
 .....
@
words to explain the change
<<package COMBF CominatorialFunction>>=
 .....
@

The findSpadFiles stanza reads:


egrep '@<<(domain|package|category) .*>>=' *.spad.pamphlet | \
awk -F: '{
  chunk=substr($2,3,length($2)-5);
  split(chunk,part," ");
  spadfile="\${MID}/"part[2]".spad";
  print spadfile": \${IN}/"$1;
  print "address@hidden -R\""chunk"\" \${IN}/"$1">"spadfile;
  print "";
}'

and I'm tempted to rewrite it to include a call to 'uniq' thus:


egrep '@<<(domain|package|category) .*>>=' *.spad.pamphlet | uniq | \
awk -F: '{
  chunk=substr($2,3,length($2)-5);
  split(chunk,part," ");
  spadfile="\${MID}/"part[2]".spad";
  print spadfile": \${IN}/"$1;
  print "address@hidden -R\""chunk"\" \${IN}/"$1">"spadfile;
  print "";
}'

Comments?

Yes. If you have a file

--begin aaa.txt
abc
def
abc
abc
def
--end aaa.txt

cat aaa.txt | uniq
gives
abc
def
abc
def

Only cat aaa.txt | sort | uniq
results in

abc
def

Ralf





reply via email to

[Prev in Thread] Current Thread [Next in Thread]