[Python-ideas] Jump to function as an an alternative to call function

Abe Dillon abedillon at gmail.com
Wed Aug 15 18:21:54 EDT 2018


[Chris Angelico]

> Drop the word "function" and it's no longer about a goto - it's about
> a block of code that can be deposited into another context.


The only context I've used goto is in a TI-83 scientific calculator, but in
that, it was just about jumping around to different labels in code and had
nothing to do with functions. Though this may not have been the "canonical"
goto that Dijkstra considered harmful.

[Chris Angelico]

> By the way:


> > It's difficult to see what you're after from your Verb and Morpheme
> example.


> You're responding to MY post, which is a response to Jacob's. Please
> watch your use of pronouns; it would help a lot if you weren't top
> posting, and were directly responding to specific people's specific
> comments.


Sorry, I ran into a lot of problems trying to use the Google Groups
interface to post, so I've resorted to strictly using email. Unfortunately,
that makes the structure of the conversation less obvious to me. I'll try
to be more mindful of this in the future.

On Wed, Aug 15, 2018 at 4:58 PM, Chris Angelico <rosuav at gmail.com> wrote:

> On Thu, Aug 16, 2018 at 7:40 AM, Abe Dillon <abedillon at gmail.com> wrote:
> > Jumping into functions that mutate variables in the calling scope sounds
> a
> > lot like "GoTo" which is notorious for leading to code that's very hard
> to
> > reason about. Your functions would implicitly require that you assign
> > variables in the calling scope before calling the function instead of
> > explicitly requiring them in the function's signature. That can be very
> > confusing.
>
> Drop the word "function" and it's no longer about a goto - it's about
> a block of code that can be deposited into another context. If you
> were to copy and paste that code, its meaning would be defined by
> where it is used; the idea of a "code block" is that you can do that
> with something that can be passed around like a function, but isn't a
> function.
>
> We could borrow a term from the Python grammar and call it a "suite",
> perhaps, but "code block" is probably the best term. As mentioned,
> there have been previous proposals along these lines.
>
> By the way:
>
> > It's difficult to see what you're after from your Verb and Morpheme
> example.
>
> You're responding to MY post, which is a response to Jacob's. Please
> watch your use of pronouns; it would help a lot if you weren't top
> posting, and were directly responding to specific people's specific
> comments.
>
> ChrisA
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180815/52fb9c14/attachment-0001.html>


More information about the Python-ideas mailing list