Functional Programming and python

Chris Angelico rosuav at gmail.com
Tue Sep 24 11:26:21 EDT 2013


On Wed, Sep 25, 2013 at 1:07 AM, rusi <rustompmody at gmail.com> wrote:
> And this is an old conundrum in programming language design:
>
> In C printf is easy to write and NOT put into the language but into external libraries
> In Pascal, writeln cannot be outside the language because as a user defined function, its type would not fit the type system.
>
> And so printf can be made to crash quite easily; not so writeln!

I assume you're talking about mismatching percent-markers and
arguments, there. That's because of a limitation in C's variadic
function support, ameliorated somewhat by gcc's warnings system, and
completely solved by other languages in which (s)printf can still be
an external function, but with reliable type checking. It's not
whether it's part of the language or not that does that.

ChrisA



More information about the Python-list mailing list