value() problem maybe
- Posted by slowmaker Feb 25, 2013
- 1725 views
I think value() may be choking on back ticks.
If the error is mine, could someone please help me find it?
To me, if the value() routine does not choke on debug1 (below), then it should not choke on debug2. It should just evaluate the string objects to new string objects with the following character contents:
""" eval a triple-full-quote string """
` eval a back tick string `
However, only the first one works. As far as I can tell, any simple sequence starting with the back tick will make value() fail.
I have not tried get() yet.
sequence debug1 = `""" eval a triple-full-quote string """ ` sequence debug2 = """` eval a back tick string ` """ integer debug3 = '`' include std/io.e include std/get.e sequence evaluated = value(debug1, 1, GET_LONG_ANSWER) if evaluated[1] = GET_SUCCESS then puts(1, "evaluated okay this time! Heres what it evaluated to:\n") printf(1,"%s\n",{debug1}) else printf(1,"DID NOT EVAL SUCCESSFULLY! Only got %d characters when evaluating this:\n%s\n",{evaluated[3], debug1}) end if puts(1,"\n") evaluated = value(debug2, 1, GET_LONG_ANSWER) if evaluated[1] = GET_SUCCESS then puts(1, "evaluated okay this time! Heres what it evaluated to:\n") printf(1,"%s\n",{debug2}) else printf(1,"DID NOT EVAL SUCCESSFULLY! Only got %d characters when evaluating this:\n%s\n",{evaluated[3], debug2}) end if puts(1,"\n") evaluated = value({debug3}, 1, GET_LONG_ANSWER) if evaluated[1] = GET_SUCCESS then puts(1, "evaluated okay this time! Heres what it evaluated to:\n") printf(1,"%s\n",{debug3}) else printf(1,"DID NOT EVAL SUCCESSFULLY! Only got %d characters when evaluating this:\n%s\n",{evaluated[3], debug3}) end if puts(1,"\n")