On this page:
symbol<?
symbol>?
symbol<=?
symbol>=?
symbol-upcase
symbol-downcase
symbol-titlecase
symbol-foldcase

6.3 mischief/symbol: Symbols

 (require mischief/symbol) package: mischief

This module re-exports symbol=? from racket/bool and format-symbol from racket/syntax.

procedure

(symbol<? x y)  boolean?

  x : symbol?
  y : symbol?

procedure

(symbol>? x y)  boolean?

  x : symbol?
  y : symbol?

procedure

(symbol<=? x y)  boolean?

  x : symbol?
  y : symbol?

procedure

(symbol>=? x y)  boolean?

  x : symbol?
  y : symbol?
Compare two symbols lexicographically, essentially composing symbol->string with string<?, string>?, string<=?, and string>=?.

Examples:
> (symbol<? 'bat 'cat)

#t

> (symbol<? 'cat 'cat)

#f

> (symbol<? 'cat 'bat)

#f

> (symbol>? 'bat 'cat)

#f

> (symbol>? 'cat 'cat)

#f

> (symbol>? 'cat 'bat)

#t

> (symbol<=? 'bat 'cat)

#t

> (symbol<=? 'cat 'cat)

#t

> (symbol<=? 'cat 'bat)

#f

> (symbol>=? 'bat 'cat)

#f

> (symbol>=? 'cat 'cat)

#t

> (symbol>=? 'cat 'bat)

#t

procedure

(symbol-upcase sym)  symbol?

  sym : symbol?

procedure

(symbol-downcase sym)  symbol?

  sym : symbol?

procedure

(symbol-titlecase sym)  symbol?

  sym : symbol?

procedure

(symbol-foldcase sym)  symbol?

  sym : symbol?
Convert the case of a symbol’s name, by analogy with string-upcase, string-downcase, string-titlecase, and string-foldcase.

Examples:
> (symbol-upcase 'Two-words)

'TWO-WORDS

> (symbol-downcase 'Two-words)

'two-words

> (symbol-titlecase 'Two-words)

'Two-Words

> (symbol-foldcase 'Two-words)

'two-words