2

Is there anyway to turn off Parenscript's implicit Return?

I'm trying to write the following code:

function () = { dialog.show();};

But Parenscript inserts an implicit return:

(ps (lambda ()
      (chain dialog (show))))

=>

function () = { return dialog.show();};
Rainer Joswig
  • 136,269
  • 10
  • 221
  • 346
momo
  • 1,045
  • 3
  • 9
  • 18

2 Answers2

3

No. (CoffeeScript works the same way, too.) This is a feature, not a bug. Explicitly return undefined if you really care.

C. K. Young
  • 219,335
  • 46
  • 382
  • 435
3

You could use (values):

(ps (lambda ()
      (chain dialog (show))
      (values)))

This should probably return undefined (but it actually returns null). If you really need undefined, you have it:

(ps (lambda ()
      (chain dialog (show))
      undefined))
Samuel Edwin Ward
  • 6,526
  • 3
  • 34
  • 62