From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id UAA08036 for caml-redistribution@pauillac.inria.fr; Tue, 28 Mar 2000 20:30:55 +0200 (MET DST) Resent-Message-Id: <200003281830.UAA08036@pauillac.inria.fr> 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 DAA00741 for ; Tue, 28 Mar 2000 03:07:41 +0200 (MET DST) Received: from suburbia.net (suburbia.net [203.4.184.1]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id DAA25524 for ; Tue, 28 Mar 2000 03:07:38 +0200 (MET DST) Received: by suburbia.net (Postfix, from userid 110) id 99CCD6C68D; Tue, 28 Mar 2000 11:07:35 +1000 (EST) Sender: proff@suburbia.net To: Markus Mottl Cc: maxs@in.ot.com.au (Max Skaller), caml-list@inria.fr (OCAML) Subject: Re: to have labels or not References: <200003230346.EAA11644@miss.wu-wien.ac.at> Cc: proff@iq.org From: Julian Assange Date: 28 Mar 2000 11:07:35 +1000 In-Reply-To: Markus Mottl's message of "Thu, 23 Mar 2000 04:46:13 +0100 (MET)" Message-ID: User-Agent: Gnus/5.0802 (Gnus v5.8.2) XEmacs/21.1 (Big Bend) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-From: weis@pauillac.inria.fr Resent-Date: Tue, 28 Mar 2000 20:30:55 +0200 Resent-To: caml-redistribution@pauillac.inria.fr Markus Mottl writes: > Optional arguments can also be used to pass the "same" argument in > different forms (by using different labels on them), as is the case in the > PCRE: you can pass regular expressions as a string, in which case it will > be compiled for you, or as a precompiled regular expression, useful if > matching happens in a loop. This can be done by having two optional > arguments, one overriding the other if present. There is no commuting > involved (not necessarily), but this "trick" still gives the user a great > deal more of flexibility: he can choose whether he wants the "readable" or > "efficient" form without having to memorize more function names. Welcome to dynamic lisp. Cheers, Julian.