First we try, then we trust

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2005年9月24日

摘要: 在TechEd2005中学习C# 2.0新特性时看到??运算符,表示从左向右取第一个不为空的值。这让我联想到Ruby中“||=”运算符的使用: session[:cart] ||= Cart.new This method is fairly tricky. It uses Ruby’s conditional assignment operator, ||=. If the session h... 阅读全文
posted @ 2005-09-24 17:42 吕震宇 阅读(1798) 评论(1) 推荐(0) 编辑