FW: [mercury-users] Records

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Nov 9 03:08:41 AEDT 1999


On 08-Nov-1999, Peter Schachte <schachte at cs.mu.OZ.AU> wrote:
> On Mon, Nov 08, 1999 at 04:00:49PM +1100, Simon Taylor wrote:
> > > > The only complaint I have with using magic function names for which
> > > > definitions can be automatically generated by the compiler is that
> > > > typos can result in difficult to spot bugs where the programmer's
> > > > version is not called.
> > 
> > :- type foo
> > 	---> foo(
> > 		field1::int,
> > 		field2::int
> > 	).
> > :- func 'set feild1'(foo, int) = foo.
> 
> For starters, there's nothing wrong with this code that the compiler
> can find.

What about the following?

	foo.m:006: Error: no clauses for function `foo:set feild1/2'.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list