English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] newbie questions
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-03-29 (09:15)
From: Basile STARYNKEVITCH <basile@s...>
Subject: [Caml-list] newbie questions
>>>>> "Ruediger" == Dr Ruediger M Flaig <flaig@hablas.com> writes:

    Ruediger> Good morning to all you bedouins out there :-) , as I am
    Ruediger> a neophyte to CAML, forgive me if my questions have been
    Ruediger> asked (and answered) a hundred times before...

You might have checked in the mailing list archive before asking...

    Ruediger> 1.: Is there any means of doing list-type pattern
    Ruediger> matching (style "| h::t -> ...") for recursion on
    Ruediger> strings? [...]

unfortunately no. You cannot have pattern matching on strings.
But the Str module might help (it provides regular expressions).

See also recent postings on this issue:

    Ruediger> 2.: A question on language design: why do recursive
    Ruediger> functions have to be marked explicitly as such?  [...]

Any (syntactically non-recursive) *expression* can appear on the right
hand side of let bindings, but this is not true for let rec bindings
which are restriced (syntactically) to functions and constant

see http://caml.inria.fr/ocaml/htmlman/manual015.html for more

(Historical note; many other languages require syntactic marking of
recursions: Scheme, Fortran90, PL1, ...)


Basile STARYNKEVITCH         http://starynkevitch.net/Basile/ 
email: basile<at>starynkevitch<dot>net 
aliases: basile<at>tunes<dot>org = bstarynk<at>nerim<dot>net
8, rue de la Faïencerie, 92340 Bourg La Reine, France

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