Invoking return through a function?

Rick Johnson rantingrickjohnson at gmail.com
Sun Oct 29 14:13:41 EDT 2017


Alberto Riva wrote:
> Rick Johnson wrote:
> > Alberto Riva wrote:

[...]
    
> >> In a language like Lisp
> > 
> > Python is nothing like Lisp, and for good reason!
> 
> I would disagree with this. Actually, it's the most Lisp-
> like language I've encountered in my 25 years of writing
> software. 

Really? I'm sorry that you have only encountered a few
"academic languages". Do some googling, there are literally
thousands of them in the wilds.

> It has closures, functions are first-class objects, it's
> interactive, highly reflective, variables are not strongly
> typed...

Congratulations. You've just described Ruby. And an apple-
cart full of other languages as well.

> I don't consider myself a fanboy - I've used Lisp for most
> of my career, and now I happily use Python for 80% of what
> I do, even if it means putting up with the occasional
> limitation, as in this case.

(not that i'm defending Python here...) but how do you know
that this so-called missing "feature" is a limitation? How
many other languages use this "feature"? And how many
programmers swear they could not live without it? We need
stats; hyperlinks; and eye witness testimonials. Heck, even
a random YouTube vid would be helpful.

> Why "thankfully"? Having macros in Python would be great.
> Of course it's not possible because of the syntax, but it
> would be great nevertheless :)

To me, macros would seem to violate Python's "explicit is
better than implicit" philosophy. But i admit, i'm something
of a zen purist on these matters. O:-) However, if you can
find a way to make macros Pythonic, hmm, i might be
interested...

> > Possibly. But you've already poo-pooed the easy and
> > obvious solution of using conditional logic.
> 
> Not really. It's obvious that I'm going to use a
> conditional, I was just asking for a way to avoid having to
> type the same conditional over and over. Computers are
> meant to do work for you, after all, aren't they? :)

A reasonable argument, i admit. But again, here in the
peaceful fields of "Pythonia", most of us feel that
"explicit is better than implicit". And why? Well, because
code is read more often than it is written, and as such,
explicit code will be of enormous help during the debugging
process. Sure, you may save yourself a few key-strokes with
features like macros, but at what cost? No action is without
consequences, dontchaknow?



More information about the Python-list mailing list