3 * Copyright 2006,2009 Free Software Foundation, Inc.
5 * This file is part of GNU Radio
7 * GNU Radio is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3, or (at your option)
12 * GNU Radio is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with GNU Radio; see the file COPYING. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street,
20 * Boston, MA 02110-1301, USA.
27 #include <gruel/pmt.h>
30 #include <gruel/pmt_pool.h>
35 static const int CACHE_LINE_SIZE = 64; // good guess
37 # if (PMT_LOCAL_ALLOCATOR)
39 static pmt_pool global_pmt_pool(sizeof(pmt_pair), CACHE_LINE_SIZE);
42 pmt_base::operator new(size_t size)
44 void *p = global_pmt_pool.malloc();
46 // fprintf(stderr, "pmt_base::new p = %p\n", p);
47 assert((reinterpret_cast<intptr_t>(p) & (CACHE_LINE_SIZE - 1)) == 0);
52 pmt_base::operator delete(void *p, size_t size)
54 global_pmt_pool.free(p);
62 // nop -- out of line virtual destructor
65 ////////////////////////////////////////////////////////////////////////////
67 ////////////////////////////////////////////////////////////////////////////
69 pmt_exception::pmt_exception(const std::string &msg, pmt_t obj)
70 : logic_error(msg + ": " + pmt_write_string(obj))
74 pmt_wrong_type::pmt_wrong_type(const std::string &msg, pmt_t obj)
75 : pmt_exception(msg + ": wrong_type ", obj)
79 pmt_out_of_range::pmt_out_of_range(const std::string &msg, pmt_t obj)
80 : pmt_exception(msg + ": out of range ", obj)
84 pmt_notimplemented::pmt_notimplemented(const std::string &msg, pmt_t obj)
85 : pmt_exception(msg + ": notimplemented ", obj)
89 ////////////////////////////////////////////////////////////////////////////
91 ////////////////////////////////////////////////////////////////////////////
96 return dynamic_cast<pmt_symbol*>(x.get());
102 return dynamic_cast<pmt_integer*>(x.get());
108 return dynamic_cast<pmt_real*>(x.get());
114 return dynamic_cast<pmt_complex*>(x.get());
120 return dynamic_cast<pmt_pair*>(x.get());
126 return dynamic_cast<pmt_vector*>(x.get());
132 return dynamic_cast<pmt_tuple*>(x.get());
135 static pmt_uniform_vector *
136 _uniform_vector(pmt_t x)
138 return dynamic_cast<pmt_uniform_vector*>(x.get());
144 return dynamic_cast<pmt_dict*>(x.get());
150 return dynamic_cast<pmt_any*>(x.get());
153 ////////////////////////////////////////////////////////////////////////////
155 ////////////////////////////////////////////////////////////////////////////
157 const pmt_t PMT_T = pmt_t(new pmt_bool()); // singleton
158 const pmt_t PMT_F = pmt_t(new pmt_bool()); // singleton
159 const pmt_t PMT_NIL = pmt_t(new pmt_null()); // singleton
160 const pmt_t PMT_EOF = pmt_cons(PMT_NIL, PMT_NIL); // singleton
162 ////////////////////////////////////////////////////////////////////////////
164 ////////////////////////////////////////////////////////////////////////////
166 pmt_bool::pmt_bool(){}
169 pmt_is_true(pmt_t obj)
175 pmt_is_false(pmt_t obj)
181 pmt_is_bool(pmt_t obj)
183 return obj->is_bool();
187 pmt_from_bool(bool val)
189 return val ? PMT_T : PMT_F;
193 pmt_to_bool(pmt_t val)
199 throw pmt_wrong_type("pmt_to_bool", val);
202 ////////////////////////////////////////////////////////////////////////////
204 ////////////////////////////////////////////////////////////////////////////
206 static const unsigned int SYMBOL_HASH_TABLE_SIZE = 701;
207 static std::vector<pmt_t> s_symbol_hash_table(SYMBOL_HASH_TABLE_SIZE);
209 pmt_symbol::pmt_symbol(const std::string &name) : d_name(name){}
213 hash_string(const std::string &s)
218 for (std::string::const_iterator p = s.begin(); p != s.end(); ++p){
219 h = (h << 4) + (*p & 0xff);
230 pmt_is_symbol(const pmt_t& obj)
232 return obj->is_symbol();
236 pmt_string_to_symbol(const std::string &name)
238 unsigned hash = hash_string(name) % SYMBOL_HASH_TABLE_SIZE;
240 // Does a symbol with this name already exist?
241 for (pmt_t sym = s_symbol_hash_table[hash]; sym; sym = _symbol(sym)->next()){
242 if (name == _symbol(sym)->name())
243 return sym; // Yes. Return it
246 // Nope. Make a new one.
247 pmt_t sym = pmt_t(new pmt_symbol(name));
248 _symbol(sym)->set_next(s_symbol_hash_table[hash]);
249 s_symbol_hash_table[hash] = sym;
255 pmt_intern(const std::string &name)
257 return pmt_string_to_symbol(name);
261 pmt_symbol_to_string(const pmt_t& sym)
263 if (!sym->is_symbol())
264 throw pmt_wrong_type("pmt_symbol_to_string", sym);
266 return _symbol(sym)->name();
271 ////////////////////////////////////////////////////////////////////////////
273 ////////////////////////////////////////////////////////////////////////////
276 pmt_is_number(pmt_t x)
278 return x->is_number();
281 ////////////////////////////////////////////////////////////////////////////
283 ////////////////////////////////////////////////////////////////////////////
285 pmt_integer::pmt_integer(long value) : d_value(value) {}
288 pmt_is_integer(pmt_t x)
290 return x->is_integer();
295 pmt_from_long(long x)
297 return pmt_t(new pmt_integer(x));
303 pmt_integer* i = dynamic_cast<pmt_integer*>(x.get());
307 throw pmt_wrong_type("pmt_to_long", x);
310 ////////////////////////////////////////////////////////////////////////////
312 ////////////////////////////////////////////////////////////////////////////
314 pmt_real::pmt_real(double value) : d_value(value) {}
323 pmt_from_double(double x)
325 return pmt_t(new pmt_real(x));
329 pmt_to_double(pmt_t x)
332 return _real(x)->value();
334 return _integer(x)->value();
336 throw pmt_wrong_type("pmt_to_double", x);
339 ////////////////////////////////////////////////////////////////////////////
341 ////////////////////////////////////////////////////////////////////////////
343 pmt_complex::pmt_complex(std::complex<double> value) : d_value(value) {}
346 pmt_is_complex(pmt_t x)
348 return x->is_complex();
352 pmt_make_rectangular(double re, double im)
354 return pmt_t(new pmt_complex(std::complex<double>(re, im)));
358 pmt_to_complex(pmt_t x)
361 return _complex(x)->value();
363 return _real(x)->value();
365 return _integer(x)->value();
367 throw pmt_wrong_type("pmt_to_complex", x);
370 ////////////////////////////////////////////////////////////////////////////
372 ////////////////////////////////////////////////////////////////////////////
374 pmt_null::pmt_null() {}
375 pmt_pair::pmt_pair(const pmt_t& car, const pmt_t& cdr) : d_car(car), d_cdr(cdr) {}
378 pmt_is_null(const pmt_t& x)
384 pmt_is_pair(const pmt_t& obj)
386 return obj->is_pair();
390 pmt_cons(const pmt_t& x, const pmt_t& y)
392 return pmt_t(new pmt_pair(x, y));
396 pmt_car(const pmt_t& pair)
398 pmt_pair* p = dynamic_cast<pmt_pair*>(pair.get());
402 throw pmt_wrong_type("pmt_car", pair);
406 pmt_cdr(const pmt_t& pair)
408 pmt_pair* p = dynamic_cast<pmt_pair*>(pair.get());
412 throw pmt_wrong_type("pmt_cdr", pair);
416 pmt_set_car(pmt_t pair, pmt_t obj)
419 _pair(pair)->set_car(obj);
421 throw pmt_wrong_type("pmt_set_car", pair);
425 pmt_set_cdr(pmt_t pair, pmt_t obj)
428 _pair(pair)->set_cdr(obj);
430 throw pmt_wrong_type("pmt_set_cdr", pair);
433 ////////////////////////////////////////////////////////////////////////////
435 ////////////////////////////////////////////////////////////////////////////
437 pmt_vector::pmt_vector(size_t len, pmt_t fill)
440 for (size_t i = 0; i < len; i++)
445 pmt_vector::ref(size_t k) const
448 throw pmt_out_of_range("pmt_vector_ref", pmt_from_long(k));
453 pmt_vector::set(size_t k, pmt_t obj)
456 throw pmt_out_of_range("pmt_vector_set", pmt_from_long(k));
461 pmt_vector::fill(pmt_t obj)
463 for (size_t i = 0; i < length(); i++)
468 pmt_is_vector(pmt_t obj)
470 return obj->is_vector();
474 pmt_make_vector(size_t k, pmt_t fill)
476 return pmt_t(new pmt_vector(k, fill));
480 pmt_vector_ref(pmt_t vector, size_t k)
482 if (!vector->is_vector())
483 throw pmt_wrong_type("pmt_vector_ref", vector);
484 return _vector(vector)->ref(k);
488 pmt_vector_set(pmt_t vector, size_t k, pmt_t obj)
490 if (!vector->is_vector())
491 throw pmt_wrong_type("pmt_vector_set", vector);
492 _vector(vector)->set(k, obj);
496 pmt_vector_fill(pmt_t vector, pmt_t obj)
498 if (!vector->is_vector())
499 throw pmt_wrong_type("pmt_vector_set", vector);
500 _vector(vector)->fill(obj);
503 ////////////////////////////////////////////////////////////////////////////
505 ////////////////////////////////////////////////////////////////////////////
507 pmt_tuple::pmt_tuple(size_t len)
513 pmt_tuple::ref(size_t k) const
516 throw pmt_out_of_range("pmt_tuple_ref", pmt_from_long(k));
521 pmt_is_tuple(pmt_t obj)
523 return obj->is_tuple();
527 pmt_tuple_ref(const pmt_t &tuple, size_t k)
529 if (!tuple->is_tuple())
530 throw pmt_wrong_type("pmt_tuple_ref", tuple);
531 return _tuple(tuple)->ref(k);
534 // for (i=0; i < 10; i++)
535 // make_constructor()
540 return pmt_t(new pmt_tuple(0));
544 pmt_make_tuple(const pmt_t &e0)
546 pmt_tuple *t = new pmt_tuple(1);
552 pmt_make_tuple(const pmt_t &e0, const pmt_t &e1)
554 pmt_tuple *t = new pmt_tuple(2);
561 pmt_make_tuple(const pmt_t &e0, const pmt_t &e1, const pmt_t &e2)
563 pmt_tuple *t = new pmt_tuple(3);
571 pmt_make_tuple(const pmt_t &e0, const pmt_t &e1, const pmt_t &e2, const pmt_t &e3)
573 pmt_tuple *t = new pmt_tuple(4);
582 pmt_make_tuple(const pmt_t &e0, const pmt_t &e1, const pmt_t &e2, const pmt_t &e3, const pmt_t &e4)
584 pmt_tuple *t = new pmt_tuple(5);
594 pmt_make_tuple(const pmt_t &e0, const pmt_t &e1, const pmt_t &e2, const pmt_t &e3, const pmt_t &e4, const pmt_t &e5)
596 pmt_tuple *t = new pmt_tuple(6);
607 pmt_make_tuple(const pmt_t &e0, const pmt_t &e1, const pmt_t &e2, const pmt_t &e3, const pmt_t &e4, const pmt_t &e5, const pmt_t &e6)
609 pmt_tuple *t = new pmt_tuple(7);
621 pmt_make_tuple(const pmt_t &e0, const pmt_t &e1, const pmt_t &e2, const pmt_t &e3, const pmt_t &e4, const pmt_t &e5, const pmt_t &e6, const pmt_t &e7)
623 pmt_tuple *t = new pmt_tuple(8);
636 pmt_make_tuple(const pmt_t &e0, const pmt_t &e1, const pmt_t &e2, const pmt_t &e3, const pmt_t &e4, const pmt_t &e5, const pmt_t &e6, const pmt_t &e7, const pmt_t &e8)
638 pmt_tuple *t = new pmt_tuple(9);
652 pmt_make_tuple(const pmt_t &e0, const pmt_t &e1, const pmt_t &e2, const pmt_t &e3, const pmt_t &e4, const pmt_t &e5, const pmt_t &e6, const pmt_t &e7, const pmt_t &e8, const pmt_t &e9)
654 pmt_tuple *t = new pmt_tuple(10);
669 pmt_to_tuple(const pmt_t &x)
671 if (x->is_tuple()) // already one
674 size_t len = pmt_length(x);
675 pmt_tuple *t = new pmt_tuple(len);
678 for (size_t i = 0; i < len; i++)
679 t->_set(i, _vector(x)->ref(i));
685 for (size_t i = 0; i < len; i++){
686 t->_set(i, pmt_car(y));
692 throw pmt_wrong_type("pmt_to_tuple", x);
697 ////////////////////////////////////////////////////////////////////////////
698 // Uniform Numeric Vectors
699 ////////////////////////////////////////////////////////////////////////////
702 pmt_is_uniform_vector(pmt_t x)
704 return x->is_uniform_vector();
708 pmt_uniform_vector_elements(pmt_t vector, size_t &len)
710 if (!vector->is_uniform_vector())
711 throw pmt_wrong_type("pmt_uniform_vector_elements", vector);
712 return _uniform_vector(vector)->uniform_elements(len);
716 pmt_uniform_vector_writable_elements(pmt_t vector, size_t &len)
718 if (!vector->is_uniform_vector())
719 throw pmt_wrong_type("pmt_uniform_vector_writable_elements", vector);
720 return _uniform_vector(vector)->uniform_writable_elements(len);
723 ////////////////////////////////////////////////////////////////////////////
725 ////////////////////////////////////////////////////////////////////////////
733 pmt_dict::set(pmt_t key, pmt_t value)
735 pmt_t p = pmt_assv(key, d_alist); // look for (key . value) pair
736 if (pmt_is_pair(p)){ // found existing pair...
737 pmt_set_cdr(p, value); // overrwrite cdr with new value
739 else { // not in the dict
740 d_alist = pmt_cons(pmt_cons(key, value), d_alist); // add new (key . value) pair
745 pmt_dict::ref(pmt_t key, pmt_t not_found) const
747 pmt_t p = pmt_assv(key, d_alist); // look for (key . value) pair
755 pmt_dict::has_key(pmt_t key) const
757 return pmt_is_pair(pmt_assv(key, d_alist));
761 pmt_dict::items() const
767 pmt_dict::keys() const
769 return pmt_map(pmt_car, d_alist);
773 pmt_dict::values() const
775 return pmt_map(pmt_cdr, d_alist);
779 pmt_is_dict(pmt_t obj)
781 return obj->is_dict();
787 return pmt_t(new pmt_dict());
791 pmt_dict_set(pmt_t dict, pmt_t key, pmt_t value)
793 pmt_dict* d = _dict(dict);
795 throw pmt_wrong_type("pmt_dict_set", dict);
801 pmt_dict_has_key(pmt_t dict, pmt_t key)
803 pmt_dict* d = _dict(dict);
805 throw pmt_wrong_type("pmt_dict_has_key", dict);
807 return d->has_key(key);
811 pmt_dict_ref(pmt_t dict, pmt_t key, pmt_t not_found)
813 pmt_dict* d = _dict(dict);
815 throw pmt_wrong_type("pmt_dict_ref", dict);
817 return d->ref(key, not_found);
821 pmt_dict_items(pmt_t dict)
823 if (!dict->is_dict())
824 throw pmt_wrong_type("pmt_dict_items", dict);
826 return _dict(dict)->items();
830 pmt_dict_keys(pmt_t dict)
832 if (!dict->is_dict())
833 throw pmt_wrong_type("pmt_dict_keys", dict);
835 return _dict(dict)->keys();
839 pmt_dict_values(pmt_t dict)
841 if (!dict->is_dict())
842 throw pmt_wrong_type("pmt_dict_values", dict);
844 return _dict(dict)->values();
847 ////////////////////////////////////////////////////////////////////////////
849 ////////////////////////////////////////////////////////////////////////////
851 pmt_any::pmt_any(const boost::any &any) : d_any(any) {}
854 pmt_is_any(pmt_t obj)
856 return obj->is_any();
860 pmt_make_any(const boost::any &any)
862 return pmt_t(new pmt_any(any));
866 pmt_any_ref(pmt_t obj)
869 throw pmt_wrong_type("pmt_any_ref", obj);
870 return _any(obj)->ref();
874 pmt_any_set(pmt_t obj, const boost::any &any)
877 throw pmt_wrong_type("pmt_any_set", obj);
881 ////////////////////////////////////////////////////////////////////////////
883 ////////////////////////////////////////////////////////////////////////////
886 pmt_eq(const pmt_t& x, const pmt_t& y)
892 pmt_eqv(const pmt_t& x, const pmt_t& y)
897 if (x->is_integer() && y->is_integer())
898 return _integer(x)->value() == _integer(y)->value();
900 if (x->is_real() && y->is_real())
901 return _real(x)->value() == _real(y)->value();
903 if (x->is_complex() && y->is_complex())
904 return _complex(x)->value() == _complex(y)->value();
910 pmt_equal(const pmt_t& x, const pmt_t& y)
915 if (x->is_pair() && y->is_pair())
916 return pmt_equal(pmt_car(x), pmt_car(y)) && pmt_equal(pmt_cdr(x), pmt_cdr(y));
918 if (x->is_vector() && y->is_vector()){
919 pmt_vector *xv = _vector(x);
920 pmt_vector *yv = _vector(y);
921 if (xv->length() != yv->length())
924 for (unsigned i = 0; i < xv->length(); i++)
925 if (!pmt_equal(xv->_ref(i), yv->_ref(i)))
931 if (x->is_uniform_vector() && y->is_uniform_vector()){
932 pmt_uniform_vector *xv = _uniform_vector(x);
933 pmt_uniform_vector *yv = _uniform_vector(y);
934 if (xv->length() != yv->length())
938 if (memcmp(xv->uniform_elements(len_x),
939 yv->uniform_elements(len_y),
946 // FIXME add other cases here...
952 pmt_length(const pmt_t& x)
955 return _vector(x)->length();
957 if (x->is_uniform_vector())
958 return _uniform_vector(x)->length();
961 return _tuple(x)->length();
968 pmt_t it = pmt_cdr(x);
969 while (pmt_is_pair(it)){
977 throw pmt_wrong_type("pmt_length", x);
980 // FIXME dictionary length (number of entries)
982 throw pmt_wrong_type("pmt_length", x);
986 pmt_assq(pmt_t obj, pmt_t alist)
988 while (pmt_is_pair(alist)){
989 pmt_t p = pmt_car(alist);
990 if (!pmt_is_pair(p)) // malformed alist
993 if (pmt_eq(obj, pmt_car(p)))
996 alist = pmt_cdr(alist);
1002 pmt_assv(pmt_t obj, pmt_t alist)
1004 while (pmt_is_pair(alist)){
1005 pmt_t p = pmt_car(alist);
1006 if (!pmt_is_pair(p)) // malformed alist
1009 if (pmt_eqv(obj, pmt_car(p)))
1012 alist = pmt_cdr(alist);
1018 pmt_assoc(pmt_t obj, pmt_t alist)
1020 while (pmt_is_pair(alist)){
1021 pmt_t p = pmt_car(alist);
1022 if (!pmt_is_pair(p)) // malformed alist
1025 if (pmt_equal(obj, pmt_car(p)))
1028 alist = pmt_cdr(alist);
1034 pmt_map(pmt_t proc(const pmt_t&), pmt_t list)
1038 while(pmt_is_pair(list)){
1039 r = pmt_cons(proc(pmt_car(list)), r);
1040 list = pmt_cdr(list);
1043 return pmt_reverse_x(r);
1047 pmt_reverse(pmt_t listx)
1052 while(pmt_is_pair(list)){
1053 r = pmt_cons(pmt_car(list), r);
1054 list = pmt_cdr(list);
1056 if (pmt_is_null(list))
1059 throw pmt_wrong_type("pmt_reverse", listx);
1063 pmt_reverse_x(pmt_t list)
1065 // FIXME do it destructively
1066 return pmt_reverse(list);
1070 pmt_nth(size_t n, pmt_t list)
1072 pmt_t t = pmt_nthcdr(n, list);
1080 pmt_nthcdr(size_t n, pmt_t list)
1082 if (!(pmt_is_pair(list) || pmt_is_null(list)))
1083 throw pmt_wrong_type("pmt_nthcdr", list);
1086 if (pmt_is_pair(list)){
1087 list = pmt_cdr(list);
1091 if (pmt_is_null(list))
1094 throw pmt_wrong_type("pmt_nthcdr: not a LIST", list);
1100 pmt_memq(pmt_t obj, pmt_t list)
1102 while (pmt_is_pair(list)){
1103 if (pmt_eq(obj, pmt_car(list)))
1105 list = pmt_cdr(list);
1111 pmt_memv(pmt_t obj, pmt_t list)
1113 while (pmt_is_pair(list)){
1114 if (pmt_eqv(obj, pmt_car(list)))
1116 list = pmt_cdr(list);
1122 pmt_member(pmt_t obj, pmt_t list)
1124 while (pmt_is_pair(list)){
1125 if (pmt_equal(obj, pmt_car(list)))
1127 list = pmt_cdr(list);
1133 pmt_subsetp(pmt_t list1, pmt_t list2)
1135 while (pmt_is_pair(list1)){
1136 pmt_t p = pmt_car(list1);
1137 if (pmt_is_false(pmt_memv(p, list2)))
1139 list1 = pmt_cdr(list1);
1145 pmt_list1(const pmt_t& x1)
1147 return pmt_cons(x1, PMT_NIL);
1151 pmt_list2(const pmt_t& x1, const pmt_t& x2)
1153 return pmt_cons(x1, pmt_cons(x2, PMT_NIL));
1157 pmt_list3(const pmt_t& x1, const pmt_t& x2, const pmt_t& x3)
1159 return pmt_cons(x1, pmt_cons(x2, pmt_cons(x3, PMT_NIL)));
1163 pmt_list4(const pmt_t& x1, const pmt_t& x2, const pmt_t& x3, const pmt_t& x4)
1165 return pmt_cons(x1, pmt_cons(x2, pmt_cons(x3, pmt_cons(x4, PMT_NIL))));
1169 pmt_list5(const pmt_t& x1, const pmt_t& x2, const pmt_t& x3, const pmt_t& x4, const pmt_t& x5)
1171 return pmt_cons(x1, pmt_cons(x2, pmt_cons(x3, pmt_cons(x4, pmt_cons(x5, PMT_NIL)))));
1175 pmt_list6(const pmt_t& x1, const pmt_t& x2, const pmt_t& x3, const pmt_t& x4, const pmt_t& x5, const pmt_t& x6)
1177 return pmt_cons(x1, pmt_cons(x2, pmt_cons(x3, pmt_cons(x4, pmt_cons(x5, pmt_cons(x6, PMT_NIL))))));
1181 pmt_list_add(pmt_t list, const pmt_t& item)
1183 return pmt_reverse(pmt_cons(item, pmt_reverse(list)));
1187 pmt_caar(pmt_t pair)
1189 return (pmt_car(pmt_car(pair)));
1193 pmt_cadr(pmt_t pair)
1195 return pmt_car(pmt_cdr(pair));
1199 pmt_cdar(pmt_t pair)
1201 return pmt_cdr(pmt_car(pair));
1205 pmt_cddr(pmt_t pair)
1207 return pmt_cdr(pmt_cdr(pair));
1211 pmt_caddr(pmt_t pair)
1213 return pmt_car(pmt_cdr(pmt_cdr(pair)));
1217 pmt_cadddr(pmt_t pair)
1219 return pmt_car(pmt_cdr(pmt_cdr(pmt_cdr(pair))));
1223 pmt_is_eof_object(pmt_t obj)
1225 return pmt_eq(obj, PMT_EOF);
1231 printf("sizeof(pmt_t) = %3zd\n", sizeof(pmt_t));
1232 printf("sizeof(pmt_base) = %3zd\n", sizeof(pmt_base));
1233 printf("sizeof(pmt_bool) = %3zd\n", sizeof(pmt_bool));
1234 printf("sizeof(pmt_symbol) = %3zd\n", sizeof(pmt_symbol));
1235 printf("sizeof(pmt_integer) = %3zd\n", sizeof(pmt_integer));
1236 printf("sizeof(pmt_real) = %3zd\n", sizeof(pmt_real));
1237 printf("sizeof(pmt_complex) = %3zd\n", sizeof(pmt_complex));
1238 printf("sizeof(pmt_null) = %3zd\n", sizeof(pmt_null));
1239 printf("sizeof(pmt_pair) = %3zd\n", sizeof(pmt_pair));
1240 printf("sizeof(pmt_vector) = %3zd\n", sizeof(pmt_vector));
1241 printf("sizeof(pmt_dict) = %3zd\n", sizeof(pmt_dict));
1242 printf("sizeof(pmt_uniform_vector) = %3zd\n", sizeof(pmt_uniform_vector));
1245 } /* namespace pmt */