* RE: Seeking pratical tutorial or examples.
@ 2000-10-17 19:21 Brent Fulgham
0 siblings, 0 replies; 15+ messages in thread
From: Brent Fulgham @ 2000-10-17 19:21 UTC (permalink / raw)
To: Chris Hecker; +Cc: caml-list
> >Could it be that your mind is merely reeling from the unfamiliar
> >functional programming paradigm? Those of use "raised" in the school
> >of procedural C programming, or working in the Dot-Com trenches in
> >Perl are used to thinking in terms of step 1, step2, ..., etc.
>
> Uh, speaking for myself, I think this comment is a really
> good way to turn off people interested in exploring ocaml.
> There's a difference between "my mind is reeling" and "I'm
> trying to figure out where I need to put a damn semicolon".
>
Yikes -- I can see my attempt at humor was a dud. I was just trying
to see if his problems were similar to the confusion I felt when
dealing with functional programming after many years using the
procedural style. I apologize if I've offended anyone! :-\
> The fact of the matter is that there is a certain amount of
> logistical stuff one has to do to get a program to compile in
> any new language. We're (or I am) asking for examples of
> that in the main docs. I had to go download a bunch of
> sample programs from unrelated sites to see how to do it.
>
By all means -- if the information is not easily found, it should
be included in the documentation.
-Brent
^ permalink raw reply [flat|nested] 15+ messages in thread
[parent not found: <20001019101803A.garrigue@kurims.kyoto-u.ac.jp>]
* Re: Seeking pratical tutorial or examples.
[not found] <20001019101803A.garrigue@kurims.kyoto-u.ac.jp>
@ 2000-10-19 19:02 ` Francisco Reyes
0 siblings, 0 replies; 15+ messages in thread
From: Francisco Reyes @ 2000-10-19 19:02 UTC (permalink / raw)
To: Jacques Garrigue; +Cc: caml-list
On Thu, 19 Oct 2000 10:18:03 +0900, Jacques Garrigue wrote:
>Caml-light has a wonderful example directory in the distribution.
>I join the README as attachment. Even as is, this can help you.
Thanks for the README.
Pierre mentioned he is going to port the examples to Ocaml.
>Actually, the only examples in the distribution is a few samples
>in the otherlibs/labltk subdirectory, that I'm afraid very few
>people really know about.
They also may not be a good entry point for total newcomers.
The examples from the CamlLight distribution seem like the right
type. Simple yet complete enough to see a combination of
different topics (loops, input from user, etc..).
>There are good reasons why Objective Caml documentation cannot match
>that of bigger projects,
Which are?
Need for more volunteers?
It is a cycle. The easier we make it for new people to join, the
more people we have to help with the documentation.
>but since plenty of examples are available,
>just making them easier to find would be a big help to beginner and
>intermediate programmers.
Yes. Much of the documentation would make much more sense if one
had a few examples to read. This is particularly the case for
the syntax of functions on the Standard Library (Chaper 19 of
the Ocaml Manual)
>
>Jacques Garrigue
>---------------------------------------------------------------------------
>Jacques Garrigue Kyoto University garrigue at kurims.kyoto-u.ac.jp
> <A HREF=http://wwwfun.kurims.kyoto-u.ac.jp/~garrigue/>JG</A>
>
francisco
Moderator of the Corporate BSD list
http://www.egroups.com/group/BSD_Corporate
^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: Seeking pratical tutorial or examples.
@ 2000-10-16 21:46 Brent Fulgham
2000-10-17 10:10 ` Francisco Reyes
2000-10-17 17:51 ` Chris Hecker
0 siblings, 2 replies; 15+ messages in thread
From: Brent Fulgham @ 2000-10-16 21:46 UTC (permalink / raw)
To: fran; +Cc: caml-list
Francisco (and others),
Could it be that your mind is merely reeling from the unfamiliar
functional programming paradigm? Those of use "raised" in the school
of procedural C programming, or working in the Dot-Com trenches in
Perl are used to thinking in terms of step 1, step2, ..., etc.
Those of us who have at least been exposed to Lisp or Scheme have
a leg up, because we were forced to think recursively and look at
a program's output as the result of the evaulation of functions.
You are probably right that some code snippets might be helpful,
but many of the references you site include many such examples.
Pierre Weis has already listed the references I have used to reach
my current novice-state familiarity with Caml, and you would be
well served to examine those documents.
I would also highly recommend Cousineau and Mauny's excellent
"The Functional Approach to Programming". While not a Caml
tutorial, it teaches you the language as you go, and has the
added benefit of teaching you about functional programming.
If you like the venerable "Structure and Interpretation of
Computer Programming", this will be right up your alley. Cousineau
and Mauny also include lots of useful examples of things like
quicksort (using Caml's functional approach, then again in a
more procedural way to contrast), parsing systems, tree traversal,
graphs, and more. Highly recommended.
And of course, have fun!
-Brent
^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: Seeking pratical tutorial or examples.
2000-10-16 21:46 Brent Fulgham
@ 2000-10-17 10:10 ` Francisco Reyes
2000-10-17 17:51 ` Chris Hecker
1 sibling, 0 replies; 15+ messages in thread
From: Francisco Reyes @ 2000-10-17 10:10 UTC (permalink / raw)
To: Brent Fulgham; +Cc: caml-list
On Mon, 16 Oct 2000 14:46:14 -0700, Brent Fulgham wrote:
>Could it be that your mind is merely reeling from the unfamiliar
>functional programming paradigm? Those of use "raised" in the school
>of procedural C programming, or working in the Dot-Com trenches in
>Perl are used to thinking in terms of step 1, step2, ..., etc.
Probably true, but one wants to get productive with tools
quickly.
I have to check the FAQ links that Pierre sent, but so far I
have found little that prepares the new user to be productive on
a rush.
francisco
Moderator of the Corporate BSD list
http://www.egroups.com/group/BSD_Corporate
^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: Seeking pratical tutorial or examples.
2000-10-16 21:46 Brent Fulgham
2000-10-17 10:10 ` Francisco Reyes
@ 2000-10-17 17:51 ` Chris Hecker
2000-10-18 5:58 ` Francisco Reyes
1 sibling, 1 reply; 15+ messages in thread
From: Chris Hecker @ 2000-10-17 17:51 UTC (permalink / raw)
To: Brent Fulgham, fran; +Cc: caml-list
>Could it be that your mind is merely reeling from the unfamiliar
>functional programming paradigm? Those of use "raised" in the school
>of procedural C programming, or working in the Dot-Com trenches in
>Perl are used to thinking in terms of step 1, step2, ..., etc.
Uh, speaking for myself, I think this comment is a really good way to turn off people interested in exploring ocaml. There's a difference between "my mind is reeling" and "I'm trying to figure out where I need to put a damn semicolon".
The fact of the matter is that there is a certain amount of logistical stuff one has to do to get a program to compile in any new language. We're (or I am) asking for examples of that in the main docs. I had to go download a bunch of sample programs from unrelated sites to see how to do it.
You can take that as constructive criticism or you can decide my mind is reeling and write it off. Your choice.
Chris
^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: Seeking pratical tutorial or examples.
2000-10-17 17:51 ` Chris Hecker
@ 2000-10-18 5:58 ` Francisco Reyes
0 siblings, 0 replies; 15+ messages in thread
From: Francisco Reyes @ 2000-10-18 5:58 UTC (permalink / raw)
To: Brent Fulgham, Chris Hecker; +Cc: caml-list
On Tue, 17 Oct 2000 10:51:01 -0700, Chris Hecker wrote:
>>Could it be that your mind is merely reeling from the unfamiliar
>>functional programming paradigm?
>The fact of the matter is that there is a certain amount of
>logistical stuff one has to do to get a program to compile in
>any new language.
Exactly.
>We're (or I am) asking for examples of that in the main docs.
I think if we create them it would be much easier for us to ask
someone to include a link and then everyone will be happy. :-)
Of course I am just getting into undertanding Ocaml, so I may
provide some semi-trivial to start and then as I advance I can
produce better examples.
Also a lot of the examples are school/math theory oriented
(factorial, fibonaci, etc...) instead of simple examples which
anyone could understand even if they have little/no mathematical
background.
francisco
Moderator of the Corporate BSD list
http://www.egroups.com/group/BSD_Corporate
^ permalink raw reply [flat|nested] 15+ messages in thread
* OCaml sync tool for Rex organizer
@ 2000-10-14 15:59 bcpierce
2000-10-16 0:52 ` Seeking pratical tutorial or examples Francisco Reyes
0 siblings, 1 reply; 15+ messages in thread
From: bcpierce @ 2000-10-14 15:59 UTC (permalink / raw)
To: caml-list
The other day someone showed me a Rex organizer -- a $100 PDA in the form
of a PCMCIA card with 512K memory, a small LCD display on the front, and
a few buttons for navigation. I was instantly hooked, bought one, and
started looking around for Linux support for it. Of course, the end of
the story was that, after looking at what a few people had done, I got a
hack attack and ended by writing my own... in OCaml, obviously. Now I
can dump all my favorite data (addresses and arbitrary text files) in
seconds to an organizer the size of a credit card.
It's nothing fancy, but in the interests of helping others have fun and
waste time, here it is (in its entirety)...
Share and enjoy,
Benjamin
(* bcprex.ml -- A little hack for downloading data to a Xircom Rex
organizer from a linux system.
Author: Benjamin C. Pierce
This code may be distributed under the terms of the GNU Public License.
This _very simple and unpolished_ little program takes all the
information in the directory where it is started and formats it so
that it can be downloaded to a Xircom Rex organizer. It handles just
the features I needed, and no more. You will probably need to hack
it yourself to adapt it to your needs.
WHAT YOU WILL NEED:
1) A Xircom RexPro organizer (buy from your favorite gadget store;
they cost about $100)
2) A copy of the "TruSync linux beta developer pack" from StarFish
software. Download this from
http://www.starfish.com/tsdn/linux.html
unpack it, and put the binary file ProConnect somewhere in your
search path.
3) An Objective Caml compiler to compile this file. Download the
O'Caml system from http://caml.inria.fr and install according to
the instructions. (If you haven't installed O'Caml before, it's
easy. RPMs are provided for Redhat systems.)
INSTRUCTIONS:
1) Compile the present file like this:
ocamlc -o bcprex unix.cma str.cma bcprex.ml -cclib -lunix
2) Put the executable file bcprex in your search path
3) Cd to the directory where you will keep the files you want to download
to the rex
4) Initialize the Rex (if you haven't already): tell it your name,
the current time, etc.
5) Insert the Rex card in your PCMCIA slot
6) Check that /dev/mem0c now exists. If it does, make sure that
it's readable by ProConnect, either by doing
chmod a+rw /dev/mem0c
or by making ProConnect itself owned by root and setuid.
7) Upload the current state by typing
ProConnect -o init.rexdump -f /dev/mem0c
8) Create some files that you want to download (see information
below on formats)
9) Download your data by executing 'bcprex' (from in this directory)
SUPPORTED FORMATS:
* TEXT FILES with extension .txt are downloaded as Rex memos. The first
line of the file is used as the title of the memo, the rest as the
body.
* VCARD FILES with extension .vcd are interpreted as lists of VCards
and downloaded as contact records. Each VCard looks like this:
BEGIN:VCARD
<fields>
END:VCARD
where each <field> can be:
N:lastname;firstname;middlename;title;suffix
(all fields optional, but the ; separators are required)
TEL;HOME:<number>
TEL;WORK:<number>
<FIELD>:<BODY>
where <FIELD> is any other field name and <BODY> is a
string terminated by a carriage return not immediately
followed by a space (a CR followed by a space is ignored).
Sample VCard:
BEGIN:VCARD
N:Smith;John;;;
TEL;WORK:123 222 3333
TEL;HOME:987 654 3210
ADR:222 Main St., Philadelphia, PA 19191
NOTE:Some information.
Some more information.
END:VCARD
The N, TEL;WORK, and TEL;HOME fields are treated specially. All other
fields are concatenated and dumped into the contact record as a note.
WISH LIST:
* It would be nice to download appointments as Rex calendar records
* At the moment, Rex categories are not supported in any way
* I couldn't figure out how to get a quote or hash character into the
Rex: the string escape convention in the TruSync thing seems
broken.
*)
open Printf
let outchan = ref None
let theoutchan() =
match !outchan with
None -> assert false
| Some(ch) -> ch
let emit s = output_string (theoutchan()) s
let emitln s = emit s; emit "\n"
let error s = print_string s; exit 1
let readdir f =
let dir = Unix.opendir f in
let rec loop files =
let f = try Unix.readdir dir with End_of_file -> "" in
if f="" then files
else if f="." || f=".." then loop files
else loop (f::files)
in
let files = loop [] in
Unix.closedir dir;
files
let rec trim s =
let l = String.length s in
if l=0 then s
else if s.[0]=' ' || s.[0]='\t' || s.[0]='\n' || s.[0]='\r' then
trim (String.sub s 1 (l-1))
else if s.[l-1]=' ' || s.[l-1]='\t' || s.[l-1]='\n' || s.[l-1]='\r' then
trim (String.sub s 0 (l-1))
else
s
let rec trimEnd s =
let l = String.length s in
if l=0 then s
else if s.[l-1]=' ' || s.[l-1]='\t' || s.[l-1]='\n' || s.[l-1]='\r' then
trimEnd (String.sub s 0 (l-1))
else
s
let readfile f =
try
let ch = open_in f in
let rec loop lines =
match
try Some(input_line ch) with End_of_file -> None
with
None -> List.rev lines
| Some(l) -> loop ((trimEnd l)::lines) in
let res = loop [] in
close_in ch;
res
with
Sys_error _ -> []
(* ---------------------------------------------------------------------- *)
let quotechar = Str.regexp "\""
let hashchar = Str.regexp "#"
let slashchar = Str.regexp "/"
let semichar = Str.regexp ";"
let escape s =
let s = Str.global_replace slashchar "//" s in
(* let s = Str.global_replace quotechar "/\"" s in *)
let s = Str.global_replace quotechar "'" s in
let s = Str.global_replace hashchar "<hash>" s in
s
let processMemo f =
printf "Memo %s\n" f;
let ll = readfile f in
let title = List.hd ll in
let body = List.tl ll in
emit (sprintf "memo 1 \"%s\" \"" title);
List.iter (fun l -> emit (escape l); emit " #\n") body;
emit "\"\n"
(* ---------------------------------------------------------------------- *)
let collectVCards ll =
let rec nextCard cards = function
[] -> List.rev cards
| "BEGIN:VCARD" :: rest -> nextField cards [] rest
| "" :: rest -> nextCard cards rest
| s :: rest -> error (sprintf "Unrecognized vcard format: %s\n" s)
and nextField cards fields = function
[] -> error "End of file while processing a VCARD"
| "END:VCARD"::rest -> nextCard ((List.rev fields)::cards) rest
| ""::rest -> nextField cards fields rest
| s::rest when s.[0] = ' ' ->
if fields=[] then
error "Line beginning with blank at beginning of VCARD"
else
nextField cards (((List.hd fields) ^ s) :: (List.tl fields)) rest
| s::rest ->
nextField cards (s::fields) rest
in nextCard [] ll
let notes = ref ""
let dumpfield f =
let colonpos =
try
String.index f ':'
with Not_found ->
error (sprintf "VCard field '%s' does not contain a colon" f) in
let kind = String.sub f 0 colonpos in
let body =
escape (String.sub f (colonpos+1) (String.length f - colonpos - 1)) in
match kind with
"N" ->
let parts = Str.split_delim semichar body in
if List.length parts <> 5 then
error (sprintf "VCARD name field should have five (not %d) parts (%s)"
(List.length parts) body);
emit " 1 0 \"";
emit (List.nth parts 0);
emit "\"\n";
emit " 2 0 \"";
if (List.nth parts 1) <> "" then begin
emit (List.nth parts 1);
emit " ";
end;
emit (List.nth parts 2);
if (List.nth parts 3) <> "" then begin
emit " ";
emit (List.nth parts 3);
end;
if (List.nth parts 4) <> "" then begin
emit " ";
emit (List.nth parts 4);
end;
emit "\"\n";
| "TEL;WORK" ->
emit " 17 0 \"";
emit body;
emit "\"\n"
| "TEL;HOME" ->
emit " 18 0 \"";
emit body;
emit "\"\n"
| _ ->
notes := !notes ^ " || " ^ body
let dumpnotes() =
if !notes <> "" then begin
emit " 0 0 \"";
emit !notes;
emit "\"\n";
end;
notes := ""
let dumpcard c =
emit "contact 1 0\n";
List.iter dumpfield c;
dumpnotes()
let processAddresses f =
List.iter dumpcard (collectVCards (readfile f))
(* ---------------------------------------------------------------------- *)
let processfile f =
if Filename.check_suffix f ".txt" then processMemo f
else if Filename.check_suffix f ".sp" then processMemo f
else if Filename.check_suffix f ".todo" then processMemo f
else if Filename.check_suffix f ".vcd" then processAddresses f
else printf "Skipping %s\n" f
let initrex() =
let init = readfile "init.rexdump" in
List.iter emitln init
let main() =
outchan := Some(open_out "rexdump.tmp");
initrex();
let files = readdir "." in
List.iter processfile files;
emit "done\n";
close_out (theoutchan());
flush stdout;
(*
let ll = readfile "rexdump.tmp" in
List.iter (fun l -> print_string l; print_newline()) ll
*)
let result = Sys.command "ProConnect -i rexdump.tmp -f /dev/mem0c" in
if result <> 0 then printf "ProConnect failed with exit code %d\n" result;
exit result
;; main()
^ permalink raw reply [flat|nested] 15+ messages in thread
* Seeking pratical tutorial or examples.
2000-10-14 15:59 OCaml sync tool for Rex organizer bcpierce
@ 2000-10-16 0:52 ` Francisco Reyes
2000-10-16 5:42 ` Alan Schmitt
2000-10-16 7:49 ` Pierre Weis
0 siblings, 2 replies; 15+ messages in thread
From: Francisco Reyes @ 2000-10-16 0:52 UTC (permalink / raw)
To: caml-list
I have looked at the caml site, the hump and all I links I could
find from the main site.
So far the manuals/tutorials I have seen did not "quick start"
my development intentions.
I am looking for a pratical tutorial or some simple beginner
examples. After days of reading the manuals I am yet to be able
to write even a simple program. Even when I skip sections on the
manuals they still don't offer anything beyond Syntax.
Isn't there a code snippet/samples page?
What I have tried so far are the intro on the Ocaml Manual, the
"Functional Programming using Caml light" and "One hundred lines
of Caml".
Comments on the 3 sources I mentioned above:
** Ocaml Manual: The intro is not bad, except that for those of
us coming from languages without a built in interactive system
we may not be as interested to start with that. Why? because
although great for learning it is of not much use unless we just
want to try simple things. It also falls short of giving enough
info to get one started.
I think the following order may be more benefitial to someone
coming from languages such as C/pascal.
-Start by having something which shows a compiled program and a
few basic statements (i.e. ask for name and then print hello
<name>.
-Cover data types and show the functions to read them and
display them. No fancy explanation about "channels" just give
examples using print functions and whatever is used to read info
into a variable.
-Loops and branching: "for" and "if"
-Cover functions
-Basic file I/O
-String handling
-More advanced data structures/types: arrays, user defined data
types, lists.
-The interactive system
And of course on all those steps start showing the user the way
things are written in Ocaml and how things are called in it.
** Functional Programming using Caml Light
I am up to chapter 5 and I am yet to dream of how to actually
write a complete program. Even after I jumped chapters ahead to
chapter 9, Basic I/O, there are one line descriptions or trivial
use of the fucntions, but I didn't even see a simple brief
program to show all elements together. The document almost seems
like reference material, except that it is too
descriptive/narrative to be that.
** One Hundred lines of Ocaml: This is enough to give a "taste"
of the language, but far from been enough to start hacking.
Have a missed a kinder/gentler tutorial somewhere?
Somewhere on the caml site I saw a mention about a series of
examples that come with the compiler. The FreeBSD port I got
didn't have them and I was unable to find them on the web site
(caml.inria.fr)
francisco
Moderator of the Corporate BSD list
http://www.egroups.com/group/BSD_Corporate
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Seeking pratical tutorial or examples.
2000-10-16 0:52 ` Seeking pratical tutorial or examples Francisco Reyes
@ 2000-10-16 5:42 ` Alan Schmitt
2000-10-16 11:20 ` Francisco Reyes
2000-10-16 7:49 ` Pierre Weis
1 sibling, 1 reply; 15+ messages in thread
From: Alan Schmitt @ 2000-10-16 5:42 UTC (permalink / raw)
To: Francisco Reyes; +Cc: caml-list
Hi,
If you speak French, the O'Reilly book (available online at
http://www.editions-oreilly.fr/divers/ocaml/cdrom.html ) is a great
source of examples.
Alan Schmitt
>I have looked at the caml site, the hump and all I links I could
>find from the main site.
>So far the manuals/tutorials I have seen did not "quick start"
>my development intentions.
>
>I am looking for a pratical tutorial or some simple beginner
>examples. After days of reading the manuals I am yet to be able
>to write even a simple program. Even when I skip sections on the
>manuals they still don't offer anything beyond Syntax.
>
>Isn't there a code snippet/samples page?
[..]
--
The hacker: someone who figured things out and made something cool happen.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Seeking pratical tutorial or examples.
2000-10-16 0:52 ` Seeking pratical tutorial or examples Francisco Reyes
2000-10-16 5:42 ` Alan Schmitt
@ 2000-10-16 7:49 ` Pierre Weis
2000-10-16 17:57 ` Chris Hecker
1 sibling, 1 reply; 15+ messages in thread
From: Pierre Weis @ 2000-10-16 7:49 UTC (permalink / raw)
To: fran; +Cc: caml-list
> I have looked at the caml site, the hump and all I links I could
> find from the main site.
[...]
In my mind, it seems as if you have completely missed the FAQ of the
language ...
> Isn't there a code snippet/samples page?
>
> What I have tried so far are the intro on the Ocaml Manual, the
> "Functional Programming using Caml light" and "One hundred lines
> of Caml".
>
> Comments on the 3 sources I mentioned above:
> ** Ocaml Manual: The intro is not bad, except that for those of
> us coming from languages without a built in interactive system
> we may not be as interested to start with that. Why? because
> although great for learning it is of not much use unless we just
> want to try simple things. [...]
Bizarre: you do not want to start by simple things ?
If you do want to start by material that are not ``simple things'',
you definitely have to read the pretty good bunch of examples that is
generally refered to as ``the Objective Caml compiler''. It is not
interactive, it is great for learning, and in some cases definitively
not simple (I would suggest the following road-map: start with the
Objective Caml libraries (directories stdlib and otherlibs), then
bravely start reading the compiler sources: first the Yacc parser and
its associated lexer (directory parsing), then take a breath and read
the type-checker (directory typing), breath again and continue with
the pattern matching compiler (directory bytecomp), then breath a lot
and end with the delicious native code compiler (directory asmcomp)).
> I think the following order may be more benefitial to someone
> coming from languages such as C/pascal.
Excellent: you are exactly describing the order of presentation of the
FAQ, that has been intended for just that kind of people. The first
page of the FAQ for beginners, has the following items entries, in
that order:
* What is the syntax of the language ?
* What are the basic data structures ?
* Numbers: integers and floating point numbers.
* Characters
* Character strings
* Arrays
* Lists
* Booleans
* Nothing
* References
* Pairs
* Other data structures
* What are the basic control structures ?
* How to perform a test ?
* How to perform a case analysis ?
* How to perform a test within a case analysis ?
* How to write a loop ?
* How to exit form a loop ? (break, exit, abort, return ...)
* How to catch errors ?
* How to signal errors (raise exceptions) ?
* What are the predefined exceptions (errors) ?
* How to define a function ?
* How to define a procedure ?
> -Start by having something which shows a compiled program and a
> few basic statements (i.e. ask for name and then print hello
> <name>.
http://pauillac.inria.fr/caml/FAQ/FAQ_DEBUTANT-eng.html#quellesyntaxe
> -Cover data types and show the functions to read them and
> display them. No fancy explanation about "channels" just give
> examples using print functions and whatever is used to read info
> into a variable.
http://pauillac.inria.fr/caml/FAQ/FAQ_DEBUTANT-eng.html#donnees_de_base-eng.html
> -Loops and branching: "for" and "if"
http://pauillac.inria.fr/caml/FAQ/FAQ_DEBUTANT-eng.html#controle_de_base-eng.html
While, match and exceptions are also covered.
> -Cover functions
http://pauillac.inria.fr/caml/FAQ/FAQ_DEBUTANT-eng.html#function_definition
> -Basic file I/O
http://pauillac.inria.fr/caml/FAQ/FAQ_DEBUTANT-eng.html#ios
Printing is also covered at:
http://pauillac.inria.fr/caml/FAQ/FAQ_DEBUTANT-eng.html#impression
> -String handling
http://pauillac.inria.fr/caml/FAQ/donnees_de_base-eng.html#strings
> -More advanced data structures/types: arrays, user defined data
> types, lists.
http://pauillac.inria.fr/caml/FAQ/donnees_de_base-eng.html#vects
http://pauillac.inria.fr/caml/FAQ/donnees_de_base-eng.html#lists
http://pauillac.inria.fr/caml/FAQ/qrg-eng.html
> -The interactive system
http://pauillac.inria.fr/caml/FAQ/
> And of course on all those steps start showing the user the way
> things are written in Ocaml and how things are called in it.
The same references, plus the Quick Reference Guide for Caml that
gives you the syntactic constructs along with examples:
http://pauillac.inria.fr/caml/FAQ/qrg-eng.html
> ** Functional Programming using Caml Light
> I am up to chapter 5 and I am yet to dream of how to actually
> write a complete program. Even after I jumped chapters ahead to
> chapter 9, Basic I/O, there are one line descriptions or trivial
> use of the fucntions, but I didn't even see a simple brief
> program to show all elements together. The document almost seems
> like reference material, except that it is too
> descriptive/narrative to be that.
Right. It is not a reference manual, although it describes a
type-checker and a compiler for (a subset of) Caml.
> ** One Hundred lines of Ocaml: This is enough to give a "taste"
> of the language, but far from been enough to start hacking.
Right, it just appears in the FAQ under the title:
A taste of Caml
> Have a missed a kinder/gentler tutorial somewhere?
May be the FAQ ?
> Somewhere on the caml site I saw a mention about a series of
> examples that come with the compiler. The FreeBSD port I got
> didn't have them and I was unable to find them on the web site
> (caml.inria.fr)
Those examples are written for Caml Light and burried from the book
``Le langage Caml''. I translated them into Objective Caml, but have
not linked them to the Caml web site, since there is no english
explanations on those examples (the book ``Le langage Caml'' has not
yet been translated into english).
> francisco
> Moderator of the Corporate BSD list
> http://www.egroups.com/group/BSD_Corporate
PS1: I hope you will find what you need in the FAQ. In any case,
please let me know if you have some addition to suggest to the FAQ's
tutorial.
PS2: Also, when you are writing your first big Caml programs, don't
miss the very relevant Caml Programming Guide Lines:
http://pauillac.inria.fr/caml/FAQ/pgl-eng.html
that also gives some useful hints on how to program in Caml.
Pierre Weis
Moderator of the Caml list
http://pauillac.inria.fr/caml/FAQ/
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Seeking pratical tutorial or examples.
2000-10-16 7:49 ` Pierre Weis
@ 2000-10-16 17:57 ` Chris Hecker
2000-10-17 17:40 ` Stefan Monnier
2000-10-18 5:52 ` Francisco Reyes
0 siblings, 2 replies; 15+ messages in thread
From: Chris Hecker @ 2000-10-16 17:57 UTC (permalink / raw)
To: Pierre Weis, fran; +Cc: caml-list
>> Isn't there a code snippet/samples page?
I think the ocaml docs are good, but I must agree with the original poster about one thing: there is a lack of small example programs that are meant to be _compiled_. That is, most of the examples use interactive mode. A few examples in particular would be good:
1. a single file ocaml program, and exactly how it's compiled with ocamlc and ocamlopt
2. a two file example, and how it's compiled (the .mli thing confused me for a while)
3. an example that uses an external C function
Since I wrote exactly these things, perhaps I should contribute them? I just found a lot of subtle things that were different between the interactive sessions and trying to write real code.
Chris
PS. Should the reply-to header on list messages be set to the list so threads don't accidently go private if somebody doesn't reply-all?
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Seeking pratical tutorial or examples.
2000-10-16 17:57 ` Chris Hecker
@ 2000-10-17 17:40 ` Stefan Monnier
2000-10-18 5:52 ` Francisco Reyes
1 sibling, 0 replies; 15+ messages in thread
From: Stefan Monnier @ 2000-10-17 17:40 UTC (permalink / raw)
To: caml-list
>>>>> "Chris" == Chris Hecker <checker@d6.com> writes:
> PS. Should the reply-to header on list messages be set to the list so
> threads don't accidently go private if somebody doesn't reply-all?
Please no. That makes it a pain when you really want to write a private reply.
The way it is now, you get to chose between "reply sender" and "reply all",
as Emacs intended it to be.
Stefan
--
I believe in Emacs.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Seeking pratical tutorial or examples.
2000-10-16 17:57 ` Chris Hecker
2000-10-17 17:40 ` Stefan Monnier
@ 2000-10-18 5:52 ` Francisco Reyes
2000-10-18 7:20 ` Chris Hecker
2000-10-18 13:31 ` Stephan Houben
1 sibling, 2 replies; 15+ messages in thread
From: Francisco Reyes @ 2000-10-18 5:52 UTC (permalink / raw)
To: Chris Hecker; +Cc: caml-list
On Mon, 16 Oct 2000 10:57:40 -0700, Chris Hecker wrote:
>Since I wrote exactly these things, perhaps I should contribute them?
>I just found a lot of subtle things that were different between the
>interactive sessions and trying to write real code.
Chris,
Would you be willing to work with me on a sample/code snippet
page?
For starters we could do it on our own page(s) and when we have
enough we can try and upload them to Sourceforge.net. This way
more people would find out about this language.
francisco
Moderator of the Corporate BSD list
http://www.egroups.com/group/BSD_Corporate
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Seeking pratical tutorial or examples.
2000-10-18 5:52 ` Francisco Reyes
@ 2000-10-18 7:20 ` Chris Hecker
2000-10-18 13:31 ` Stephan Houben
1 sibling, 0 replies; 15+ messages in thread
From: Chris Hecker @ 2000-10-18 7:20 UTC (permalink / raw)
To: Francisco Reyes; +Cc: caml-list
>Would you be willing to work with me on a sample/code snippet
>page?
Yes, I'm just beginning too, but between the two of us we can probably do a couple good examples. I'm working on transforming an array of 3D vectors, since it's a trivial thing to measure performance- and readability-wise. It's also kind of non-functional by nature, but there are ways of making it functional (map, etc.). I'm also comparing the performance to C code, so I'll have a nice set of examples and transformations on the initial codes to make them faster and/or more functional.
Chris
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Seeking pratical tutorial or examples.
2000-10-18 5:52 ` Francisco Reyes
2000-10-18 7:20 ` Chris Hecker
@ 2000-10-18 13:31 ` Stephan Houben
1 sibling, 0 replies; 15+ messages in thread
From: Stephan Houben @ 2000-10-18 13:31 UTC (permalink / raw)
To: Francisco Reyes, Francisco Reyes, Chris Hecker; +Cc: caml-list
On Wed, 18 Oct 2000, Francisco Reyes wrote:
> Chris,
>
> Would you be willing to work with me on a sample/code snippet
> page?
>
> For starters we could do it on our own page(s) and when we have
> enough we can try and upload them to Sourceforge.net. This way
> more people would find out about this language.
I once made a very small page that tries to explain some of the simplest
things about Ocaml (so as how to run the compiler, etc).
It's at: http://www.win.tue.nl/~stephanh/ocaml
Probably not very useful, but feel free to take anything you can use.
Stephan
--
ir. Stephan H.M.J. Houben
tel. +31-40-2474358 / +31-40-2743497
e-mail: stephanh@win.tue.nl
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2000-10-19 21:50 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-10-17 19:21 Seeking pratical tutorial or examples Brent Fulgham
[not found] <20001019101803A.garrigue@kurims.kyoto-u.ac.jp>
2000-10-19 19:02 ` Francisco Reyes
-- strict thread matches above, loose matches on Subject: below --
2000-10-16 21:46 Brent Fulgham
2000-10-17 10:10 ` Francisco Reyes
2000-10-17 17:51 ` Chris Hecker
2000-10-18 5:58 ` Francisco Reyes
2000-10-14 15:59 OCaml sync tool for Rex organizer bcpierce
2000-10-16 0:52 ` Seeking pratical tutorial or examples Francisco Reyes
2000-10-16 5:42 ` Alan Schmitt
2000-10-16 11:20 ` Francisco Reyes
2000-10-16 7:49 ` Pierre Weis
2000-10-16 17:57 ` Chris Hecker
2000-10-17 17:40 ` Stefan Monnier
2000-10-18 5:52 ` Francisco Reyes
2000-10-18 7:20 ` Chris Hecker
2000-10-18 13:31 ` Stephan Houben
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox