3/19/2006
camel-case-from-underscored
Continuing Marc’s exploration of Lisp, today we present a Scheme function that might be marginally useful:
(define (camel-case-from-underscored underscored-name)
(regexp-substitute/global #f "_"
(string-capitalize underscored-name) 'pre 'post))
Here’s it in action - try to contain your excitement:
$ guile guile> (load "string_stuff.scm") guile> (camel-case-from-underscored "super_cool_button") "SuperCoolButton"
Books on Lisp from Amazon.com
Del.icio.us
Digg
Reddit
Technorati
Possibly related posts
Comments
Leave a reply






Now, for a real challenge: make a function that will convert back and forth between the two formats.