* [Caml-list] Infix operator @ 2004-07-05 21:30 Alexsandro Soares 2004-07-05 22:02 ` Jon Harrop 0 siblings, 1 reply; 5+ messages in thread From: Alexsandro Soares @ 2004-07-05 21:30 UTC (permalink / raw) To: caml-list Hi all, Is there any way to define infix operators in OCaml? Cheers, Alex _______________________________________________________ Yahoo! Mail agora com 100MB, anti-spam e antivírus grátis! http://br.info.mail.yahoo.com/ ------------------- 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] 5+ messages in thread
* Re: [Caml-list] Infix operator 2004-07-05 21:30 [Caml-list] Infix operator Alexsandro Soares @ 2004-07-05 22:02 ` Jon Harrop 2004-07-05 22:08 ` Richard Jones 0 siblings, 1 reply; 5+ messages in thread From: Jon Harrop @ 2004-07-05 22:02 UTC (permalink / raw) To: caml-list On Monday 05 July 2004 22:30, you wrote: > Hi all, > Is there any way to define infix operators in > OCaml? Yes. This is described in the excellent book "Developing applications with objective Caml" in the "Functional core of Objective CAML" chapter, on page 25 under the heading "Declaration of infix functions". This book is freely available in electronic form here: http://caml.inria.fr/oreilly-book/html/index.html Basically, use only symbols in infix function names and define the function using the syntax: # let ( ++ ) c1 c2 = (fst c1)+(fst c2), (snd c1)+(snd c2);; val ( ++ ) : int * int -> int * int -> int * int = <fun> # (2, 3) ++ (3, 4);; - : int * int = (5, 7) Cheers, Jon. ------------------- 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] 5+ messages in thread
* Re: [Caml-list] Infix operator 2004-07-05 22:02 ` Jon Harrop @ 2004-07-05 22:08 ` Richard Jones 2004-07-05 23:01 ` Benjamin Geer 0 siblings, 1 reply; 5+ messages in thread From: Richard Jones @ 2004-07-05 22:08 UTC (permalink / raw) Cc: caml-list On Mon, Jul 05, 2004 at 11:02:31PM +0100, Jon Harrop wrote: > http://caml.inria.fr/oreilly-book/html/index.html Is this book really published by O'Reilly? Rich. -- Richard Jones. http://www.annexia.org/ http://www.j-london.com/ Merjis Ltd. http://www.merjis.com/ - improving website return on investment C2LIB is a library of basic Perl/STL-like types for C. Vectors, hashes, trees, string funcs, pool allocator: http://www.annexia.org/freeware/c2lib/ ------------------- 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] 5+ messages in thread
* Re: [Caml-list] Infix operator 2004-07-05 22:08 ` Richard Jones @ 2004-07-05 23:01 ` Benjamin Geer 2004-07-06 4:59 ` skaller 0 siblings, 1 reply; 5+ messages in thread From: Benjamin Geer @ 2004-07-05 23:01 UTC (permalink / raw) To: Richard Jones; +Cc: caml-list Richard Jones wrote: > Is this book really published by O'Reilly? The French version is published by O'Reilly France, but the English translation hasn't been published. I recently asked the head office why they haven't published anything in English about functional languages, and they said it was because books on functional languages didn't sell very well. Ben ------------------- 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] 5+ messages in thread
* Re: [Caml-list] Infix operator 2004-07-05 23:01 ` Benjamin Geer @ 2004-07-06 4:59 ` skaller 0 siblings, 0 replies; 5+ messages in thread From: skaller @ 2004-07-06 4:59 UTC (permalink / raw) To: Benjamin Geer; +Cc: Richard Jones, caml-list On Tue, 2004-07-06 at 09:01, Benjamin Geer wrote: > Richard Jones wrote: > > Is this book really published by O'Reilly? > I recently asked the head office why > they haven't published anything in English about functional languages, > and they said it was because books on functional languages didn't sell > very well. .. they surely can't if they're not published ;( -- John Skaller, mailto:skaller@users.sf.net voice: 061-2-9660-0850, snail: PO BOX 401 Glebe NSW 2037 Australia Checkout the Felix programming language http://felix.sf.net ------------------- 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] 5+ messages in thread
end of thread, other threads:[~2004-07-06 4:59 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2004-07-05 21:30 [Caml-list] Infix operator Alexsandro Soares 2004-07-05 22:02 ` Jon Harrop 2004-07-05 22:08 ` Richard Jones 2004-07-05 23:01 ` Benjamin Geer 2004-07-06 4:59 ` skaller
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox