Login  Register

Block explicit return

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Block explicit return

blake watson
151 posts
Page 55

"The block answers the value of the last expression in its body,
unless there is an explicit return (with ↑), in which case it does not answer
any value."

"...in which case it answers with the expression following the ↑, as usual."

[3 + 4] value -> 7
[3 + 4. ^5] value ->5

_______________________________________________
Sbe-discussion mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/sbe-discussion
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Block explicit return

Marcus Denker-4
7582 posts

On Sep 14, 2013, at 2:05 AM, blake <[hidden email]> wrote:

> Page 55
>
> "The block answers the value of the last expression in its body,
> unless there is an explicit return (with ↑), in which case it does not answer
> any value."
>
> "...in which case it answers with the expression following the ↑, as usual."
>
> [3 + 4] value -> 7
> [3 + 4. ^5] value ->5
No, the ^ returns from the *method* that the block is defined in.

        Marcus


_______________________________________________
Sbe-discussion mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/sbe-discussion

signature.asc (210 bytes) Download Attachment