dbuenzli / fmt

OCaml Format pretty-printer combinators
http://erratique.ch/software/fmt
ISC License
71 stars 26 forks source link

Change signal function #31

Closed ghilesZ closed 5 years ago

ghilesZ commented 6 years ago

This change replaces the pattern-matching in the signal function by a an array access for a better complexity. It also adds the "SIGBUS"; "SIGPOLL"; "SIGSYS"; "SIGTRAP"; "SIGURG"; "SIGXCPU"; "SIGXFSZ" signals which were added in https://github.com/ocaml/ocaml/commit/a3041d95508a6bdcd9477983cf33725eaf208974#diff-1e0d7b30cd49fac46cc6737320356c75

dbuenzli commented 6 years ago

I think it's better to keep the constants.

ghilesZ commented 6 years ago

Ok, i find it a bit weird to do an "if then else" over consecutive integers but anyway, you should consider adding the signal from range -28 to -22 (which was my first concern in fact):

sigbus = -22 sigpoll = -23 sigsys = -24 sigtrap = -25  sigurg = -26  sigxcpu = -27  sigxfsz = -28

dbuenzli commented 6 years ago

Ok, i find it a bit weird to do an "if then else"

Sure but I guess you are well aware of the benefits of named constants.

dbuenzli commented 5 years ago

Support added in 70956e82933c169221db361072197.