Singular/Sources — pull request #140 by alexanderdreyer (2012-06-20 15:01:50+00:00)
Title: Better Itneraction between custom blackbox types

pyobject can be converted to a given newstruct and vice versa, if customly defined.
Patch f84fa591... also fixes a segfault on errorous user commands.

```C
newstruct("wrapping","pyobject obj");

proc to_pyobject(wrapping obj)
{
return (obj.obj);
}

system("install", "wrapping", "pyobject", to_pyobject, 1);

wrapping wrapped;

pyobject(wrapped); // -> None

pyobject extracted = wrapped;
extracted; // -> None

proc auto_dewrap(pyobject obj)
{
return (obj);
}

auto_dewrap(wrapped); // -> None

proc to_wrapping(pyobject obj)
{
wrapping result;
result.obj = obj;
return (result);
}

system("install", "pyobject", "wrapping", to_wrapping, 1);

wrapping next = extracted;
next; // -> obj=None
wrapping(extracted); // -> obj=None
```