Why? What property would a let block have that a local function wouldn’t have?
— John On Feb 2, 2014, at 12:06 AM, [email protected] wrote: > > > On Feb 2, 2014, at 14:51, John Myles White <[email protected]> wrote: > >> What are you trying to achieve by using the return inside of your let block? >> Do you want to make the let block behave like a local function? >> >> — John >> >> On Feb 1, 2014, at 11:24 PM, Brian Nguyen <[email protected]> wrote: >> >>> julia> let x=1; for i=1:37; x=2*x; end; return x; end >>> 137438953472 >>> >>> julia> y = let x=1; for i=1:37; x=2*x; end; x; end >>> 137438953472 >>> >>> julia> y = let x=1; for i=1:37; x=2*x; end; return x; end >>> ERROR: syntax: misplaced return statement >>> How to make let statements with return work inside other expressions? >> > Yes. I want to use a let block like a function.
