1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-04-30 15:49:41 +02:00

Add a couple of helpers for parsing string

Provides a convenient function and macro, intended specifically for
parsing strings returned by (aud-do "GetInfo: ...
This commit is contained in:
Steve Daulton 2018-08-26 20:07:47 +01:00
parent 70467e1523
commit 367d15a0b0

View File

@ -43,3 +43,15 @@
(if translated
translated
(funcall underscore txt)))
;;; A couple of helpers for parsing strings returned by (aud-do "GetInfo: ...
(defun eval-string (string)
;;; Evaluate a string as a LISP expression.
;;; If 'string' is not a valid LISP expression, the behaviour is undefined.
(eval (read (make-string-input-stream string))))
(defmacro quote-string (string)
;;; Prepend a single quote to a string
`(setf ,string (format nil "\'~a" ,string)))