#lang scheme/base
(require srfi/13
"base.ss"
"convert.ss"
"number.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-length sym)
(string-length (symbol->string sym)))
(define (symbol-upcase sym)
(string->symbol (string-upcase (symbol->string sym))))
(define (symbol-downcase sym)
(string->symbol (string-downcase (symbol->string sym))))
(provide symbol->number
number->symbol
symbol+false->string+false
string+false->symbol+false
symbol+false->number+false
number+false->symbol+false)
(provide/contract
[symbol+false? procedure?]
[gensym/interned (->* () ((or/c symbol? string?)) symbol?)]
[symbol-append (->* () () #:rest (listof symbol?) symbol?)]
[symbol-length (-> symbol? natural?)]
[symbol-upcase (-> symbol? symbol?)]
[symbol-downcase (-> symbol? symbol?)])