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 std { | |
def fib = 1 -> Int | |
=> 1 | |
def fib = 2 -> Int | |
=> 1 | |
def fib = n:Int -> Int | |
=> fib(n-2) + fib(n-1) | |
} | |
module program { |
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
let source : "+++++++++[>++++++++>+++++++++++>+++++<<<-]>.>++.+++++++..+++.>-.------------.<++++++++.--------.+++.------.--------.>+.\0" | |
let item : | |
lambda n -> | |
lambda list -> | |
if ( = n 0 ) | |
then head list | |
else item ( - n 1 ) ( tail list ) | |
let state : |
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
Option Explicit On | |
Dim sheet As Worksheet | |
Dim count As Long | |
Sub Main() | |
Dim cell As String | |
Dim x, y As Long | |
Dim a, b, c As Long | |
Dim align As Integer |
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
let fizz_buzz : \n -> | |
let fizz_buzz : \i -> \n -> | |
( let m : ( + i 1 ) -> | |
( cond ( > i n ) () | |
( cond ( = ( % i 15 ) 0 ) ( >>= ( puts "fizzbuzz" ) ( fizz_buzz m n ) ) | |
( cond ( = ( % i 3 ) 0 ) ( >>= ( puts "fizz" ) ( fizz_buzz m n ) ) | |
( cond ( = ( % i 5 ) 0 ) ( >>= ( puts "buzz" ) ( fizz_buzz m n ) ) | |
( >>= ( puts i ) ( fizz_buzz m n ) ) ) ) ) ) ) -> fizz_buzz 1 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
// こんな感じのクラスを作って | |
abstract class Super<T> { | |
public abstract Super<U> Foo<U>(Func<T,U> map); | |
} | |
// Super<T>を継承したSub<T>を作って、それを実装する時 | |
class Sub<T> : Super<T> { | |
// ↓こうなるのを | |
public override Super<U> Foo<U>(Func<T,U> map) { ... } |
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
abstract class X | |
{ | |
public abstract T Get<T>(); | |
public object P { get { return this.Get<Object>(); } } | |
} | |
class X<T> : X | |
{ | |
public override T Get<T>() { return default(T); } | |
public T Get() { return this.Get<T>(); } |
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
class Parser | |
rule | |
target : unit | |
| { result = 0 } | |
unit : stat | |
| unit stat | |
stat : expr SEMICOLON |
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 Esolang | |
open System | |
open System.IO | |
open FParsec | |
open FParsec.CharParsers | |
open FParsec.Primitives | |
open FParsec.Error | |
type Pattern = | |
| As of Pattern * Pattern |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using XSpect.Yacq.Expressions; | |
using Parseq; | |
using Parseq.Combinators; |
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
Enumerator := Object clone do( | |
current := method(Exception raise("not implemented")) | |
moveNext := method(Exception raise("not implemented")) | |
reset := method(Exception raise("not implemented")) | |
) | |
Enumerable := Object clone do( | |
enumerator := method(Exception raise("not implemented")) | |
) |
OlderNewer