Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!xlned.com!feeder3.xlned.com!newsfeed.xs4all.nl!newsfeed4.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'languages,': 0.04; 'subject:Python': 0.06; 'referring': 0.07; 'statically': 0.07; 'pointers': 0.09; 'typed': 0.09; 'python': 0.11; '(void': 0.16; 'from:addr:torriem': 0.16; 'from:name:michael torrie': 0.16; 'lambda': 0.16; 'objects.': 0.16; 'run-time.': 0.16; 'all.': 0.16; 'language': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; "aren't": 0.24; 'either.': 0.24; 'lets': 0.24; 'compiled': 0.26; 'pass': 0.26; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'chris': 0.29; "i'm": 0.30; 'quite': 0.32; "can't": 0.35; 'but': 0.35; 'c++': 0.36; 'list': 0.37; 'message-id:@gmail.com': 0.38; 'to:addr:python-list': 0.38; 'issue': 0.38; 'pm,': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'either': 0.39; 'received:org': 0.40; 'great': 0.65; 'boost': 0.70 X-Virus-Scanned: amavisd-new at torriefamily.org Date: Fri, 22 Aug 2014 15:56:59 -0600 From: Michael Torrie User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131118 Thunderbird/17.0.11 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Python vs C++ References: <87fvgoj2i8.fsf@elektro.pacujo.net> <87siko9tlq.fsf@elektro.pacujo.net> <53F7B870.2010909@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 11 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1408744624 news.xs4all.nl 2931 [2001:888:2000:d::a6]:53541 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:76827 On 08/22/2014 03:49 PM, Chris Angelico wrote: > My main issue with callbacks in either C or C++ is that functions > aren't first-class objects. You can pass function pointers around (and > you don't need (void *) to do it, you can use typed function pointers > just fine), but you can't actually construct a function at run-time. I'm not sure I fully understand your meaning. You seem to prefer dynamic languages, which is great because this is the Python list after all. I'm not sure I know of any statically compiled language that lets one construct a function at run-time. I know Boost supports lambda functions but I'm not sure this is quite what you are referring to either.