pmt
Polymorphic Types.
The type can really be used to store anything, but also has simple
conversion methods for common data types such as bool, long, or a
vector.
The polymorphic type simplifies message passing between blocks, as all
of the data is of the same type, including the message. Tags also use
PMTs as data type, so a stream tag can be of any logical data type. In
a sense, PMTs are a way to extend C++’ strict typing with something
more flexible.
The PMT library supports the following major types:
bool, symbol (string), integer, real, complex, null, pair, list,
vector, dict, uniform_vector, any (boost::any cast)
Boolean
pmt.is_bool |
Return true if obj is #t or #f, else return false. |
pmt.is_true |
Return false if obj is #f, else return true. |
pmt.is_false |
Return true if obj is #f, else return true. |
pmt.from_bool |
Return #f is val is false, else return #t. |
pmt.to_bool |
Return true if val is pmt::True, return false when val is pmt::PMT_F,. |
Numbers
pmt.is_number |
Return true if obj is any kind of number, else false. |
Complex
pmt.is_complex |
return true if is a complex number, false otherwise. |
pmt.to_complex |
If is complex, real or integer, return the closest complex<double>. |
pmt.from_complex |
Return a complex number constructed of the given real and imaginary parts. |
pmt.make_rectangular |
Return a complex number constructed of the given real and imaginary parts. |
Tuples
pmt.is_tuple |
Return true if is a tuple, othewise false. |
pmt.make_tuple |
make_tuple(swig_int_ptr e0) -> swig_int_ptr |
pmt.tuple_ref |
Return the contents of position of . |
pmt.to_tuple |
If is a vector or proper list, return a tuple containing the elements of x |
General Functions
pmt.eq |
Return true if x and y are the same object; otherwise return false. |
pmt.equal |
pmt::equal recursively compares the contents of pairs and vectors, applying pmt::eqv on other objects such as numbers and symbols. pmt::equal may fail to terminate if its arguments are circular data structures. |
pmt.eqv |
Return true if x and y should normally be regarded as the same object, else false. |
pmt.length |
Return the number of elements in v. |
pmt.assq |
Find the first pair in whose car field is and return that pair. |
pmt.assv |
Find the first pair in whose car field is and return that pair. |
pmt_assoc |
|
Lists
pmt.map |
Apply element-wise to the elements of list and returns a list of the results, in order. |
pmt.reverse |
reverse . |
pmt.reverse_x |
destructively reverse . |
pmt.acons |
(acons x y a) == (cons (cons x y) a) |
pmt.nth |
locates element of |
pmt.nthcdr |
returns the tail of that would be obtained by calling cdr times in succession. |
pmt.memq |
Return the first sublist of whose car is . |
pmt.memv |
Return the first sublist of whose car is . |
pmt.member |
Return the first sublist of whose car is . |
pmt.subsetp |
Return true if every element of appears in , and false otherwise. |
pmt.list1 |
Return a list of length 1 containing . |
pmt.list2 |
Return a list of length 2 containing , . |
pmt.list3 |
Return a list of length 3 containing , , . |
pmt.list4 |
Return a list of length 4 containing , , , . |
pmt.list5 |
Return a list of length 5 containing , , , , . |
pmt.list6 |
Return a list of length 6 containing , , , , , . |
pmt.list_add |
Return with added to it. |
pmt.list_rm |
Return with removed from it. |
pmt.list_has |
Return bool of contains . |
Read/Write
pmt.is_eof_object |
return true if obj is the EOF object, otherwise return false. |
pmt.read |
read converts external representations of pmt objects into the objects themselves. Read returns the next object parsable from the given input port, updating port to point to the first character past the end of the external representation of the object. |
pmt.write |
Write a written representation of to the given . |
pmt.write_string |
Return a string representation of . |
Constants
pmt.PMT_EOF |
Proxy of C++ boost::intrusive_ptr<(pmt::pmt_base)> class |
pmt.PMT_EOF |
Proxy of C++ boost::intrusive_ptr<(pmt::pmt_base)> class |
pmt.PMT_F |
Proxy of C++ boost::intrusive_ptr<(pmt::pmt_base)> class |
pmt.PMT_NIL |
Proxy of C++ boost::intrusive_ptr<(pmt::pmt_base)> class |
pmt.PMT_T |
Proxy of C++ boost::intrusive_ptr<(pmt::pmt_base)> class |