[mercury-users] Symbols.....

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Oct 16 23:17:35 AEST 2002


On 16-Oct-2002, Noel  Pinto <cool4life at rediffmail.com> wrote:
> I want to know what is a symbol. The Mercury Language Refernce 
> Manual mentions items and builtin operators, but no where about 
> symbols.
>
> I came to know about that symbol exists when I got an error 
> because I had not imported the list module. But what is it 
> exactly??

A symbol is a "name" which refers to some entity.

The meaning of "name" is defined in the following sections
of the "Syntax" chapter of the Mercury language reference manual:
"Tokens", "Terms", and "Data-functors".

> At least I could not find it.

Which browser are you using?

If you are reading the info or HTML versions of the language
reference manual, a simple search command will find several
occurrences of the word "symbol".

However, I think you are right that this term is not *defined*
in the reference manual.

> In the manual,
> :- pred sum(list(int), int).
> :- mode sum(in, out) is det.
> 
> X = lambda([List::in, Length::out] is det, sum(List, Length))
> Y = (pred(List::in, Length::out) is det :- sum(List, Length))
> Z = sum
> 
> X, Y, Z are higher order terms. Similarly could you give me 
> examples with their explanation as to what is symbols??

In this example, `sum', `list', and `int' are symbols.

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