lang/nil-macros.ss
(module nil-macros mzscheme
  (require (file "constants.ss"))
  (provide (all-defined))
  
  (define (acl2:not x)
    (if (null? x) t nil))
  
  (define-syntax (not-nil stx)
    (syntax-case stx (acl2:not t nil)
      [(_ (acl2:not test)) #'(null? test)]
      [(_ t) #'#t]
      [(_ nil) #'#f]
      [(_ x) #'(not (null? x))]))
  
  (define-syntax (nil? stx)
    (syntax-case stx (t nil)
      [(_ t) #'#f]
      [(_ nil) #'#t]
      [(_ x) #'(null? x)]))
  
  )