Opened 12 years ago

Closed 12 years ago

#343 closed bug (fixed)

Type of element of list returns type of list rather than list element

Reported by: zteitler Owned by: hannes
Priority: minor Milestone: 3-1-4 and higher
Component: dontKnow Version: 3-1-3
Keywords: Cc:


When L is a list, I expect type(L[1]) to say the type of the element L[1]. However Singular will instead say the type of L (i.e., "list"). (And also it prints L. This is definitely undesired --- I requested the type of L[1], not the printing of L. This printing behavior has been entered as a separate item.)

zteitler$ Singular
                     SINGULAR                                 /
 A Computer Algebra System for Polynomial Computations       /   version 3-1-3
 by: W. Decker, G.-M. Greuel, G. Pfister, H. Schoenemann     \   March 2011
FB Mathematik der Universitaet, D-67653 Kaiserslautern        \
> int a = 5;
> int b = 6;
> list L = a,b;
> type(L[1]);
// L                    [0]  list, size: 2

Here is what I would like:

> type(L[1]);
// L[1]                 [0]  int 5

Change History (3)

comment:1 Changed 12 years ago by zteitler

In fact, 'typeof(L[1])' will have the behavior that I was looking for. (It says 'int', in this example.) So in the future I will use 'typeof' instead of 'type'. This is not a bug after all, just my ignorance of Singular.

comment:2 Changed 12 years ago by barakat

Owner: changed from somebody to hannes

comment:3 Changed 12 years ago by hannes

Resolution: fixed
Status: newclosed

fixed with rev. 14272

Note: See TracTickets for help on using tickets.