Sha256: c691e750164e2315809f2cd331d9264cb66eabd3c0e14d907d1e60be8bb80e39

Contents?: true

Size: 726 Bytes

Versions: 396

Compression:

Stored size: 726 Bytes

Contents

;;; rna-transcription.el -- RNA Transcription (exercism)

;;; Commentary:
;;
;; Example derived pretty directly from xlisp example:
;; https://github.com/exercism/xlisp/blob/master/rna-transcription/example.lisp
;;

;;; Code:

(defun validate-strand (strand)
  "Check to see if RNA STRAND is valid."
  (or (every (lambda (c) (find c "ATCGU")) (coerce strand 'list))
      (signal 'error "Bad strand")))

(defvar dna->rna
  '((?C . ?G) (?G . ?C) (?A . ?U) (?T . ?A)))

(defun to-rna (strand)
  "Convert STRAND of DNA to RNA."
  (validate-strand strand)
  (concatenate 'string
   (mapcar (lambda (c) (cdr (assoc c dna->rna)))
           (coerce strand 'list))))


(provide 'rna-transcription)
;;; rna-transcription.el ends here

Version data entries

396 entries across 396 versions & 1 rubygems

Version Path
trackler-2.2.1.119 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.118 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.117 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.116 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.115 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.114 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.113 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.111 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.110 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.109 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.108 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.107 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.106 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.105 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.104 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.103 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.102 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.101 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.100 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.99 tracks/elisp/exercises/rna-transcription/example.el