---
title: "ruby杂记"
author: "yangbinfc"
date: "2011-02-15T10:46:00Z"
tags: []
slug: "ruby"
draft: false
lastmod: "2012-11-04T17:47:57Z"
id: 1715375
url: "https://yangbinfc.iteye.com/blog/1715375"
---

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

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

3:hash

hash= {1 =&gt; 3, "2" =&gt; 2 , 3 = &gt; 3}

hash\["2"] hash\[1]