* (no subject)
@ 2002-10-16 14:07 climb
2002-10-17 0:58 ` [Caml-list] Re: how to start Alessandro Baretta
0 siblings, 1 reply; 3+ messages in thread
From: climb @ 2002-10-16 14:07 UTC (permalink / raw)
To: caml-list
Dear caml-list
i am a new commer of Caml language. and start with online mannul
i am confused at this sentence in Chapter 1
# type idref={ mutable id : 'a. 'a -> 'a};;
what does "." mean?
why i can not write
# type intidref= { mutable id : int. int->int};;
thanks
climb
onlyclimb@163.com
2002-10-16
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Caml-list] Re: how to start
2002-10-16 14:07 climb
@ 2002-10-17 0:58 ` Alessandro Baretta
0 siblings, 0 replies; 3+ messages in thread
From: Alessandro Baretta @ 2002-10-17 0:58 UTC (permalink / raw)
To: climb; +Cc: caml-list
climb wrote:
> Dear caml-list
>
> i am a new commer of Caml language.
Welcome on board!
> and start with online mannul
> i am confused at this sentence in Chapter 1
> # type idref={ mutable id : 'a. 'a -> 'a};;
> what does "." mean?
'a. 'a -> 'a
This is read as: "For every type 'a, a function from 'a to
'a". In this context 'a is a type variable. The type
variable preceding the "." are "universally quantified":
this is where the "For every type ..." comes into the game.
This basically states that the type of id is polymorphic: 'a
-> 'a is a type schema as opposed to a specific type. Many
different types fit this schema:
int -> int
string -> string
(int -> int) -> (int -> int), and so on.
The type schema 'a. 'a -> 'a is entirely equivalent to the
axiom schema of propositional calculus A => A: "If A then
A." A stands for *any* proposition, not for any one specific
proposition.
> why i can not write
> # type intidref= { mutable id : int. int->int};;
This does not make sense because "int" is a type value and
not a type variable.
Alex
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
^ permalink raw reply [flat|nested] 3+ messages in thread
* (no subject)
@ 2002-10-17 17:00 climb
2002-10-18 7:28 ` [Caml-list] Re: how to start Florian Hars
0 siblings, 1 reply; 3+ messages in thread
From: climb @ 2002-10-17 17:00 UTC (permalink / raw)
To: caml-list
Dear caml-list
Could you explain this senence for me in the Ocaml mannul in Using coerecions?
" When the domain of a coercion is left implicit and its co-domain is an abbreviation of a known class type, then the class type rather than the object type, is used to derive the coercion functions".
i am not quite clear the defintion of codomain , class type and object type respectively?
Best regards
Yours
climb
onlyclimb@163.com
2002-10-18
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Caml-list] Re: how to start
2002-10-17 17:00 climb
@ 2002-10-18 7:28 ` Florian Hars
0 siblings, 0 replies; 3+ messages in thread
From: Florian Hars @ 2002-10-18 7:28 UTC (permalink / raw)
To: climb; +Cc: caml-list
climb wrote:
> Could you explain this senence for me in the Ocaml mannul in Using coerecions?
Well, the correct answer to your last questions is probably:
Don't try to learn Ocaml from the reference manual.
It will tell you everything about the language, but not necessaryly in the
order you need to know it, and it doesn't tell you which parts of the language
are fundamental (core language, modules), optional (labels, objects) or arcane
(universal quantification, when to omit the first type in a coercion). Try the
tutorial by Jason Hickey first.
Note to INRIA: Describing the manual with "The Objective Caml manual begins
with short tutorials on the core language, objects and classes, and modules."
on the tutorials page is slightly misleading, those tutorials don't really add
up to an introduction to ocaml.
Yours, Florian.
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-10-18 7:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-16 14:07 climb
2002-10-17 0:58 ` [Caml-list] Re: how to start Alessandro Baretta
2002-10-17 17:00 climb
2002-10-18 7:28 ` [Caml-list] Re: how to start Florian Hars
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox