This seems to work:
scala> var my_json : net.liftweb.json.JsonAST.JObject = _
my_json: net.liftweb.json.JsonAST.JObject = null
scala> my_json = ("from_xml" -> "foo_json") ~ ("status" -> "ok")
my_json: net.liftweb.json.JsonAST.JObject =
JObject(List(JField(from_xml,JString(foo_json)),
JField(status,JString(ok))))
scala>
but in general I try to avoid having a var and then assign it based on
logic, this is most of the time a java pattern carried to Scala. I
have found that with some effort, you can always find a way to just
use a val.
If you post your actual code, we may be able to help you use a val,
instead of a var.
Regards,
Diego
> --
> Lift, the simply functional web framework:
http://liftweb.net
> Code:
http://github.com/lift
> Discussion:
http://groups.google.com/group/liftweb
> Stuck? Help us help you:
>
https://www.assembla.com/wiki/show/liftweb/Posting_example_code
--
Diego Medina
Lift/Scala Developer
di...@fmpwizard.com
http://www.fmpwizard.com