From: Brian Hurt <bhurt@janestcapital.com>
To: Robert Fischer <robert.fischer@SmokejumperIT.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] tail rec
Date: Mon, 21 May 2007 10:00:10 -0400 [thread overview]
Message-ID: <4651A5EA.8080702@janestcapital.com> (raw)
In-Reply-To: <46519EDF.5060505@SmokejumperIT.com>
Robert Fischer wrote:
>
>> I'm repeating my suggestion: extend the typing annotation (produced
>> by -dtypes) to flag every tail recursive call, and have the emacs
>> mode and ocamlbrowser display every tail call particularily (e.g. in
>> a different color or font).
>>
>> This don't require any additional language construct.
>>
>
> Oh, then we're cool. :-D
>
>> Also, tail recursion is IMHO a beginner's puzzle. I'm pretty sure
>> every experimented Ocaml programmer does know inside his code what
>> are his tail recursive calls.
>>
>
> If you asked me to point them out, I could. If you asked me if a
> given function is tail recursive, I could tell you. I also use tail
> recursive calls unintentionally, and (while I realize now that you're
> not proposing this) I was concerned my code suddenly wouldn't compile
> because I didn't happen to tag a tail recursion.
Most of the time you don't care wether a particular call is a tail call
or not.
I will comment: in my experience, new programmers make simple mistakes
for simple reasons, while experienced programmers make simple mistakes
for complicated reasons.
Actually, I can see uses for this, even for experienced, knowlegable
programmers. For example, I can imagine scenarios where, during
maintainance, a try/catch block is introduced, making a tail call that
needed to be a tail call into a non-tail call. Opps. I don't think
this happens all that often, so it's not that valuable to experienced
programmers, but every little bit of correctness helps.
Brian
next prev parent reply other threads:[~2007-05-21 14:00 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-19 2:56 skaller
2007-05-19 5:00 ` [Caml-list] " Erik de Castro Lopo
2007-05-19 5:28 ` Basile STARYNKEVITCH
2007-05-19 12:58 ` skaller
2007-05-19 20:19 ` Jonathan Bryant
2007-05-19 21:55 ` Erik de Castro Lopo
2007-05-19 22:13 ` skaller
2007-05-19 14:28 ` Oliver Bandel
2007-05-19 14:46 ` Oliver Bandel
2007-05-19 16:06 ` skaller
2007-05-21 12:57 ` Brian Hurt
2007-05-21 13:04 ` Robert Fischer
2007-05-21 13:21 ` Basile STARYNKEVITCH
2007-05-21 13:30 ` Robert Fischer
2007-05-21 14:00 ` Brian Hurt [this message]
2007-05-21 13:47 ` Daniel Bünzli
2007-05-21 14:24 ` Christopher L Conway
2007-05-21 14:36 ` Jon Harrop
2007-05-21 14:49 ` Richard Jones
2007-05-21 14:42 ` ocaml faq (was [Caml-list] tail rec) Daniel Bünzli
2007-05-21 15:09 ` Christopher L Conway
2007-05-21 15:17 ` Robert Fischer
2007-05-21 15:27 ` Daniel Bünzli
2007-05-21 16:23 ` Richard Jones
2007-05-21 16:59 ` Robert Fischer
2007-05-21 16:26 ` Richard Jones
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=4651A5EA.8080702@janestcapital.com \
--to=bhurt@janestcapital.com \
--cc=caml-list@inria.fr \
--cc=robert.fischer@SmokejumperIT.com \
/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