Delimiting Blocks
来源:互联网 发布:淘宝开童装店的坑 编辑:程序博客网 时间:2024/04/29 09:54
Blocks can start with a do and end with end, or they can start
with { and end with }. The following two snippets of code mean
the same thing:
array.each do | element |
puts element
end
array.each { | element |
puts element
}
My sense is that Rubyists prefer the first except for short
blocks, especially those that can fit on one line:
array.each { | element | puts element }
In this book, I’ll use the first form almost exclusively.
with { and end with }. The following two snippets of code mean
the same thing:
array.each do | element |
puts element
end
array.each { | element |
puts element
}
My sense is that Rubyists prefer the first except for short
blocks, especially those that can fit on one line:
array.each { | element | puts element }
In this book, I’ll use the first form almost exclusively.
- Delimiting Blocks
- blocks
- Blocks
- Blocks
- Blocks
- Blocks
- Blocks
- Blocks
- Blocks
- 15.2 Blocks
- Code::Blocks
- Code::Blocks
- poj2363-blocks
- blocks学习
- blocks 学习
- Code::Blocks
- IOS Blocks
- Code::Blocks
- python for s60 之音频播放 (2)
- 使用TCP协议的NAT穿透技术(转)
- 一段男孩与女孩的对话
- 动态内存分配
- 使用TCP协议的NAT穿透技术-原理及实现(附 VB.NET实现源码)
- Delimiting Blocks
- H.264笔记之一
- 在网页里面设定字体大小
- 华中科技大学大牛的讲座
- 无题
- WIN32汇编的一些基础知识
- 一年后的今天
- 跟我学XSL(二) -XSL的运算符
- “赞助开源项目跟踪”无奈的外包——CSDN外包实践(63)