]> www.ginac.de Git - cln.git/blob - src/vector/output/cl_SV_number_aprint.cc
cl_{GV,SV}: use std::size_t for size of vectors (instead of obscure uintC).
[cln.git] / src / vector / output / cl_SV_number_aprint.cc
1 // print_vector().
2
3 // General includes.
4 #include "base/cl_sysdep.h"
5
6 // Specification.
7 #include "cln/SV_complex.h"
8 #include "cln/SV_real.h"
9 #include "cln/SV_rational.h"
10 #include "cln/SV_integer.h"
11 #include "vector/cl_SV_io.h"
12
13
14 // Implementation.
15
16 #include "cln/output.h"
17
18 namespace cln {
19
20 void print_vector (std::ostream& stream, const cl_print_flags& flags, void (* printfun) (std::ostream&, const cl_print_flags&, const cl_number&), const cl_SV_number& vector)
21 {
22         std::size_t len = vector.size();
23         if (flags.vector_syntax == vsyntax_commonlisp) {
24                 fprintchar(stream,'#');
25                 fprintchar(stream,'(');
26         } else
27                 fprintchar(stream,'[');
28         for (std::size_t i = 0; i < len; i++) {
29                 if (i > 0) {
30                         if (flags.vector_syntax == vsyntax_algebraic)
31                                 fprintchar(stream,',');
32                         fprintchar(stream,' ');
33                 }
34                 printfun(stream,flags,vector[i]);
35         }
36         if (flags.vector_syntax == vsyntax_commonlisp)
37                 fprintchar(stream,')');
38         else
39                 fprintchar(stream,']');
40 }
41
42 }  // namespace cln