Sha256: b82b8481dc46808741a4e79ed0b53245fcc7f97ad52499149506c2893106651e
Contents?: true
Size: 493 Bytes
Versions: 396
Compression:
Stored size: 493 Bytes
Contents
(define-module (dna) #:export (to-rna)) (define lookup '((#\C . #\G) (#\G . #\C) (#\A . #\U) (#\T . #\A))) ;; Example note: there's no explict guard to satisfy the ;; validation test, but the lookup in to-rna will raise ;; an error if the nucleotide is invalid (i.e., not in ;; the above alist), so the test passes. (define to-rna (lambda (dna) (let ((dna-seq (string->list dna))) (apply string (map (lambda (c) (cdr (assoc c lookup))) dna-seq)))))
Version data entries
396 entries across 396 versions & 1 rubygems