Singular/Sources — pull request #144 by alexanderdreyer (2012-06-25 14:55:27+00:00)
Title: New: Override operator '=' for `newstruct`s

This patch allows to override operator '=' for `newstruct`s, in order to write custom constructors:

```C
newstruct("wrapping","poly p");

proc wrap(poly p)
{
wrapping w;
w.p = p;
return (w);
}

system("install", "wrapping", "=", wrap, 1);

ring r = 0,x,dp;
wrapping w = x+1;
w; // p=x+1
w = int(1);
w; // p=1
w=number(2);
w; // p=2

proc wrong_wrap(poly p)
{
return (p);
}

system("install", "wrapping", "=", wrong_wrap, 1);
w = x+1; // error...
```