Learning Haskell makes you a better programmer?
Russel Winder
russel at winder.org.uk
Wed Dec 26 08:34:00 PST 2012
On Wed, 2012-12-26 at 11:03 -0500, Andrei Alexandrescu wrote:
> On 12/26/12 9:42 AM, Russel Winder wrote:
[…]
> > Does D do tail recursion optimisation?
>
> Yah, but not tail calls. (That should be on the list...)
I'll have to admit confusion from the above statement: tail calls are a
programmer technique, tail call optimization is a compiler / run time
technique. If a programmer uses tail calls and the compiler realizes
tail call optimization then the result is equivalent to iteration.
> > Can the D compiler check to enforce *NO* (or at the worst single)
> > assignment to a variable?
>
> Only for immutable data.
But isn't that the whole point, in functional programming there is only
immutable data. Thus a programming language that allows mutable data
cannot really be said to be usable for functional programming style.
On the other hand it is 2012-12-26T16:32 and nearly time for fireworks,
and drinkies. Hopefully everyone is having a peaceful and happy
Solstice/Xmas/New Year/Hogmanay/<insert your personal choice of excuse
for celebration>.
--
Russel.
=============================================================================
Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder at ekiga.net
41 Buckmaster Road m: +44 7770 465 077 xmpp: russel at winder.org.uk
London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20121226/532226dc/attachment.pgp>
More information about the Digitalmars-d
mailing list