···214214 var lowRaw = raw.ToLower;
215215 var funcId = nextFuncId; //<-- get the first unique function id
216216 var cmd = "r"; //<-- assume execution of code
217217+ var printPrefix = null; //<-- text to print before running the user input (if non-null)
217218218219 if(lowRaw == ":r" or lowRaw == ":reload") //this directive restarts prx\main with the same arguments. See 'prx_main.pxs' for details.
219220 {
···282283 else
283284 {
284285 executeStatement:
286286+ var printPrefix = shortened(raw) + " = ";
285287 //First, try to compile the code as an expression
286286- buffer.AppendFormat(" function {0}() does println = \"{1} = \" + ( \n{2}\n ) ; ",
287287- [funcId, shortened(raw).Escape, raw]~Object<"System.Object[]">);
288288+ buffer.AppendFormat(" function {0}() = (\n{1}\n); ",
289289+ [funcId, raw]~Object<"System.Object[]">);
288290 if(Not tryLoad)
289291 {
290292 //should that fail, try to compile the code as a statement
···294296 funcId = nextFuncId;
295297 buffer.AppendFormat(" function {0}() {{ \n{1}\n ; }} ",
296298 [funcId, raw]~Object<"System.Object[]">);
299299+ printPrefix = null;
297300298301 if(Not tryLoad)
299302 {
···319322 if(cmd == "r")
320323 {
321324 //A function needs to be run
322322- unless(app.Functions[funcId] is Null)
323323- app.Functions[funcId].Run(engine);
325325+ if(printPrefix != null) {
326326+ print(printPrefix);
327327+ }
328328+ if(!app.Functions[funcId] is Null) {
329329+ var result = app.Functions[funcId].Run(engine);
330330+ println(result.self);
331331+ }
324332 }
325333 else if(cmd == "c")
326334 {