[mercury-users] Constructor question.

Michael Richter ttmrichter at gmail.com
Sat Apr 14 21:03:50 AEST 2012


On 14 April 2012 17:26, Mark Brown <mark at csse.unimelb.edu.au> wrote:

> > > Foo = foo(  10       % bar
> > >             "eleven" % baz
> > >          ).
>
> You can write
>
>    (_ ^ bar := 10)
>       ^ baz := "eleven"
>
> to construct the above term.


Thanks for the pointer.

How would that look if I want to explicitly initialize the quux field?
 This…

((_ ^ bar := 10)
>     ^ baz := "eleven")
>     ^ quux := yes


…could start to get a bit quirky-looking if I want to initialize a dozen
members.

-- 
"Perhaps people don't believe this, but throughout all of the discussions
of entering China our focus has really been what's best for the Chinese
people. It's not been about our revenue or profit or whatnot."
--Sergey Brin, demonstrating the emptiness of the "don't be evil" mantra.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurylang.org/archives/users/attachments/20120414/b040165b/attachment.html>


More information about the users mailing list