On 01/03/12 15:33, Ludovic Courtès wrote:
Could you point me to the affected code? What would you think of using string-copy as I suggested? The disadvantage is that you need to modify your code, but hopefully that can be automated with a sed script or so; the advantage is that it would work with all versions of Guile.
The disadvantage is that I know I have "clients" that have rolled their own templates, presumably by copy-and-edit processes that will invariably include (define var "string") syntax. Likely a better approach is to re-define the "define" function to my own C code and call the proper scm_whathaveyou functions under the covers. I'm sorry about being irritable. This is the third problem with 2.x. First a pre-defined value disappeared. A very minor nuisance. Then it turned out that the string functions would now clear the high order bit on strings, so they are no longer byte arrays and there is no replacement but to roll my own. I stopped supporting byte arrays. A noticable nuisance. Now it turns out that the conventional, ordinary way of creating a string variable yields a read-only string. Ouch. So I am cranky and sorry about being so. So I guess that's my fix. Write another function dependent upon Guile internals, much like scm_c_eval_string_from_file_line(), by copying scm_define() code, checking for a string value and copying that string -- if it is read-only? Should I check for that? What about "set!"? Should I check for a read-only value there, too? I do confess it feels a little bit like unraveling something.....It is scary.