Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; '(at': 0.04; 'causing': 0.04; 'indicating': 0.07; 'http': 0.09; 'methods,': 0.09; 'protocols.': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'corresponds': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'sorts': 0.16; 'subject:generator': 0.16; 'language': 0.16; 'wrote:': 0.18; 'do.': 0.18; '(the': 0.22; 'cc:addr:python.org': 0.22; 'integer': 0.24; 'cc:2**0': 0.24; '15,': 0.26; 'least': 0.26; 'subject:/': 0.26; 'header:In-Reply- To:1': 0.27; 'function': 0.29; 'am,': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; 'follows': 0.31; 'protocols': 0.31; 'void': 0.31; 'languages': 0.32; 'something': 0.35; 'case,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'functions.': 0.36; 'sometimes': 0.38; 'does': 0.39; 'show': 0.63; 'between': 0.67; 'mar': 0.68; '2015': 0.84; 'pike': 0.84; 'to:none': 0.92; 'responses': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=IoRZo5Za0R5rJPjejD7WenueNlPV5BGN9mzJGVno/Gc=; b=AZSTKNvilXCfSAnZKfRvn5vvpJ46nKrSnhYvxgzOZyPGAQjnX3ZhA1042o2tpQAaEs Wk0wfTqsN2bXUF0b6g1F4/GyzeYLR6vCvghn796WSfHBfzJTlxUraGZqia+N9kluk/3w UGpg+KRUM2E30bM+QrDrO0yzAPEUYG1QY2lOm7oyBQcaDofkess5wVSlMNgOZbVaC0Un XKroNT08g1vQcQN8EGWQ02YOOg9J7yYRsB6r5P/4LJZ4oLKd4Ym1wX10Kl+YI4Q/is2g fCUCLnZQdgMR5roeKTHi5Zkvs4eVbjb/TQMRiHOcJf/APtg7yNDT/R6kbX9x5DoGglwH p6JQ== MIME-Version: 1.0 X-Received: by 10.42.159.132 with SMTP id l4mr64259167icx.59.1426349675431; Sat, 14 Mar 2015 09:14:35 -0700 (PDT) In-Reply-To: <83d579c1-ab61-4a3d-a834-e65d28eace8a@googlegroups.com> References: <5501be8b$0$13006$c3e8da3$5496439d@news.astraweb.com> <87twxqqewm.fsf@elektro.pacujo.net> <4eec1709-dd11-4891-bfcc-60b27bb00ee3@googlegroups.com> <550259bf$0$12975$c3e8da3$5496439d@news.astraweb.com> <00d9152a-f391-4c64-b2bd-52bdec2a6b67@googlegroups.com> <8761a5s0he.fsf@elektro.pacujo.net> <5503cf5f$0$12985$c3e8da3$5496439d@news.astraweb.com> <83d579c1-ab61-4a3d-a834-e65d28eace8a@googlegroups.com> Date: Sun, 15 Mar 2015 03:14:35 +1100 Subject: Re: generator/coroutine terminology From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.19 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 32 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1426349684 news.xs4all.nl 2887 [2001:888:2000:d::a6]:42381 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:87427 On Sun, Mar 15, 2015 at 2:59 AM, Rustom Mody wrote: > Causing all sorts of unnecessary confusions: > An int-function returns int and a char*-functions returns char*. > Does a void-function return void?? > No a void function doesn't return anything! > Ah So a void function does a longjmp? > > All of which is to say that in retrospect we need (at least in imperative programming) procedures and functions. > > Best if the language supports them Python has a broad concept of "functions/methods that return something interesting" and "functions/methods that always return None". (The distinction often corresponds to non-mutator and mutator methods, but that's just convention.) Pike has void and non-void functions, but you can sometimes trick the system into giving you the return value of a void function. (Spoiler: It'll be the integer 0.) HTTP has some responses which contain no body (eg 304 NOT MODIFIED) as well as many which do. Ditto many other languages and protocols. In each case, there's no _real_ distinction between functions and procedures (Pike follows C in having "void functions", but they're still functions), and I don't see any evidence indicating that this has damaged the languages or protocols concerned - can you show otherwise? ChrisA