mirror of
https://github.com/cookiengineer/audacity
synced 2025-04-30 07:39:42 +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:
parent
70467e1523
commit
367d15a0b0
@ -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)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user