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.
17 lines
542 B
Racket
17 lines
542 B
Racket
10 years ago
|
#lang racket/base
|
||
|
(require racket/class "helper.rkt")
|
||
|
(provide (all-defined-out))
|
||
|
|
||
|
(define Variable
|
||
|
(class* object% (printable<%>)
|
||
|
(super-new)
|
||
|
(define (repr) (format "<Variable ~a>" _name))
|
||
|
(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])))
|
||
|
(define Variable? (is-a?/c Variable))
|
||
|
|
||
|
(define Unassigned (new Variable [name "Unassigned"]))
|