MOO-cows Mailing List Archive

[Prev][Next][Index][Thread]

re: fromliteral()



At 07:10 AM 3/13/96 PST, ThwartedEfforts wrote:
>At 12:11 AM 3/13/96 PST, you wrote:
>>And finally, for completeness sake I suggest a tovalue() or fromliteral()
>>builtin.  If this is non-trivial I'm willing to wait for someone else to
>>do this or perhaps attempt it myself, but if not I'd be nice to see it
>>in 1.8.0.
>
>Dude, it's called eval(), and it works just fine:
>
>;$no_one:eval_d(toliteral(xxx))[2] == xxx
>
>Andy.
>
I tried that and got this:
;$no_one:eval_d(toliteral("{1,2,3}"))[2]
=> "{1,2,3}"

I tried that on a couple of other MOOs ranging from 1.7.9p2 to 1.8.0p1 and
got the same thing. Apparently that eval just gives whatever you put in it,
so you might as well just ;xxx. What he wanted was something like
$string_utils:to_value, which was the opposite of toliteral(); you could put
a string representing a value and get that value.

>
>




Home | Subject Index | Thread Index