Skip to content

Instantly share code, notes, and snippets.

View np's full-sized avatar

Nicolas Pouillard np

View GitHub Profile
@np
np / email-reminder
Created October 1, 2009 19:49
email-reminder
#!/bin/bash -e
perr(){
echo "$@" > /dev/stderr
}
usage(){
perr "Usage: cat <email> | email-reminder <at(1)-arguments>*"
perr "$@"
exit 1
@np
np / gist:167685
Created August 14, 2009 07:11 — forked from avsm/gist:166441
(* defines the Ast.binding for a function of form:
let fun_name ?(opt_arg1) ?(opt_arg2) final_ident = function_body ...
XXX: figure out the quotation magic for this, if such exists
*)
let function_with_label_args _loc ~fun_name ~final_ident ~function_body ~return_type opt_args =
let opt_args = opt_args @ [ <:patt< $lid:final_ident$ >> ] in
let rec fn _loc = function
|hd::tl -> <:expr< function $hd$ -> $fn _loc tl$ >>
|[] -> <:expr< ( $function_body$ : $return_type$ ) >>
in