[plt-scheme] evaluating contents of a string
Chris Warrington wrote:
>David Richards @ 2006-7-25 10:46:15 PM
>"[plt-scheme] evaluating contents of a string" <mid:ac01fb5e725b12548648a10157eeb98d at verizon.net>
>
>
>>Given:
>>"(lambda () (current-seconds))"
>>What is the 'best practice', or most elegant way to obtain a scheme
>>procedure from the contents of a string?
>>
>>
>
>I'd use:
>(eval (read (open-input-string "(lambda () (current-seconds))")))
>
>
If you are allowing yourself to import modules you could also use
(eval-string ...) from "string.ss".