From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id WAA14519 for caml-redistribution; Sat, 2 Jan 1999 22:11:55 +0100 (MET) 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 JAA06100 for ; Fri, 1 Jan 1999 09:22:31 +0100 (MET) Received: from kronstadt.transbay.net (ip55240.transbay.net [209.133.55.240]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id JAA16140 for ; Fri, 1 Jan 1999 09:22:28 +0100 (MET) Received: (from itz@localhost) by kronstadt.transbay.net (8.8.6/8.8.5) id AAA05691; Fri, 1 Jan 1999 00:21:05 -0800 Date: Fri, 1 Jan 1999 00:21:05 -0800 Message-Id: <199901010821.AAA05691@kronstadt.transbay.net> From: Ian T Zimmerman To: caml-list@inria.fr Subject: ANNOUNCE: mlexpect 0.9 Sender: weis mlexpect 0.9 has been uploaded to ftp://ftp.prosa.it/pub/people/itz/mlexpect-0.9.0.tar.gz All comments of any kind are heartily welcome. I quote the README file: This is mlexpect, a feeble attempt to to the same thing in ocaml as Don Libes' expect program does in Tcl. Install the GNU way: configure, make, make install. This will add the following to your system: expect.cma ... a ocaml bytecode library expect_lib.mli ... a ocaml interface source file for the library expect_lib.cmi ... compiled interface file mlexpect ... a ocaml toplevel with the expect library linked in. Also, for people who still miss C macro hackery :-) I added a camlp4 gizmo in expect_p4.cmo. When you load it you can write things like <:expect< spawn_id_0 * "exact string" => handle_exact_string spawn_id_1 * /"pattern"/ => handle_pattern spawn_id_1 * Eof => handle_eof >> the handlers must be of type int -> spawn_id -> unit. The first parameter is the ordinal of the clause in the expect construct (starting with 0, as hinted above) and the second is the spawn_id on which match occurred. Thus you can use the same handler in multiple clauses. BUGS: `interact' is missing. I planned to include it and have it work the same as the interact command in real expect, but it proved so complicated and requiring so many dirty tricks that I gave up for this first release. Maybe later, if someone can suggest a way to do it without breaking all the rules of clean programming (i.e. the interact function would have to use pretty much all the internals of the Buffer submodule, as matching must be done at every buffer position for multiple regexps in turn). The Pty functions assume either a plain BSD style pty allocation scheme without any kernel or libc support (which is the way it works on my system, Linux 2.0/GNU), or SysV style ptys (/dev/ptmx, ptsname(), etc.; latest Linux 2.1 kernels work like this). If your system doesn't have the SysV bells & whistles but OTOH is also incompatible with BSD and Linux < 2.1 as far as manual allocation (eg. if the device names are something else than [pt]ty[p-s][0-9a-f]), you're in for some source hacking. Ob-apology: No French version. BIG FAT WARNING There are 2 (count 'em, two) ways of referring to ptys under Linux up to 2.0. The old obsolete scheme gives both masters and slaves major device no. 4, same as regular ttys, and starts their minor nos. at 128 and 192 respectively. The new way gives a separate major no. both to pty masters (2) and slaves (3). IF YOUR ACTUAL DEVICE FILES USE ONE SCHEME (probably the old one) BUT YOUR KERNEL HEADER FILES USE THE OTHER (probably the new one) THIS SOFTWARE WILL BE MISCONFIGURED. That's what happened to me during testing. You really should convert consistently to the new scheme ASAP. This may mean editing /etc/devinfo and re-running /dev/MAKEDEV. Other than that, it works; even in this immature state it statisfies my first goal, which was to erase all traces of Tcl from my machine :-) Enjoy. Note the email address below is current, the one in most source files (@rahul.net) is outdated. -- Ian T Zimmerman I came to the conclusion that what was wrong about the guillotine was that the condemned man had no chance at all, absolutely none. Albert Camus, _The Outsider_