caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Basile STARYNKEVITCH <basile@starynkevitch.net>
To: <flaig@hallucinogene.sanctacaris.net>, <flaig@hablas.com>
Cc: caml-list@inria.fr
Subject: [Caml-list] newbie questions
Date: Sat, 29 Mar 2003 10:15:47 +0100	[thread overview]
Message-ID: <16005.25667.709552.511315@hector.lesours> (raw)
In-Reply-To: <20030329084839.BAF874C99@sitemail.everyone.net>

>>>>> "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:
http://caml.inria.fr/archives/200303/msg00289.html
http://caml.inria.fr/archives/200303/msg00399.html

    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
constructors

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


  reply	other threads:[~2003-03-29  9:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-29  8:48 Dr.Dr.Ruediger M.Flaig
2003-03-29  9:15 ` Basile STARYNKEVITCH [this message]
2003-03-29 11:04 ` Sylvain LE GALL
2003-03-30  9:53 ` Damien Doligez
2003-03-30 14:23 ` Wolfgang Lux
  -- strict thread matches above, loose matches on Subject: below --
2001-12-11  0:25 Jose A. Ortega Ruiz
2001-12-11  2:32 ` Mike Leary
2001-12-11 10:23 ` Sven
2001-08-22 17:58 Collin Monahan

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=16005.25667.709552.511315@hector.lesours \
    --to=basile@starynkevitch.net \
    --cc=caml-list@inria.fr \
    --cc=flaig@hablas.com \
    --cc=flaig@hallucinogene.sanctacaris.net \
    /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;
as well as URLs for NNTP newsgroup(s).