ruby杂记

来源:互联网 发布:xml json 转换 c 编辑:程序博客网 时间:2024/05/15 04:29

1:ruby中的  * 代表可变形参   和  乘   

2:lambada   block   proc= Proc.new      proc就像一段代码  加入return语句的话会立即执行那个返回  二lambda会返回到自身 程序会自动运行

3:hash

      hash= {1 => 3, "2" => 2 ,  3 = > 3}

     hash["2"]  hash[1]

 

原创粉丝点击