2008-08-24から1日間の記事一覧
まんま >> require "rubygems" => true >> require "active_support" => true >> "hello".to(0) => "h" >> "hello".to(2) => "hel" >> "hello".to(10) => "hello"
「4.4. switch - case 文での利用」 enum C2008082400_Color { RED, BLUE, YELLOW, BLACK, WHITE } public class C2008082400 { public static void main(String[] args) { C2008082400_Color color = C2008082400_Color.valueOf("WHITE"); switch (color) {…
#!/usr/bin/env perl use strict; use Parse::RecDescent; use Data::Dumper; my $grammar = q{ inputs : list { print Data::Dumper::Dumper($item[1]); } list : '(' list_item(s /,/) ')' { $return = $item[2] } list_item : /\w/ }; my $parse = new Pa…
元 writeto ? #!/usr/bin/env lua if io.output() then --print("foo") io.write("foo") end #!/usr/bin/env lua if io.output("2008082401.txt") then -- print("foo") io.write("foo") end print を使うと、ファイルに書き込まれない