Quantcast

Block explicit return

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Block explicit return

blake watson
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
|  
Report Content as Inappropriate

Re: Block explicit return

Marcus Denker-4

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
Loading...