From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id UAA00496; Fri, 23 Apr 2004 20:52:13 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id UAA00691 for ; Fri, 23 Apr 2004 20:52:12 +0200 (MET DST) Received: from gatekeeper.elmer.external.excelhustler.com (gatekeeper.excelhustler.com [68.99.114.105]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i3NIqAjq011641 for ; Fri, 23 Apr 2004 20:52:11 +0200 Received: from chatterbox.elmer.internal.excelhustler.com (unknown [192.168.0.12]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (Client CN "chatterbox.elmer.internal.excelhustler.com", Issuer "excelhustler.com" (not verified)) by gatekeeper.elmer.external.excelhustler.com (Postfix) with ESMTP id 3A557E0232; Fri, 23 Apr 2004 13:52:10 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by chatterbox.elmer.internal.excelhustler.com (Postfix) with ESMTP id EF31B5C006; Fri, 23 Apr 2004 13:52:09 -0500 (CDT) Received: from wile.internal.excelhustler.com (wile.internal.excelhustler.com [192.168.1.34]) by chatterbox.elmer.internal.excelhustler.com (Postfix) with ESMTP id E47015C009; Fri, 23 Apr 2004 13:51:48 -0500 (CDT) Received: by wile.internal.excelhustler.com (Postfix, from userid 1000) id D9CDD37056; Fri, 23 Apr 2004 13:51:48 -0500 (CDT) Date: Fri, 23 Apr 2004 13:51:48 -0500 From: John Goerzen To: caml-list@inria.fr Subject: [Caml-list] [ANN] The Missing Library Message-ID: <20040423185148.GA4434@excelhustler.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.5.1+cvs20040105i X-Scanned-By: clamscan at chatterbox.elmer.internal.excelhustler.com X-Miltered: at nez-perce by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; api:01 quux:01 quux:01 hash:01 hash:01 api:01 subparts:01 findlib:01 beforehand:01 criticism:01 ocamlopt:01 python's:01 analogous:01 hashtbl:01 hashtbl:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hello, Some of you may remember my complaints about missing functions in the standard library. To help address those, I have started work on my own OCaml library to augment the standard functions. You can obtain it, along with online API docs covering every function, at: gopher://quux.org/1/devel/missinglib or http://quux.org/devel/missinglib [Debian users: I have uploaded it to sid, but will take a few days to appear.] Some excerpts from the README: Missinglib is a collection of OCaml-related utilities. The following modules are are provided: ConfigParser System for parsing configuration files Hashtbloper Hash table convenience operators Hashtblutil Hash table utilities Lexingutil Lexing-related utilities Listutil List-manipulation utilities Slice Underlying API for Slice operators Sliceoper Flexible subparts of arrays, lists, and strings Streamutil Stream parser utilities Strutil String-related utilities The entire library has no prerequisites save the OCaml standard library and findlib and is designed to install without complexity on a variety of systems. It could also easily be embedded within your own source trees so that users need not have it installed beforehand. ---------- I would greatly appreciate constructive criticism on any aspect of the package, especially the build system. I have tried to make it possible to "make; make install" on just about any platform, regardless of availability of ocamlopt. It took some hoop-jumping, though, so suggestions are welcome :-) Some basic info on the modules present: The ConfigParser module can read and write sectioned .INI-style files and is mostly compatible with Python's ConfigParser module. Sliceoper defines some more powerful ways of indexing arrays, lists, and strings (some of these concepts were discussed on this list). Strutil provides functions like strip, lstrip, and rstrip (removes whitespace from either end, beginning, or end, of a string). Listutil provides a "replace" that is analogous to Hashtbl.replace, but for association lists; and "sub" that is similar to String.sub or Array.sub. Hashtbloper defines some more useful ways of working with hash tables, such as: hash /> 5 is the same as: Hashtbl.find hash 5 let sections = Hashtbl.create 5;; let options = Hashtbl.create 5;; Hashtbl.replace options "option1" "value1";; Hashtbl.replace sections "section1" options;; sections /> "section1" /> "option1";; returns "value1" let newhash = hash // ("key", "value");; (Copies hash, adds the pair to the copy, and returns it -- similar in concept to :: for lists) BTW, is this list the right place for a message like this? -- John ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners