Kho tháng 1/2020
Thứ năm, 30 Tháng 1 năm 2020 20:45:08 ICT
Scheme "restart safe"
From shirok
Oh that's an obscure jargon among some Schemers. Suppose you say
(string-map proc ...)
andproc
captures a continuation. After returningstring-map
, the continuation may be invoked again. The second return ofstring-map
shouldn't alter the first return value. You have to go purely functional, so probably output should be constructed as a list andlist->string
-ed.
And from r7rs spec, the
string-map
section:
If multiple returns occur from string-map, the values returned by earlier returns are not mutated.