X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f X-Recipient: geda-user AT delorie DOT com 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:to :content-type; bh=Ci/YUDDAQoq3QflK7y4ncFICeRrivOFIx7L0Izc+BDo=; b=0VJ+Z6LJb+0kXCsfQq2ZxtkoIEjtXS8XT+EkCGtAZTQaK7GEe7HSJg1ib+6HxB6Mux vqlLJ9Ty6w3dlMGCUlDHSgnX0elfRyOlcgQYNTizXmk7AK7aaT5JLLhbeNnHCVQDuRgi 2YTwETUteWHpaZQ+lbCADo1K7VJqws0MqBuBL8zgW7tLjRKG3pJHZlPMoOEbQhGuyrCq AlhcMcY7du2YZ6CucB1jijmDc9KLoIMpwdtC8oVXpTaiy0cxJLaopMlsS9tHX/PtnmQi JmXBOmy/L25bQad0DdCdnBBqAnqxst0YZW+xXSalE2DAtNcg3ufbkahMubJXnNgvrbDo 0IMg== MIME-Version: 1.0 X-Received: by 10.182.223.37 with SMTP id qr5mr2764781obc.41.1391373447648; Sun, 02 Feb 2014 12:37:27 -0800 (PST) In-Reply-To: <20140131220845.GA29613@visitor2.iram.es> References: <1391182300 DOT 2023 DOT 11 DOT camel AT AMD64X2 DOT fritz DOT box> <20140131220845 DOT GA29613 AT visitor2 DOT iram DOT es> Date: Mon, 3 Feb 2014 00:37:27 +0400 Message-ID: Subject: Re: [geda-user] Re: refdes renumber From: =?KOI8-R?B?4czFy9PFyiDowdLYy8/X08vJyg==?= To: geda-user AT delorie DOT com Content-Type: multipart/alternative; boundary=f46d0444ee6918de4904f1726038 Reply-To: geda-user AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: geda-user AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk --f46d0444ee6918de4904f1726038 Content-Type: text/plain; charset=ISO-8859-1 2014-02-01 Gabriel Paubert : > > This said, there is another important point: for an array of n > elements, valid indices in Python are in the range from -n to > n-1. The range 0 to n-1 is the familiar zero-based indexing used in > C and other languages, negative indices run backwards from the > end of the array so a[-n] is the first element and a[-1] the last. > :) Python's interpreter variables types differs from types in C in "other languges", which use with compilers. Variable's memory organization if different too. Struct of variables (e.g. integer) on python is complex. This is similar of struct in C, even more similar of classes in Cpp. Indexes of LISTs (not arrays) may be [-N...N] . And this is not depend of usage arcitectures or low level memory organisation, but this depends and provides only python language standarts. Python will be work on IBM PC or any microcontrollers (e.g. ARM-based) absolutely equally. Indexes [-n] and etc. in python are transformed to expression: list[-m] => list [len(list)-m] And usage of this is very relaible. And if its not works - this is bug of python :) > > [Note that I don't think that this definition is a good idea: it > may hide bugs when you have a complex indexing expression which > is off by one and the Python interpreter will happily access the > last element of an array instead of throwing an exception for > out of bounds access. There are cases where it is handy but I am > of the strong opinion that it is more dangerous than useful.] > If you afraids of negative indexes, don't use python!! Use C, C++ and other languages... I using python and I will be using python because I see that it is convenient and flexible. Script now is available through web interface http://www.gedasymbols.org/user/alexey_kharikovskiy/ Does anyone need a gtk frontend? --f46d0444ee6918de4904f1726038 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable



2014-02-01 Gabriel Paubert <paubert AT iram DOT es>:

This said, there is another important point: for an array of n
elements, valid indices in Python are in the range from -n to
n-1. The range 0 to n-1 is the familiar zero-based indexing used in
C and other languages, negative indices run backwards from the
end of the array so a[-n] is the first element and a[-1] the last.

:)
Python's interpreter variables types = differs from types in C in "other languges", which use with compi= lers.
Variable's memory organization if different too.
Struct of variables (e.g. integer) on python is complex. This is similar= of struct in C, even more similar of classes in Cpp.
Indexes= of LISTs (not arrays) may be [-N...N] . And this is not depend of usage ar= citectures or low level memory organisation, but this depends and provides = only python language standarts.
Python will be work on IBM PC or any microcontrollers (e.g. ARM-= based) absolutely equally.
Indexes [-n] and etc. in python ar= e transformed to expression:
list[-m] =3D> list [len(list)-m]
And usage of this is very relaible. And if its not works - this is bug= of python :)
=A0

[Note that I don't think that this definition is a good idea: it
may hide bugs when you have a complex indexing expression which
is off by one and the Python interpreter will happily access the
last element of an array instead of throwing an exception for
out of bounds access. There are cases where it is handy but I am
of the strong opinion that it is more dangerous than useful.]
If you afraids of negative indexes, don't use python!!
Use C, C++ and other languages...
I using python and I<= span id=3D"result_box" class=3D"" lang=3D"en"> will be usi= ng python because I see that it is convenient and flexible.


Script now is available through web int= erface
= http://www.gedasymbols.org/user/alexey_kharikovskiy/


Does anyone need a gtk frontend?
--f46d0444ee6918de4904f1726038--