This file contains hidden or 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
protocol InitWithIntProtocol { | |
init(i: Int) | |
} | |
class WithInt: InitWithIntProtocol { | |
required init(i: Int) { | |
print(i) | |
} | |
} |
This file contains hidden or 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
protocol InitWithIntProtocol { | |
init(i: Int) | |
} | |
class WithInt: InitWithIntProtocol { | |
required init(i: Int) { | |
print(i) | |
} | |
} |
This file contains hidden or 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
func call2<T>(_ arg: T, _ c: (T) -> ()) { | |
c(arg) | |
} | |
call2(1) { arg in | |
print(arg) | |
} |
This file contains hidden or 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
import XMonad | |
import XMonad.Hooks.DynamicLog | |
import XMonad.Hooks.EwmhDesktops | |
import qualified XMonad.Hooks.ManageDocks as MD | |
import XMonad.Util.EZConfig | |
import XMonad.Layout.Named | |
import XMonad.Layout.ToggleLayouts |
This file contains hidden or 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 Contract | |
module Contracts | |
def push &contract | |
stack.push contract | |
end | |
def stack | |
@stack || @stack = [] | |
end |
This file contains hidden or 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 Hoge | |
def func | |
puts "Hoge module" | |
end | |
module_function :func | |
end | |
module Fuga | |
def func |
This file contains hidden or 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
<?xml version="1.0"?> | |
<root> | |
<item> | |
<name>Emacs Mode Extension</name> | |
<item> | |
<name>MarkSet Mode Ext Detail</name> | |
<appendix>Control+W to Command_L+X</appendix> | |
<appendix>Option+W to Command_L+C</appendix> | |
<appendix>Control+G to turn off MarkSet</appendix> | |
<appendix>Control+Space to turn off MarkSet</appendix> |
This file contains hidden or 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
open System | |
open Quotations.Patterns | |
type Maybe<'a> = Nothing | Just of 'a | |
type MaybeBuilder () = | |
member __.Quote() = () | |
member __.Run(x: Quotations.Expr<'a>) = | |
Console.WriteLine(x) | |
Just 42 |
This file contains hidden or 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
#include<iostream> | |
/* | |
// lambdaをtemplate parameterとして渡したい | |
auto template_func = [](int l, int r) { return l == r; }; | |
typedef decltype(template_func) template_function_parameter; | |
template <template_function_parameter f> | |
bool template_function_bad() | |
{ |
This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
namespace Expression | |
{ | |
public static class Expression | |
{ | |
public static ETry<TResult> Try<TResult>(Func<TResult> tryBlock) | |
{ | |
return new ETry<TResult>(tryBlock); |
NewerOlder