echo 'true : package(landmarks.ppx,landmarks)' >> _tags
export OCAML_LANDMARK=auto
topkg build
topkg run exe
| (* OCaml Port of fig. 5-6 of https://trojansource.codes/trojan-source.pdf *) | |
| let access_level = "user" | |
| let main () = | |
| if access_level <> "user (* Check if admin *)" then | |
| Printf.printf "You are an admin.\n" | |
| let () = main () |
| (*--------------------------------------------------------------------------- | |
| Copyright (c) 2015 The uunf programmers. All rights reserved. | |
| Distributed under the ISC license, see terms at the end of the file. | |
| ---------------------------------------------------------------------------*) | |
| (* WARNING do not edit. This file was automatically generated. *) | |
| open Uunf_tmapbool;; | |
| let v000 = snil |
| > opam switch create 4.06.0 --debug-level=3 | |
| 00:00.003 GSTATE LOAD-GLOBAL-STATE @ /Users/dbuenzli/.opam | |
| 00:00.004 SYSTEM LOCK /Users/dbuenzli/.opam/lock (none => read) | |
| 00:00.004 SYSTEM LOCK /Users/dbuenzli/.opam/config.lock (none => write) | |
| 00:00.004 FILE(config) Read ~/.opam/config in 0.000s | |
| 00:00.005 RSTATE LOAD-REPOSITORY-STATE @ /Users/dbuenzli/.opam | |
| 00:00.008 FILE(repos-config) Read ~/.opam/repo/repos-config in 0.003s | |
| 00:00.008 SYSTEM LOCK /Users/dbuenzli/.opam/repo/state.cache (none => read) | |
| 00:00.108 RSTATE Loaded /Users/dbuenzli/.opam/repo/state.cache in 0.099s | |
| 00:00.264 SYSTEM LOCK /Users/dbuenzli/.opam/repo/state.cache (read => none) |
echo 'true : package(landmarks.ppx,landmarks)' >> _tags
export OCAML_LANDMARK=auto
topkg build
topkg run exe
In order to deprecate a feature from the OCaml system the following steps are taken:
| (* | |
| ocamlfind ocamlopt -o readmeta -linkpkg \ | |
| -package dynlink,compiler-libs.optcomp,compiler-libs.bytecomp readmeta.ml | |
| *) | |
| let read_cma ic = | |
| let lib = | |
| let toc_pos = input_binary_int ic in | |
| seek_in ic toc_pos; | |
| (input_value ic : Cmo_format.library) |
See ocaml/RFCs#7
Install the following opam packages:
opam install caml-mode merlin ocp-indent
Tweak your .emacs file with some or all of the following:
; shift tab to complete
(global-set-key (kbd "S-<tab>") 'company-complete)
| (*---------------------------------------------------------------------------- | |
| Copyright (c) 2009, Daniel C. Bünzli. All rights reserved. | |
| Distributed under a BSD license, see license at the end of the file. | |
| ----------------------------------------------------------------------------*) | |
| let str = Printf.sprintf | |
| let exec = Filename.basename Sys.executable_name | |
| let pr = Format.printf | |
| let pr_err s = Printf.eprintf "%s:%s\n" exec s |
Since 4.06 we have UTF-X encoding support via the Buffer module. The
following is a proposal to add UTF-X decoding (and bytes encoding)
support with the following goals:
bytes. This API
provides all the information needed to implement loops for making
higher-level UTF-X codec APIs (e.g. Uutf's folding functions)
operating on bytes and string values. It's not geared towards the end-user