Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed3a.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:Python': 0.06; 'compiler': 0.07; 'memory.': 0.07; 'assuming': 0.09; 'compact': 0.09; 'lawrence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:into': 0.09; 'things,': 0.09; '>in': 0.16; '>on': 0.16; 'bank,': 0.16; 'existence,': 0.16; 'garbage': 0.16; 'ignoring': 0.16; 'mapped': 0.16; 'message- id:@4ax.com': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'sees': 0.16; 'subject:variable': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'variable': 0.18; 'feb': 0.22; 'separate': 0.22; 'url:home': 0.24; 'holds': 0.26; 'updating': 0.26; 'header:X-Complaints-To:1': 0.27; 'external': 0.29; 'words': 0.29; 'changed.': 0.31; 'table': 0.34; 'objects': 0.35; "didn't": 0.36; 'entry': 0.36; 'charset:us- ascii': 0.36; 'subject:?': 0.36; 'two': 0.37; 'apple': 0.38; 'handle': 0.38; 'to:addr:python-list': 0.38; 'rather': 0.38; 'moving': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'called': 0.40; 'even': 0.60; 'subject:Can': 0.60; 'first': 0.61; 'address': 0.63; 'real': 0.63; 'registers': 0.68; 'treating': 0.84; 'xerox': 0.84; 'received:108': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: Can global variable be passed into Python function? Date: Sat, 22 Feb 2014 13:03:33 -0500 Organization: IISS Elusive Unicorn References: <27ac2248-0ca3-4ba6-9d25-eaad324bc5e9@googlegroups.com> <87sird7wuw.fsf@handshake.de> <8454E8CB-E6E3-452F-8E54-9A77BFF34EC2@gmail.com> <1m3gg9lbf2ln5m2kbki954t17mqni3b20k@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-108-79-218-218.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES 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: 33 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1393092241 news.xs4all.nl 2863 [2001:888:2000:d::a6]:46838 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:66901 On Sat, 22 Feb 2014 14:15:22 +0000, Mark Lawrence declaimed the following: >On 22/02/2014 02:47, Dennis Lee Bieber wrote: >> BASIC, C, FORTRAN, COBOL, Assembly... A "variable" is synonym for an >> address [a box that holds things]. >> > >In C. > >int xyz = 1; > >xyz is placed in a register. What is xyz called now as it's not in memory? On the Xerox Sigma computers, the registers mapped to the first 16 (32-bit) words of memory... Even ignoring that and treating registers as separate from memory, and assuming the compiler didn't optimize xyz completely out of existence, xyz is still a synonym for an address -- in this case an address in the register bank, which is still a box that holds things, rather than in an external memory. As I recall, to handle garbage collection, Apple used to use two stage look ups... The user variable (handle) was a reference into a table of handles, and each entry in that table was a reference to the real object out in memory. Garbage collection would move the objects around to compact used memory, updating the address in the table -- the user program never sees the object moving as its handle address never changed. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/