Opened 11 years ago

Closed 11 years ago

# Problem with example part and map definition

Reported by: Owned by: gorzel hannes major 3-1-4 and higher singular-kernel 3-1-3

### Description

The procs goodproc, goodproc2, badproc do nothing else than to return the input polynomial after having called the identity map via

phi = basering,maxideal(1);

Suppose that there is ring defined with the same name as that defined in the example part. Then the problem occurs that, when calling the example part, Singular might access to the userdefined ring, but not to that of the example.

This, see proc badproc, has the following effect:

1.) Either example stops with an ERROR since outside there is no object

with that name as in the example, or

2.) it choose the object from the userdefined ring, in case an object

equally named as in the *argumentlist* of the proc exists.

The example part contains:

ring r = 0,(x,y),dp; poly h = 2x3y4 + x5+ y3;

and the argumentlist is (poly f).

```> LIB "badlib3.lib";
> basering;
? `basering` is undefined
? error occurred in or before STDIN line 2: `basering;`
EXAMPLE:

ring r = 0,(x,y),dp;
poly h = 2x3y4 + x5+ y3;
2x3y4+x5+y3

> ring r=0,(x,y,z),dp;
EXAMPLE:

ring r = 0,(x,y),dp;
poly h = 2x3y4 + x5+ y3;
? f undefined in r
? error occurred in or before badlib3.lib::badproc line 35: `   g = phi(f);`
skipping text from `;` error at token `)`

> poly f = x2+y3+z4;
EXAMPLE:

ring r = 0,(x,y),dp;
poly h = 2x3y4 + x5+ y3;
y3+x2
```

To avoid this side effect, see proc goodproc, one has to write explicitely

def d = basering;

before defining the map. However the 'd' itself has not to be used in the definition of the map. I.e.

map phi = basering,maxideal(1);

is enough, it is not necessary to write

map phi = d,maxideal(1);

Comment: The procs contains several uncommented listvar() calls