2008-09-23から1日間の記事一覧

ActiveSupport、Array#extract_options!

>> require "rubygems" => true >> require "active_support" => true >> [1, 2, 3].extract_options! => {} >> [1, 2, 3, {:a => :b}].extract_options! => {:a=>:b} 何?何?

JDK5.0 新機能:一ミリ秒未満のスリープ

「10.5. 一ミリ秒未満のスリープ」 public class C2008092300 { public static void main(String[] args) { System.out.println("start"); try { Thread.sleep(1000); } catch(java.lang.InterruptedException e) { } } } で、 start何が新しいの?

まんま module Main where import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Expr expr :: Parser Integer expr = buildExpressionParser table factor "expression" table = [[op "*" (*) AssocLeft, op "/" div AssocLeft] ,[…

関数呼び出し、引数の数が異なる場合

#!/usr/bin/env lua function f(a, b) end function g(a, b, c) end f(1,2,3) g(1,2) で、エラー出ない。こんなので良いの?