Opened 12 years ago

Closed 12 years ago

#342 closed bug (wontfix)

Type of list prints the list

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

Description

When L is a list, I expect type(L) to simply say "list". However Singular will also print the list. This is undesired (if the user wants the list to be printed, it can be requested by "print" rather than by "type"). Here is a sample session:

zteitler$ Singular
                     SINGULAR                                 /
 A Computer Algebra System for Polynomial Computations       /   version 3-1-3
                                                           0<
 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);
// L                    [0]  list, size: 2
[1]:
   5
[2]:
   6
>

Here is what I would like:

> type(L);
// L                    [0]  list, size: 2
>

(no other output).

Change History (4)

comment:1 Changed 12 years ago by zteitler

It occurs to me that for other variable types, e.g. intmat, the value of the variable is printed by "type". So this is actually the designed behavior, I should not have entered it as a bug. Sorry.

I would like to request that "type" and "print" should be two separate commands, and "type" should not imply "print". In particular if a variable turns out to have a very large list or intmat, it can be disruptive to print it when I only want to see the type.

comment:2 Changed 12 years ago by Oleksandr

Could you please try using 'typeof' instead of 'type' (which does exactly what is written in the manual)?

comment:3 Changed 12 years ago by zteitler

Thank you for the suggestion. 'typeof' has the behavior that I was looking for. In the future I should use 'typeof' rather than 'type'.

comment:4 Changed 12 years ago by barakat

Resolution: wontfix
Status: newclosed
Note: See TracTickets for help on using tickets.