Skip to content

Instantly share code, notes, and snippets.

def rill_main(): void
{
f( 42 );
}
template(val T: type)
def f(val a: T): void
{
}
def rill_main(): int
{
return f( 42 );
}
template(T: type)
def f(val a: T): T
{
return a * a;
}
def main(): int
{
val a: mutable(int) = 10;
val b = 20;
val c = f( a * b );
p( c );
return 0;
}
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 );
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE QuasiQuotes #-}
module CompileTime where
import Language.Haskell.TH
import System.Cmd
import System.Exit
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);;
@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;
#!/bin/bash
# ref. https://www.parse.com/downloads/cloud_code/installer.sh
TMP_FILE=/tmp/parse.tmp
if [ -e ${TMP_FILE} ]; then
echo "Cleaning up from previous install failure"
rm -rf ${TMP_FILE}
fi
echo "Fetching latest version ..."
@yutopp
yutopp / input0.w
Last active November 2, 2015 07:41
definition of WHILE language with K-framework
x := 2 + 10;
x := 5;
skip;
x := 10;
y := x + 10;
x := x - 1;
skip