OCaml: Refactor configuration lexer for readability, conciseness
This commit is contained in:
parent
df3a9e9a68
commit
8b1aae16c6
3 changed files with 80 additions and 65 deletions
|
|
@ -1,5 +1,24 @@
|
|||
let str_int = string_of_int
|
||||
(* an 'alias' is an alternate name with minor or no alterations to behavior *)
|
||||
|
||||
(* logging *)
|
||||
let print = print_endline
|
||||
let elog = Log.elog
|
||||
|
||||
(* casts *)
|
||||
let str_int = string_of_int
|
||||
let chars_str = Text.chars_of_string
|
||||
let str_chars = Text.string_of_chars
|
||||
|
||||
(* control flow & precedence *)
|
||||
let ($) = (@@)
|
||||
|
||||
(* lists *)
|
||||
type 'a lists = 'a list list
|
||||
let ($:) list element = list @ [element]
|
||||
let pick index list = List.nth list index
|
||||
let rmap = List.rev_map
|
||||
let reverse = List.rev
|
||||
let length = List.length
|
||||
let ifilter = List.filteri
|
||||
let imap = List.mapi
|
||||
let map = List.map
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue