* Re: How i can use a list in Caml Light language?
@ 1998-02-05 0:00 Draculia
1998-02-05 0:00 ` Brian Rogoff
0 siblings, 1 reply; 2+ messages in thread
From: Draculia @ 1998-02-05 0:00 UTC (permalink / raw)
In Caml light 07
once that I have created a list:
# let lista= 3::9::4::7::6::5::8::[];;
and I have inserted a new term (30)
the answer of the compiler is
-: int list = [30;3;9;4;7;6;5;8]
why if I require the value of list doing
# lista;;
the answer is
-: int list = [3;9;4;7;6;5;8]
or rather the list Lista?
The same with the function of cancellation!!
How I could create a function that given a list,
check that there are not 2 elements equal?
Please help me within febryary 10.
THANK YOU.
P.S.: Sorry for my english but i'm an italian boy
and my translator program is not good !
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: How i can use a list in Caml Light language?
1998-02-05 0:00 How i can use a list in Caml Light language? Draculia
@ 1998-02-05 0:00 ` Brian Rogoff
0 siblings, 0 replies; 2+ messages in thread
From: Brian Rogoff @ 1998-02-05 0:00 UTC (permalink / raw)
Among your many errors is the egregious one of posting a question entirely
about Caml to an Ada newsgroup. While I realize that there is a book in
French teaching programming using Caml and Ada, I see no Ada here.
That said, Caml lists are immutable, so if you want a new list with "30"
prepended, you'll have to say
let listb = 30::lista;;
and use that. You can figure out the rest of your homework yourself. I
suggest reading a very basic introduction to Caml, like
http://pauillac.inria.fr/caml/tutorial/index.html
-- Brian (who happens to like Ada and Caml :-)
On Thu, 5 Feb 1998 Draculia@usa.net wrote:
> In Caml light 07
> once that I have created a list:
>
> # let lista= 3::9::4::7::6::5::8::[];;
>
> and I have inserted a new term (30)
> the answer of the compiler is
>
> -: int list = [30;3;9;4;7;6;5;8]
>
> why if I require the value of list doing
>
> # lista;;
>
> the answer is
>
> -: int list = [3;9;4;7;6;5;8]
>
> or rather the list Lista?
>
> The same with the function of cancellation!!
>
> How I could create a function that given a list,
> check that there are not 2 elements equal?
>
> Please help me within febryary 10.
>
> THANK YOU.
>
> P.S.: Sorry for my english but i'm an italian boy
> and my translator program is not good !
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1998-02-05 0:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-02-05 0:00 How i can use a list in Caml Light language? Draculia
1998-02-05 0:00 ` Brian Rogoff
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox