THIS GIST WAS MOVED TO TERMSTANDARD/COLORS
REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
kill `ps aux | grep [v]algrind | awk '{print $2}' | tail -n1` |
packagedata = packagedata or { } -- namespace proposal for packages | |
local word_count = { threshold = 3, } | |
packagedata.word_count = packagedata.word_count or word_count | |
dofile(kpse.find_file"char-def.lua") -- unicode tables | |
dofile(kpse.find_file"lualibs-table.lua") -- old Context table code | |
local utf = unicode.utf8 | |
local node = node | |
local type = type |
(use '[clojure.core.match :only [match]]) | |
(defn evaluate [env [sym x y]] | |
(match [sym] | |
['Number] x | |
['Add] (+ (evaluate env x) (evaluate env y)) | |
['Multiply] (* (evaluate env x) (evaluate env y)) | |
['Variable] (env x))) | |
(def environment {"a" 3, "b" 4, "c" 5}) |
type Name = { | |
first: ~str, | |
last: ~str | |
} | |
type Shape = Circle(int) | Rect(int, int) // Variants with constructors | |
type Direction = North | South | East | West // without constructors | |
Byobu Commands | |
============== | |
byobu Screen manager | |
Level 0 Commands (Quick Start) | |
------------------------------ | |
<F2> Create a new window |
type z | |
type 'a s | |
(* Sadly enough, without kind restrictions, this still allows nonsense types like *) | |
type nonsense = int s | |
(* GHC 7.6 supports this (lifting types to kinds & kind constraints) ;-) *) | |
type (_, _) llist = | |
| Nil : (z, 'a) llist | |
| Cons : ('a * ('l, 'a) llist) -> ('l s, 'a) llist |
use std::unstable::intrinsics::{TyDesc, get_tydesc, forget}; | |
use std::util::Void; | |
use std::cast::transmute; | |
/////////////////////////////////////////////////////////////////////////////// | |
// TypeId | |
/////////////////////////////////////////////////////////////////////////////// | |
/// `TypeId` represents a globally unique identifier for a type | |
pub struct TypeId { |
enum List<T> { | |
End, | |
Node { val: T, next: ~List<T> }, | |
} | |
fn print_list<T:ToStr>(list: List<T>) { | |
match list { | |
End => { println("<X>"); }, | |
Node{val, next} => { | |
println(val.to_str()); |
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS
REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
This Gist now has its own repository on GitHub: https://github.com/Kimundi/lazy-static.rs