You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
typesetting/csp/variable.rkt

17 lines
547 B
Racket

10 years ago
#lang racket/base
(require racket/class "helper.rkt")
(provide (all-defined-out))
10 years ago
(define variable%
10 years ago
(class* object% (printable<%>)
(super-new)
10 years ago
(define (repr) (format "<variable% ~a>" _name))
10 years ago
(define/public (custom-print out quoting-depth) (print (repr) out))
(define/public (custom-display out) (displayln (repr) out))
(define/public (custom-write out) (write (repr) out))
(init-field name)
(field [_name name])))
10 years ago
(define variable%? (is-a?/c variable%))
10 years ago
10 years ago
(define Unassigned (new variable% [name "Unassigned"]))