This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
js> function foo (x) { | |
> function bar () { | |
> print(x) | |
> } | |
> bar() | |
> } | |
js> foo(1) | |
1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts "hello" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
collatz' :: Int -> Maybe (Int, Int) | |
collatz' 0 = Nothing | |
collatz' 1 = Just (1, 0) | |
collatz' n | |
| n `mod` 2 == 0 = Just (n, n `div` 2) | |
| otherwise = Just (n, 3 * n + 1) | |
collatz :: Int -> [Int] | |
collatz n = unfoldr collatz' n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/parse.y b/parse.y | |
index 3061ed8..1cae0e5 100644 | |
--- a/parse.y | |
+++ b/parse.y | |
@@ -686,7 +686,7 @@ static void token_info_pop(struct parser_params*, const char *token); | |
%type <node> words qwords word_list qword_list word | |
%type <node> literal numeric dsym cpath | |
%type <node> top_compstmt top_stmts top_stmt | |
-%type <node> bodystmt compstmt stmts stmt expr arg primary command command_call method_call | |
+%type <node> bodystmt compstmt stmts stmt_or_begin stmt expr arg primary command command_call method_call |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main = putStrLn "hello, world" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Whiteye.OAuth.Consumer ( | |
Consumer (..), | |
oAuthRequest | |
) where | |
import Data.List | |
import Control.Applicative | |
import Network.URI | |
import Network.HTTP | |
import qualified System.Time as Time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/home/shugo/local/lib/ruby/gems/1.9.1/gems/grit-2.4.1/lib/grit/git-ruby/internal/loose.rb:108:in `unpack_object_header_gently': undefined method `>>' for "x":String (NoMethodError) | |
from /home/shugo/local/lib/ruby/gems/1.9.1/gems/grit-2.4.1/lib/grit/git-ruby/internal/loose.rb:56:in `get_raw_object' | |
from /home/shugo/local/lib/ruby/gems/1.9.1/gems/grit-2.4.1/lib/grit/git-ruby/internal/loose.rb:32:in `[]' | |
from /home/shugo/local/lib/ruby/gems/1.9.1/gems/grit-2.4.1/lib/grit/git-ruby/repository.rb:84:in `block in get_raw_object_by_sha1' | |
from /home/shugo/local/lib/ruby/gems/1.9.1/gems/grit-2.4.1/lib/grit/git-ruby/repository.rb:83:in `each' | |
from /home/shugo/local/lib/ruby/gems/1.9.1/gems/grit-2.4.1/lib/grit/git-ruby/repository.rb:83:in `get_raw_object_by_sha1' | |
from /home/shugo/local/lib/ruby/gems/1.9.1/gems/grit-2.4.1/lib/grit/git-ruby/repository.rb:334:in `walk_log' | |
from /home/shugo/local/lib/ruby/gems/1.9.1/gems/grit-2.4.1/lib/grit/git-ruby/repository.rb:287:in `log' | |
from /home/shugo/local/lib/ruby/gems/1.9. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Scanning . repo | |
Found 4 bugfix commits, with 2 hotspots: | |
Fixes: | |
- fixed a comment. | |
- fixed indentation once more. | |
- fixed indentation. | |
- added README.markdown. | |
Hotspots: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Module.constants returns constants accessible at the place where the | |
# method is called. | |
class A | |
X = 1 | |
p Module.constants.include?(:X) #=> true | |
end | |
# Module#constants returns constants defined in the receiver. However, | |
# you need a trick to invoke Module#constants on Module itself. | |
p Module.instance_method(:constants).bind(Module).call #=> [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "pp" | |
class Tree | |
def insert(value) | |
BlueFork.new(value, Null, Null).merge(self) | |
end | |
def merge(other) | |
other._merge(self) | |
end |