Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Dennis Lee Bieber Newsgroups: comp.lang.python Subject: Re: Considering migrating to Python from Visual Basic 6 for engineering applications Date: Sun, 21 Feb 2016 21:40:11 -0500 Organization: IISS Elusive Unicorn Lines: 61 Message-ID: References: <9e57761f-26e1-41c5-8e71-23800de1fdd3@googlegroups.com> <7f9c473e-b0c2-4d77-91d1-d0733c93b12d@googlegroups.com> <23d8156f-1808-4395-9c04-27d2984fe67c@googlegroups.com> <20160221121906.095a57d0@bigbox.christie.dr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de FMmOR9Vs9mGzPPvVIx4D/AyNKgk6+qRs+imh9DB5pKXg== 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; 'python,': 0.02; 'subject:Python': 0.05; 'compiler': 0.05; 'float': 0.05; "'a'": 0.07; 'predefined': 0.07; 'determines': 0.09; 'integer,': 0.09; 'message-id:@4ax.com': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:Visual': 0.09; 'def': 0.13; 'explicitly': 0.15; 'languages,': 0.15; 'subsequent': 0.15; "(it's": 0.16; '2016': 0.16; '>in': 0.16; 'bound)': 0.16; 'bytes).': 0.16; 'c/c++,': 0.16; 'declaration': 0.16; 'integer.': 0.16; 'integers,': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'skip:> 20': 0.16; 'string).': 0.16; 'variable.': 0.16; 'string': 0.17; 'integer': 0.18; 'string,': 0.18; 'url:home': 0.18; 'variable': 0.18; 'names.': 0.22; 'parse': 0.22; 'file.': 0.22; 'code,': 0.23; 'feb': 0.23; "python's": 0.23; 'second': 0.24; '(most': 0.24; 'somewhere': 0.24; 'tim': 0.24; "i've": 0.25; 'header:X-Complaints-To:1': 0.26; 'define': 0.27; 'equivalent': 0.27; 'forgive': 0.27; 'specify': 0.27; 'arithmetic': 0.29; 'chase': 0.29; 'declared': 0.29; 'forms,': 0.29; 'i/o': 0.29; 'types.': 0.29; 'array': 0.29; 'character': 0.29; 'convert': 0.29; 'starts': 0.29; "i'm": 0.30; 'skip:[ 10': 0.31; 'statement': 0.32; 'done,': 0.33; 'skip:c 30': 0.35; 'done': 0.35; 'level': 0.35; 'but': 0.36; 'instead': 0.36; 'needed': 0.36; 'there': 0.36; '(and': 0.36; 'basic': 0.36; 'visual': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'being': 0.37; 'say': 0.37; 'received:org': 0.37; 'charset:us-ascii': 0.37; 'things': 0.38; 'difference': 0.38; 'names': 0.38; 'means': 0.39; 'data': 0.39; 'subject:from': 0.39; 'to:addr:python.org': 0.40; 'where': 0.40; 'some': 0.40; 'real': 0.62; 'back': 0.62; 'information': 0.63; 'between': 0.65; 'receive': 0.71; 'sounds': 0.76; 'float,': 0.84; 'rexx,': 0.84; 'sum.': 0.84; 'touched': 0.84; 'treats': 0.84; 'dennis': 0.91; 'received:108': 0.93 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: adsl-108-68-179-144.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.21rc2 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:103323 On Sun, 21 Feb 2016 12:19:06 -0600, Tim Chase declaimed the following: > >In both Fortran & BASIC, you specify that information somewhere as >well. However, it sounds like you define those at the >variable-definition level (it's been over a decade since I done any >BASIC and far longer since I've even touched any Fortran, so forgive >me if I'm a tad rusty) instead of where its read from the file. > In K&K BASIC, the neophyte level (remember, variable names were limited to [A-Z][null|0-9]) is that 'A' is a single-precision float, 'A$' is a character string, and eventually there were additional punctuation codes for double-precision and integer types. Visual BASIC took the DEF statement (originally only used to declare array bound) and extended it to declare data types for the subsequent variable names. FORTRAN traditionally used I-N ("IndiaN") to indicate an integer, all other variable names were single precision float -- unless explicitly declared as some other type (and there were no character string type back then -- it was an array of bytes). However, in BOTH BASIC, FORTRAN, C/C++, Pascal, Ada, etc., the type of the data being read is known by the compiler based upon the (implicit or explicit) type declaration of the receiving variable. Python, REXX, other "scripting" languages, do not use predefined types for variable names -- a given name can receive an object of any type. This means I/O has to specify the type needed to parse the string representation. Note that a real REXX implementation determines the difference between numeric and string at time of usage (most REXX implementations do have internal float/integer forms, but it is perfectly valid for the implementation to keep things in string form and do a behind-the-scenes parse when arithmetic is done, then convert the result back to string). -=-=-=-=- /* junk */ A = "1" B = 2 say A + B say A || B -=-=-=-=- C:\Users\Wulfraed\Documents>rexx junk.rx 3 12 C:\Users\Wulfraed\Documents> The first "say" treats them as integers, and returns the sum. The second say is using string concatenation. Yet in the code, A is a string and B is an integer. And you don't want to see REXX's equivalent of multi-field console input... {Hint: it starts with PARSE PULL -- PULL being the equivalent of Python's input()/raw_input() [P3 vs P2]} -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/