Skip to content

Instantly share code, notes, and snippets.

@yutopp
yutopp / ast.d
Last active August 29, 2015 14:19
//
// 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;
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);;
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE QuasiQuotes #-}
module CompileTime where
import Language.Haskell.TH
import System.Cmd
import System.Exit
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 );
def main(): int
{
val a: mutable(int) = 10;
val b = 20;
val c = f( a * b );
p( c );
return 0;
}
def rill_main(): int
{
return f( 42 );
}
template(T: type)
def f(val a: T): T
{
return a * a;
}
def rill_main(): void
{
f( 42 );
}
template(val T: type)
def f(val a: T): void
{
}
#include <cstdlib>
#include <ostream>
namespace ytl
{
namespace colorize
{
namespace esc
{
def main(): int
{
print( "hello, bunchou lang on Linux!!!bunbun!\n" );
test1();
test_while();
test_while_if();
test_scope();
return 0;
}