Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!news2.arglkargh.de!news.karotte.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Gregory Ewing Newsgroups: comp.lang.python Subject: Re: Function declarations ? Date: Tue, 14 Jun 2011 13:18:18 +1200 Lines: 20 Message-ID: <95nr6tF92qU1@mid.individual.net> References: <4df62578$0$30002$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net eYOoZ2eA6JwdDNlrZqui9wET/ppxfTc3cd5Gyqv2uYPAMHAtq0 Cancel-Lock: sha1:ryfEGck+JZD8RcKqXDL7j4LloZc= User-Agent: Mozilla Thunderbird 1.0.5 (Macintosh/20050711) X-Accept-Language: en-us, en In-Reply-To: <4df62578$0$30002$c3e8da3$5496439d@news.astraweb.com> Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:7578 Steven D'Aprano wrote: > "Hoisting" in computing refers to the idea of "lifting" variables or code > outside of one block into another. I'm not sure it's the right term for what's happening here, though. Nothing is being lifted to a higher level -- the functions remain at the same level they were written at. > Here's another model: Pascal. Because Pascal does type checking at > compile time, it will reject the function ham() and raise a compiler > error, It's more that Pascal is designed to make single-pass compilation easy. It's possible to support out-of-order declarations with compile-time type checking using two passes; Pyrex does this, for example. -- Greg