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
| sealed trait NameOpt extends Any { | |
| def isEmpty: Boolean | |
| def get: (String, String) | |
| } | |
| object NameOpt { | |
| object Empty extends NameOpt { | |
| def isEmpty: Boolean = | |
| true |
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
| class A { | |
| val v = (x: Int) => x * 3 | |
| def f(x: Int) = x * 3 | |
| } | |
| object A { | |
| def v() { | |
| val a = new A | |
| var i = 0 | |
| var n = 1 | |
| while (i < 1000000) { |
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
| module a{ | |
| export module b{ | |
| export var hoge; | |
| export function f() { | |
| hoge = 0; | |
| var b = 0; | |
| return b; | |
| } | |
| } | |
| } |
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
| (defun fix-ocaml-cursor-position (byte-pos) | |
| (let ((len (lambda (p) | |
| (length (encode-coding-string | |
| (buffer-substring 1 p) buffer-file-coding-system))))) | |
| (let* ((pos (/ byte-pos 4)) | |
| (b (funcall len pos))) | |
| (while (< b (- byte-pos 1)) | |
| (setq pos (+ pos 1)) | |
| (setq b (funcall len pos))) | |
| pos))) |
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 by the J2ObjC translator. DO NOT EDIT! | |
| // source: AO.java | |
| // | |
| // Created by mac on 12/11/09. | |
| // | |
| @class IOSIntArray; | |
| @class IOSObjectArray; | |
| @class Intersection; |
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
| ///<reference path='..\typescript\src\harness\harness.ts'/> | |
| ///<reference path='..\typescript\src\harness\baselining.ts'/> | |
| ///<reference path='..\typescript\src\harness\external\json2.ts'/> | |
| ///<reference path='..\typescript\src\compiler\optionsParser.ts'/> | |
| class Dumper { | |
| constructor (public ioHost: IIO) { | |
| } |
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 Batteries_uni | |
| let (>>=) = Lwt.bind | |
| let http_get url = | |
| Printf.printf "sleep\n"; | |
| Lwt_unix.sleep 2.0 >>= (fun () -> | |
| Printf.printf "wake up\n"; | |
| Lwt.return ("data '" ^ url ^ ""));; |
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 _ = | |
| <?php | |
| for ($i = 1; $i <= 100; $i++) { | |
| if ($i % 3 == 0) { | |
| ?> | |
| print_string "Fizz"; | |
| <?php | |
| } | |
| if ($i % 5 == 0) { | |
| ?> |
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
| diff -rN -u old-js_of_ocaml/compiler/driver.ml new-js_of_ocaml/compiler/driver.ml | |
| --- old-js_of_ocaml/compiler/driver.ml 2012-09-05 19:02:07.000000000 +0900 | |
| +++ new-js_of_ocaml/compiler/driver.ml 2012-09-05 19:02:07.000000000 +0900 | |
| @@ -20,7 +20,7 @@ | |
| let debug = Util.debug "main" | |
| -let f ?standalone p = | |
| +let f ?standalone (p, d) = | |
| if debug () then Code.print_program (fun _ _ -> "") p; |
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 window = Dom_html.window;; | |
| let foo i = | |
| let result = try Some (List.find (fun s -> s = i) [0; 1; 5]) with Not_found -> None in | |
| match result with | |
| Some(n) -> window##alert(Js.string (Printf.sprintf "foo Some(%d)" n)) | |
| | None -> window##alert(Js.string "foo None");; | |
| for i = 0 to 3 do | |
| foo i |