From: Jacques GARRIGUE <garrigue@kurims.kyoto-u.ac.jp>
To: caml-list@pauillac.inria.fr
Subject: Label Special Light and LablTk
Date: Wed, 6 Mar 96 22:32:30 JST [thread overview]
Message-ID: <9603061332.AA14161@pepper> (raw)
Jacques Garrigue and Jun P. Furuse are glad to announce the First release of
Label Special Light and LablTk
==============================
Label Special Light 1.14 is the selective label extension of Caml
Special Light 1.14. You may use labeled and optional arguments in your
programs. 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 CSL programs
can directly be compiled and integrated with LSL code. Labels were
added to the standard library and all libraries of the CSL
distribution.
* efficient: the cost of using labels is zero, that of using
optional arguments is neglectible.
* theoretically sound: proofs are available.
Labels are not a 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 also 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 LSL
programmer.
* * *
To download LSL and LablTk:
Available through http://wwwfun.kurims.kyoto-u.ac.jp/soft/lsl/.
* * *
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 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.
---------------------------------------------------------------------------
Jacques Garrigue Kyoto University garrigue@kurims.kyoto-u.ac.jp
<A HREF=http://wwwfun.kurims.kyoto-u.ac.jp/~garrigue/>JG</A>
reply other threads:[~1996-03-07 11:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9603061332.AA14161@pepper \
--to=garrigue@kurims.kyoto-u.ac.jp \
--cc=caml-list@pauillac.inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox