#lang scheme/base
(require scheme/contract
srfi/13/string
(file "base.ss"))
(define (symbol+false? item)
(or (symbol? item) (not item)))
(define (gensym/interned [base "g"])
(string->symbol (symbol->string (gensym base))))
(define (symbol-append . args)
(string->symbol (string-concatenate (map symbol->string args))))
(define (symbol-upcase sym)
(string->symbol (string-upcase (symbol->string sym))))
(define (symbol-downcase sym)
(string->symbol (string-downcase (symbol->string sym))))
(define (number->symbol num)
(string->symbol (number->string num)))
(define (symbol->number sym)
(string->number (symbol->string sym)))
(provide/contract
[symbol+false? procedure?]
[gensym/interned (->* () ((or/c symbol? string?)) symbol?)]
[symbol-append (->* () () #:rest (listof symbol?) symbol?)]
[symbol-upcase (-> symbol? symbol?)]
[symbol-downcase (-> symbol? symbol?)]
[number->symbol (-> number? symbol?)]
[symbol->number (-> symbol? (or/c number? false/c))])