Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Calling a function with a self-defined type as argument
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Oliver Bandel <oliver@f...>
Subject: Re: [Caml-list] Calling a function with a self-defined type as argument
On Wed, 21 Aug 2002, Oleg wrote:

> On Wednesday 21 August 2002 09:11 pm, Oliver Bandel wrote:
> 
> 
> ... because
> 
> > (*
> >    let _ = x Line "h0oifdaji oi" ;;
> >    This last one does not work: => "This function is applied to too many
> > arguments"
> 
> x is applied to 2 arguments
> 
> >    let _ = x Line( "reuruhjf" ) ;;
> >    This last one does not work: => "This function is applied to too many
> > arguments"
> 
> still 2 (no difference whatsoever)

But the Line ("text")-argument is only complete as a Line(),
if Line() has a higher priority than the function-call.
I have *one* argument, which is complete if given EMPTY,
and complete if given Line ("argument").

Shouldn't be types have a higher priority than calls
in this case?
Is Line() in this example handled like an ordinary function?

That is, what I think that it is a littlebid crazy.
I use the type-definition to put things together
nad use them as one type, but then it is handled
like a puzzle, before it is put together.
But I want here a complete picture, and I thought
the compiler would put the parts together: How to
put them together is clear: I have said it him in the
type-declaration.

Ciao,
   Oliver

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