[racket] A little improvement

From: Grant Rettke (grettke at acm.org)
Date: Thu May 10 16:49:26 EDT 2012

Using this to help out with a task at work

#lang racket

(define (fix str)
  (define tmp str)
  (set! tmp (regexp-replace* " / " tmp "_"))
  (set! tmp (regexp-replace* " " tmp "_"))
  (set! tmp (regexp-replace* "%" tmp ""))
  (set! tmp (regexp-replace* "-" tmp "_"))
  (string-upcase tmp))

Is there a better way?

Posted on the users mailing list.