(make-tag symbol info ...) -> #f
Constructs a new tag, which are user-definable types that are disjoint from MOSVM's primitive types and each other. Used internally by define-record-type and define-class with cell to create new record types and encapsulate the vectors backing the record.
;; This is a more primitive version of the <point> example from define-record. (define <point> (make-tag 'point )) (define (make-point x y) (cell <point> (cons x y))) (define (point-x pt) (car (repr pt))) (define (point-y pt) (cdr (repr pt)))
>> (load "examples/point2.ms") >> (define p (make-point 111 222)) >> (repr p) :: (111 . 222) >> (point-x p) :: 111 >> (point-y p) :: 222 >> (type p) :: <pair>