MOO-cows Mailing List Archive

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

re: fromliteral()



At 07:10 PM 3/13/96 -0500, Kipp the Kidd wrote:
>At 03:42 PM 3/13/96 PST, slayer@kaiwan.com wrote:
>>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}"
>
>Um, not quite.  Toliteral accepts a value, and returns a string.  Replace
>the whole `toliteral()' bit with the string you want converted to a list.
>
>;$no_one:eval_d("{1,2,3}")[2]
>=> "{1,2,3}"
>
The point was to return the VALUE {1,2,3} from the string "{1,2,3}". that
eval still gives a string "{1,2,3}".




Home | Subject Index | Thread Index