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
open Format | |
open Dynlink | |
let () = try | |
print_endline "init"; | |
Dynlink.init (); | |
print_endline "allowing unsafe modules"; | |
Dynlink.allow_unsafe_modules true; | |
Dynlink.loadfile "/home1/h/hongboz/ocaml/lib/ocaml/stdlib.cma"; | |
Dynlink.loadfile |
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
// Credit: this is derived from a combination of | |
// - https://gist.github.com/650000 | |
// - https://github.com/joyent/node/pull/350 | |
// - https://github.com/ajaxorg/cloud9/blob/master/support/requireJS-node.js | |
var path = require('path'), | |
fs = require('fs'), | |
defaultCompile = module.constructor.prototype._compile, | |
defaultResolveFilename = module.constructor._resolveFilename, | |
// this gives the main module a chance to use define iff it does so before any other module |
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
// Generated CODE, PLEASE EDIT WITH CARE | |
'use strict'; | |
var invalid_argument = /* tuple */[ | |
248, | |
"Invalid_argument", | |
-3 | |
]; | |
var not_found = /* tuple */[ |
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
// Generated CODE, PLEASE EDIT WITH CARE | |
'use strict'; | |
var invalid_argument = /* tuple */[ | |
248, | |
"Invalid_argument", | |
-3 | |
]; |
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
reason-demo>npm run build | |
^[[?25h | |
> @ build /Users/hongbozhang/git/bucklescript-addons/examples/reason-demo | |
> source dependencyEnv && bsc -pp ./node_modules/reason/refmt_impl.native -impl hello.re | |
/Users/hongbozhang/git/bucklescript-addons/examples/reason-demo/node_modules/dependency-env/.bin/dependencyEnv.js:60 | |
packageName.replace(new RegExp("\-", "g"), function(s){return "_";}).toUpperCase() + "__"; | |
^ | |
TypeError: Cannot read property 'replace' of undefined |
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
git>npm install -g https://github.com/npm-ml/merlin.git | |
npm ERR! addLocal Could not install /var/folders/df/dh8jkb254qv48cfc0_rhmkf00000gn/T/npm-48145-1a0fbf19/git-cache-3e4efa99/4116bf8bedbaf927784a9d7e05ccd4430bcd7990 | |
npm ERR! Darwin 15.5.0 | |
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "https://github.com/npm-ml/merlin.git" | |
npm ERR! node v4.2.1 | |
npm ERR! npm v3.10.5 | |
npm ERR! code EISDIR | |
npm ERR! errno -21 | |
npm ERR! syscall read |
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
external to_str : 'a -> string = "js_anything_to_string" | |
external to_json_string : 'a -> string = "js_json_stringify" | |
let debug x = print_endline (to_str x ) | |
let pprint x = print_endline (to_json_string x) | |
let rec fib = function | |
| 1 | 2 -> 1 | |
| n -> fib (n - 1 ) + fib (n - 2) | |
(** Imperative style *) | |
let sum n = | |
let v = ref 0 in |
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 f x y = x + y |
OlderNewer