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
// | |
// Copyright yutopp 2015 - . | |
// | |
// Distributed under the Boost Software License, Version 1.0. | |
// (See accompanying file LICENSE_1_0.txt or copy at | |
// http://www.boost.org/LICENSE_1_0.txt) | |
// | |
module ast; |
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
let double n = n *. 2.0 ;; | |
print_newline() ;; | |
let rec f n = if n == 0 then () else f (n - 1); print_int n; print_newline();; | |
f 10;; | |
print_float (double 3.14);; |
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
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE QuasiQuotes #-} | |
module CompileTime where | |
import Language.Haskell.TH | |
import System.Cmd | |
import System.Exit |
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
def main(): int | |
{ | |
val a: mutable(int) = 10; | |
val b = 20; | |
val klass1 = mutable(TestClass)(); | |
// val klass1 = TestClass(); | |
val c = f( a * b ); | |
p( c ); |
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
def main(): int | |
{ | |
val a: mutable(int) = 10; | |
val b = 20; | |
val c = f( a * b ); | |
p( c ); | |
return 0; | |
} |
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
def rill_main(): int | |
{ | |
return f( 42 ); | |
} | |
template(T: type) | |
def f(val a: T): T | |
{ | |
return a * a; | |
} |
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
def rill_main(): void | |
{ | |
f( 42 ); | |
} | |
template(val T: type) | |
def f(val a: T): void | |
{ | |
} |
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
{ |
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 <cstdlib> | |
#include <ostream> | |
namespace ytl | |
{ | |
namespace colorize | |
{ | |
namespace esc | |
{ |
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
def main(): int | |
{ | |
print( "hello, bunchou lang on Linux!!!bunbun!\n" ); | |
test1(); | |
test_while(); | |
test_while_if(); | |
test_scope(); | |
return 0; | |
} |