]> www.ginac.de Git - cln.git/blob - src/vector/output/cl_SV_aprint.cc
Initial revision
[cln.git] / src / vector / output / cl_SV_aprint.cc
1 // fprint() for cl_SV_ringelt.
2
3 // General includes.
4 #include "cl_sysdep.h"
5
6 // Specification.
7 #include "cl_SV_ringelt.h"
8
9
10 // Implementation.
11
12 #include "cl_output.h"
13
14 void fprint (cl_ostream stream, const cl_ring& R, const cl_SV_ringelt& vector)
15 {
16         var const cl_print_flags& flags = cl_default_print_flags;
17         var uintL len = vector.length();
18         if (flags.vector_syntax == vsyntax_commonlisp) {
19                 fprintchar(stream,'#');
20                 fprintchar(stream,'(');
21         } else
22                 fprintchar(stream,'[');
23         for (var uintL i = 0; i < len; i++) {
24                 if (i > 0) {
25                         if (flags.vector_syntax == vsyntax_algebraic)
26                                 fprintchar(stream,',');
27                         fprintchar(stream,' ');
28                 }
29                 R->_fprint(stream,vector[i]);
30         }
31         if (flags.vector_syntax == vsyntax_commonlisp)
32                 fprintchar(stream,')');
33         else
34                 fprintchar(stream,']');
35 }