[m-rev.] for review: constraint propagation [1]

Fergus Henderson fjh at cs.mu.OZ.AU
Sun Aug 5 18:38:13 AEST 2001


On 05-Aug-2001, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> On 05-Aug-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > On 02-Aug-2001, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> > > This change was first reviewed early last year.
> > > Below is a relative diff for constraint.m.
> > > The full diff will be posted in another message.
> > > The mailing list thread from last year can be found in
> > > ~stayl/constraint_mail.
> > 
> > fjh$ dir ~stayl
> > /home/pgrad/stayl: Permission denied
> 
> Make that /home/earth/stayl/constraint_mail.

Probably the best way of referring to such things is to give a URL
for the mail archive, i.e.
<http://www.cs.mu.oz.au/research/mercury/mailing-lists/mercury-developers/mercury-developers.0002/0247.html>.
That way people who don't have accounts here can read it.

If you have the mail on hand, it's easy enough to use the archive search
facility to find a URL for it.  I also have a little shell script for
doing this.  (See attached.)

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
-------------- next part --------------
#!/bin/sh

sed_command()
{
	sed -e 's/+/%2B/g' -e 's/ /+/g'
}

browser=lynx		# WWW browser to use
site=aus		# Mercury web site to use: aus (Australia) or us (USA)
what=mail		# database to search: web site or mailing lists
match=all
format=long
run=exec
while [ $# -gt 0 ]; do
	case "$1" in
		-b|--browser)
			browser="$2"
			shift 2 ;;
		-l|--lynx)
			browser=lynx
			shift ;;
		--netscape)
			browser=netscape
			shift ;;
		--mosaic|--Mosaic)
			browser=Mosaic
			shift ;;

		--aus|--australia)
			site=aus
			shift ;;
		-u|--us|--usa)
			site=us
			shift ;;

		-a|--any)
			match=any
			shift ;;
		--all)
			match=all
			shift ;;

		-m|--mail)
			what=mail
			shift ;;
		-w|--web|--www)
			what=web
			shift ;;

		-l|--long)
			format=long
			shift ;;
		-s|--short)
			format=short
			shift ;;

		-e|--echo)
			run=echo
			shift ;;

		--)	break 2 ;;

		-h|--help|-*)
		cat << EOF
Usage: `basename $0` [options] [text to search for]
Options:
	-h, --help
		Print this message

	-b <browser>, --browser <browser>
		Use the specified program for your WWW browser
	--netscape
		Use netscape for your WWW browser
	--mosaic
		Use Mosaic for your WWW browser
	-l, --lynx
		Use lynx for your WWW browser (the default)

	--aus, --australia
		Use the original Australian site (the default)
	-u, --us, --usa
		Use the US sourceforge mirror site

	-m, --mail
		Search the mailing list archives (the default)
	-w, --web, --www
		Search the Web page

	-s, --short
		Use the "short" answer format
	-l, --long
		Use the "long" answer format (the default)

	-a, --any
		Match any of the specified keywords.
	--all
		Match all of the specified keywords (the default).
EOF
			exit 1
			;;

		*)	break 2 ;;
	esac
done

case $site in
	aus)	server=www.mercury.cs.mu.oz.au
		;;
	us)	server=www.sourceforge.net/mercury
		;;
	*)	echo "unknown site $site" 1>&2; exit 1 ;;
esac

case $# in
	0)	
		case $what in
			mail) url=mailing-lists/search.html ;;
			web)  url=search.html ;;
		esac
		$run $browser "http://$server/$url" ;;
	*)	
		case $match in
			all) method=and ;;
			any) method=or ;;
		esac
				
		case $what in
			mail) restrict=mailing-lists
			      exclude=
			      ;;
			web)  restrict=
			      exclude=mailing-lists
			      ;;
		esac
		query=`echo "\"$1\"" | sed_command`
		shift
		case $# in
			0) ;;
			*)
			for arg in "$@"; do
				part_query=`echo "\"$arg\"" | sed_command`
				query="$query+$part_query"
			done
			;;
		esac
		form="method=$method&format=builtin-$format&config=htdig-mercury&restrict=$restrict&exclude=$exclude&words=$query"
		$run $browser "http://$server/cgi-bin/htsearch?$form"
		;;
esac


More information about the reviews mailing list