From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.6.10/8.6.6) id MAA22962 for caml-redistribution; Thu, 23 May 1996 12:04:17 +0200 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.6.10/8.6.6) with ESMTP id HAA10700 for ; Wed, 22 May 1996 07:00:30 +0200 Received: from kurims.kurims.kyoto-u.ac.jp ([130.54.16.1]) by concorde.inria.fr (8.7.1/8.7.1) with ESMTP id HAA26749 for ; Wed, 22 May 1996 07:00:27 +0200 (MET DST) Received: from cinnamon.kurims.kyoto-u.ac.jp (cinnamon.kurims.kyoto-u.ac.jp [130.54.16.38]) by kurims.kurims.kyoto-u.ac.jp (8.7.3/3.4W2) with SMTP id OAA24670 for ; Wed, 22 May 1996 14:00:22 +0900 (JST) From: Jacques GARRIGUE Date: Wed, 22 May 96 14:00:21 JST Message-Id: <9605220500.AA17174@cinnamon> To: caml-list@pauillac.inria.fr Subject: O'Labl and LablTk/O'Labl released Sender: weis Jacques Garrigue and Jun P. Furuse are glad to announce the First release of Ojective Label and LablTk/O'Labl ================================ Objective Label 1.00 is the selective label and (this was not not in Label Special Light) polymorphic variant extension of Objective Caml 1.00. You may use labeled and optional arguments, as well as variant "tags", in your programs, both in functions and methods. See the example at the end of this message The adaptation is: * complete: both the bytecode and native code compiler are available, with all the associated tools. Original O'Caml programs can directly be compiled and integrated with O'Labl code. Labels were added to the standard library and all libraries of the O'Caml distribution. * efficient: the cost of using labels is zero, that of using optional arguments is neglectible. Polymorphic variants compete in efficiency with declared ones. * theoretically sound: proofs are available. Labels and variants are no new paradigm: your programs are still functional, they are just much more readable, easier to maintain and to adapt by others. By permitting free ordering of arguments, labels also let you choose a better layout for your code, and avoid the confusing use of "junk" local definitions: functions defined but used only once. * * * LablTk extends CamlTk, using both labeled and optional arguments to give a better interface to Tcl/Tk. This is not only a good example of applications of labels and optional arguments, but thanks to these new features and polymorphic variants, the programs written using it become much more type safe and Tcl/Tk like than CamlTk. With LablTk comes LablBrowser, a compiled interface viewer and source file editor. One can retrieve function in the library by its path, name, or type. This is the natural companion of the O'Labl programmer. Examples contain also the Tetris game :-) * * * To download O'Labl and LablTk/O'Labl, two URLs: http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/ ftp://ftp.kurims.kyoto-u.ac.jp/pub/lang/olabl/ * * * Examples: with labels #let rec sort order:cmp = function # [] -> [] # | [a] -> [] # | a::l -> # let l1,l2 = List.fold_left l st:([],[]) # fun:(fun x st:(l1,l2) -> # if cmp x a then x::l1, l2 else l1, x::l2) # in (sort l1 order:cmp) @ a :: (sort l2 order:cmp) val sort : order:('a -> 'a -> bool) -> 'a list -> 'a list #sort [1;4;3] order:(<);; - : int list = [1; 3; 4] with optional arguments #let sort ?order:cmp [< (<) >] = sort order:cmp val sort : ?order:('a -> 'a -> bool) -> 'a list -> 'a list #sort [1;4;3];; - : int list = [1; 3; 4] #sort [1;4;3] order:(>);; - : int list = [4; 3; 1] with variants #let l = [`on; `off];; val l : [> off on] list = [`on; `off] #let f = function `on -> 1 | `off -> 0 | `number n -> n;; val f : [< number(int) off on] -> int #List.map fun:f l;; - : int list : [1; 0] with Tcl/Tk: button .hello -text "Hello, TclTk!" -font "variable" pack .hello with LablTk: let top = openTk () let hello = Button.create parent:top text:"Hello, LablTk!" font:"variable" let _ = pack [hello] The type of Button.create contains all the possible options for a button widget: no possibility of run-time error. You can omit part of them, or even all.