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.180 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.179 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.178 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.177 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.176 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.175 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.174 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.173 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.172 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.171 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.170 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.169 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.167 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.166 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.165 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.164 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.163 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.162 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.161 tracks/elisp/exercises/rna-transcription/example.el
trackler-2.2.1.160 tracks/elisp/exercises/rna-transcription/example.el