|
SketchyLISP Reference |
Copyright (C) 2007 Nils M Holm |
| <<[id] | [Index] | [if]>> |
Conformance: SketchyLISP Extension
Purpose: Implode a list of symbols into a symbol.
Arguments:
X - list of single-character symbols
Implementation:
(define (implode x)
(letrec
((sym->char
(lambda (x)
(let ((str (symbol->string x)))
(cond ((not (= (string-length str) 1))
(bottom '(bad symbol in implode)))
(else (string-ref str 0)))))))
(string->symbol
(list->string (map sym->char x)))))
Example:
(implode '(h e l l o)) => hello
See also:
explode.
| <<[id] | [Index] | [if]>> |