[mercury-users] references

Michael Day mcda at cat.cs.mu.OZ.AU
Tue Jan 25 00:50:15 AEDT 2000


Hi,

when APIs such as the W3C Document Object Model call for returning a
"live list" of objects, how is that best implemented in Mercury? It seems
that references and a store could be used and with some helper functions
wouldn't be too messy. Perhaps threading a document through the code in
question, as it would need to be non-backtrackable anyway if it was merely
a Mercury wrapper around a foreign language library.

Anyone tried DOM stuff in Mercury before? On a slightly wackier note,
anyone considered embedding Mercury in a browser?

<!-- assumes all functions are called in a DCG context, with the document
as the hidden argument -->

<H2 onClick="makeBlue(this)">The Mercury Language</H2>

<SCRIPT LANGUAGE="Mercury">

:- import_module w3c__dom;

:- func makeBlue(element, document, document) = bool.
:- mode makeBlue(in, di, uo) = out is det.

onClick(Element) -->
	setStyleColor(Element, "blue").

</SCRIPT>

Just a thought...

Michael

--------------------------------------------------------------------------
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