Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] mutually referencing compilation units
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-09-16 (10:19)
From: Quetzalcoatl Bradley <qbradley@b...>
Subject: [Caml-list] function polymorphic in number of arguments?

Is it possible to make a function of N arguments (3 or more), the first 
two are functions of N-2 arguments, and the function calls the first 
two functions passing its remaining arguments to each of the first two 
functions.  For example

let f1 x = print_string (x ^ "1\n");;
let f2 x = print_string (x ^ "2\n");;

let f a b x = ??? What goes here ???

f f1 f2 "abc";;

result in


The trick part is I want the same function f to work if I pass it f1 
and f2 of 2 arguments and pass 4 arguments to f, f1, f2, and two others 
that get passed to f1 and f2.

Thanks for your time,

Quetzalcoatl Bradley
To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: