Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Re: to have labels or not
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2000-03-28 (18:30)
From: Julian Assange <proff@i...>
Subject: Re: to have labels or not
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.