Charles Greathouse on Wed, 25 Jul 2012 04:58:53 +0200


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

install name collision


I wrote a .gp.c file which includes, among other things, a function
called vecsum. It was based on a gp2c conversion, and includes

GP;install("vecsum","G","vecsum","./auto.gp.so");

in a comment so that gp2c-run will load it. (Yes, this is a silly
function, but I mention it up only for the bug report.)

Usually this procedure works fine, and indeed it seems to here:

> vecsum([1,2,3])
%1 = 6

But when I call the function from inside a GP script, it burns:

  ***   at top-level: rec([23124110,141322
  ***                 ^--------------------
  ***   in function findrecd: ...max(c)==1&&vecmin(c)==0&&vecsum(c)==1)||c==[1
  ***                                                     ^--------------------
  ***   variable name expected.
  ***   Break loop: type 'break' to go back to GP

But even after this error the function exists:

> vecsum([1,2,3])
%2 = 6

> vecsum()=1
  ***   at top-level: vecsum()=1
  ***                 ^----------
  ***   variable name expected.
  ***   Break loop: type 'break' to go back to GP

Is there a difference between these contexts that makes it work in one
but not the other? Have I done something wrong?

Charles Greathouse
Analyst/Programmer
Case Western Reserve University