Sujet : Re: Joy of this, Joy of that
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.os.linux.miscDate : 24. Nov 2024, 01:31:33
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vhts55$1tu8n$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
User-Agent : Pan/0.161 (Chasiv Yar; )
On Sat, 23 Nov 2024 23:48:59 +0000, Pancho wrote:
To be honest, I don't have an idea what classes not being the
implementers of instance behaviour means. Where is instance behaviour
implemented?
From further up: “A behavior is the set of methods used by an object to
respond to messages”. Since a class itself has no such “behavior”, it
doesn’t need to be an instance of anything, unlike Python.
I would say C++ static methods and static variables are a hack.
They are there to provide access to the innards of a private/protected
class,
No, C++ static means class method or class variable.
There are no “class methods” or “class variables” as such in C++: in C
terms, they have “static linkage”. The “class” part is just a visibility
restriction.
Just as value types are a hack in C#. Things that are sensible for
performance reasons, but that add complexity.
Presumably, like Java, these mechanisms are there to avoid the need for
the services of the full language compiler at runtime.
No they are there for performance, because you don't want to have to do
a malloc and instance initialisation for every number you use.
Ah, like the distinction between “primitive types” and “reference types”
in Java.
Python manages to avoid this arbitrary separation: “int”, “float”, “str”,
“dict” etc are builtin types, and they are classes almost exactly like
classes you define yourself; and in particular you can subclass them.
Python also does multiple inheritance. And it does it quite nicely,
benefiting from lessons learned in earlier attempts at “linearization”
(coming up with a consistent and minimally-surprising method resolution
order across all the base classes).
Yeah, we discussed this in the past. I'm totally unconvinced of the
desirability of complex multiple inheritance linearization.
It is useful, for example, for creating enumerations of fixed instances of
some particular base class. You inherit from both your particular base
class as well as the generic “enum.Enum” base class, to get suitable
properties of both.
I'm actually quite unconvinced by Python.
Python manages to provide a small, powerful language core that includes
features that, for example, Java and C♯ had to leave out: lexical binding,
functions and classes as first-class objects, operator overloads,
arbitrary-precision integers, list comprehensions, dictionary and set
expressions, descriptors, metaclasses ... this then allows for library
modules to build on this core to provide powerful facilities in the form
of “domain-specific (sub)languages” (DSLs) that are specialized to
particular problem areas.
For example, you don’t need “generics” or “templates”, à la Java/C++ etc,
because you can define a “class factory” function that constructs new
classes at runtime.
Date | Sujet | # | | Auteur |
19 Nov 24 | Joy of this, Joy of that | 806 | | root |
20 Nov 24 |  Re: Joy of this, Joy of that | 4 | | Lawrence D'Oliveiro |
20 Nov 24 |   Re: Joy of this, Joy of that | 3 | | root |
20 Nov 24 |    Re: Joy of this, Joy of that | 1 | | Lawrence D'Oliveiro |
20 Nov 24 |    Re: Joy of this, Joy of that | 1 | | rbowman |
20 Nov 24 |  Re: Joy of this, Joy of that | 801 | | 186282@ud0s4.net |
20 Nov 24 |   Re: Joy of this, Joy of that | 193 | | Rich |
20 Nov 24 |    Re: Joy of this, Joy of that | 1 | | The Natural Philosopher |
21 Nov 24 |    Re: Joy of this, Joy of that | 191 | | 186282@ud0s4.net |
21 Nov 24 |     Re: Joy of this, Joy of that | 2 | | Lawrence D'Oliveiro |
14 Jan 25 |      Re: Joy of this, Joy of that | 1 | | Bozo User |
21 Nov 24 |     Re: Joy of this, Joy of that | 187 | | The Natural Philosopher |
22 Nov 24 |      Re: Joy of this, Joy of that | 186 | | Don_from_AZ |
22 Nov 24 |       Re: Joy of this, Joy of that | 185 | | Lawrence D'Oliveiro |
23 Nov 24 |        Re: Joy of this, Joy of that | 184 | | 186282@ud0s4.net |
23 Nov 24 |         Re: Joy of this, Joy of that | 5 | | Lawrence D'Oliveiro |
24 Nov 24 |          Re: Joy of this, Joy of that | 4 | | 186282@ud0s4.net |
24 Nov 24 |           Re: Joy of this, Joy of that | 2 | | Lawrence D'Oliveiro |
24 Nov 24 |            Re: Joy of this, Joy of that | 1 | | 186282@ud0s4.net |
24 Nov 24 |           Re: Joy of this, Joy of that | 1 | | rbowman |
23 Nov 24 |         Re: Joy of this, Joy of that | 178 | | The Natural Philosopher |
23 Nov 24 |          Re: Joy of this, Joy of that | 1 | | rbowman |
23 Nov 24 |          Re: Joy of this, Joy of that | 1 | | Lawrence D'Oliveiro |
24 Nov 24 |          Re: Joy of this, Joy of that | 174 | | 186282@ud0s4.net |
24 Nov 24 |           Re: Joy of this, Joy of that | 1 | | rbowman |
24 Nov 24 |           Re: Joy of this, Joy of that | 172 | | Rich |
24 Nov 24 |            Re: Joy of this, Joy of that | 168 | | The Natural Philosopher |
24 Nov 24 |             Re: Joy of this, Joy of that | 159 | | Rich |
24 Nov 24 |              Re: Joy of this, Joy of that | 158 | | D |
25 Nov 24 |               Re: Joy of this, Joy of that | 157 | | rbowman |
25 Nov 24 |                Re: Joy of this, Joy of that | 156 | | D |
25 Nov 24 |                 Re: Joy of this, Joy of that | 155 | | The Natural Philosopher |
25 Nov 24 |                  Re: Joy of this, Joy of that | 15 | | D |
26 Nov 24 |                   Re: Joy of this, Joy of that | 14 | | rbowman |
26 Nov 24 |                    Re: Joy of this, Joy of that | 1 | | D |
26 Nov 24 |                    Re: Joy of this, Joy of that | 12 | | Pancho |
26 Nov 24 |                     Re: Joy of this, Joy of that | 11 | | Rich |
26 Nov 24 |                      Re: Joy of this, Joy of that | 2 | | Chris Ahlstrom |
27 Nov 24 |                       Re: Joy of this, Joy of that | 1 | | Pancho |
26 Nov 24 |                      Re: Joy of this, Joy of that | 8 | | rbowman |
26 Nov 24 |                       Re: Joy of this, Joy of that | 4 | | D |
27 Nov 24 |                        Re: Joy of this, Joy of that | 1 | | Rich |
27 Nov 24 |                        Re: Joy of this, Joy of that | 2 | | rbowman |
27 Nov 24 |                         Re: Joy of this, Joy of that | 1 | | D |
27 Nov 24 |                       Re: Joy of this, Joy of that | 3 | | The Natural Philosopher |
27 Nov 24 |                        Re: Joy of this, Joy of that | 2 | | rbowman |
28 Nov 24 |                         Re: Joy of this, Joy of that | 1 | | The Natural Philosopher |
25 Nov 24 |                  Re: Joy of this, Joy of that | 139 | | Lawrence D'Oliveiro |
27 Nov 24 |                   Re: Joy of this, Joy of that | 138 | | 186282@ud0s4.net |
27 Nov 24 |                    Re: Joy of this, Joy of that | 137 | | Lawrence D'Oliveiro |
28 Nov 24 |                     Re: Joy of this, Joy of that | 136 | | 186282@ud0s4.net |
28 Nov 24 |                      Re: Joy of this, Joy of that | 133 | | rbowman |
28 Nov 24 |                       Re: Joy of this, Joy of that | 132 | | 186282@ud0s4.net |
28 Nov 24 |                        Re: Joy of this, Joy of that | 3 | | rbowman |
29 Nov 24 |                         Re: Joy of this, Joy of that | 2 | | 186282@ud0s4.net |
29 Nov 24 |                          Re: Joy of this, Joy of that | 1 | | rbowman |
28 Nov 24 |                        Re: Joy of this, Joy of that | 128 | | Lawrence D'Oliveiro |
29 Nov 24 |                         Re: Joy of this, Joy of that | 127 | | 186282@ud0s4.net |
29 Nov 24 |                          Re: Joy of this, Joy of that | 116 | | rbowman |
30 Nov 24 |                           Re: Joy of this, Joy of that | 115 | | 186282@ud0s4.net |
30 Nov 24 |                            Re: Joy of this, Joy of that | 1 | | Lawrence D'Oliveiro |
30 Nov 24 |                            Re: Joy of this, Joy of that | 113 | | rbowman |
30 Nov 24 |                             Re: Joy of this, Joy of that | 2 | | The Natural Philosopher |
1 Dec 24 |                              Re: Joy of this, Joy of that | 1 | | Lawrence D'Oliveiro |
1 Dec 24 |                             Re: Joy of this, Joy of that | 110 | | 186282@ud0s4.net |
1 Dec 24 |                              Re: Joy of this, Joy of that | 5 | | The Natural Philosopher |
1 Dec 24 |                               Re: Joy of this, Joy of that | 2 | | Rich |
3 Dec 24 |                                Re: Joy of this, Joy of that | 1 | | 186282@ud0s4.net |
1 Dec 24 |                               Re: Joy of this, Joy of that | 1 | | D |
2 Dec 24 |                               Re: Joy of this, Joy of that | 1 | | 186282@ud0s4.net |
1 Dec 24 |                              Re: Joy of this, Joy of that | 2 | | Lawrence D'Oliveiro |
3 Dec 24 |                               Re: Joy of this, Joy of that | 1 | | 186282@ud0s4.net |
1 Dec 24 |                              Re: Joy of this, Joy of that | 102 | | rbowman |
3 Dec 24 |                               Re: Joy of this, Joy of that | 101 | | 186282@ud0s4.net |
3 Dec 24 |                                Re: Joy of this, Joy of that | 2 | | The Natural Philosopher |
3 Dec 24 |                                 Re: Joy of this, Joy of that | 1 | | rbowman |
3 Dec 24 |                                Re: Joy of this, Joy of that | 98 | | rbowman |
5 Dec 24 |                                 Re: Joy of this, Joy of that | 97 | | 186282@ud0s4.net |
5 Dec 24 |                                  Re: Joy of this, Joy of that | 92 | | D |
6 Dec 24 |                                   Re: Joy of this, Joy of that | 91 | | 186282@ud0s4.net |
6 Dec 24 |                                    Re: Joy of this, Joy of that | 37 | | rbowman |
6 Dec 24 |                                     Re: Joy of this, Joy of that | 34 | | D |
7 Dec 24 |                                      Re: Joy of this, Joy of that | 2 | | 186282@ud0s4.net |
7 Dec 24 |                                       Re: Joy of this, Joy of that | 1 | | D |
7 Dec 24 |                                      Re: Joy of this, Joy of that | 17 | | 186282@ud0s4.net |
7 Dec 24 |                                       Re: Joy of this, Joy of that | 16 | | D |
7 Dec 24 |                                        Re: Joy of this, Joy of that | 14 | | Rich |
7 Dec 24 |                                         Re: Joy of this, Joy of that | 13 | | D |
7 Dec 24 |                                          Re: Joy of this, Joy of that | 12 | | Rich |
7 Dec 24 |                                           Re: Joy of this, Joy of that | 10 | | D |
8 Dec 24 |                                            Re: Joy of this, Joy of that | 7 | | Rich |
8 Dec 24 |                                             Re: Joy of this, Joy of that | 5 | | rbowman |
8 Dec 24 |                                              Re: Joy of this, Joy of that | 4 | | Rich |
8 Dec 24 |                                               Re: Joy of this, Joy of that | 2 | | The Natural Philosopher |
9 Dec 24 |                                                Re: Joy of this, Joy of that | 1 | | The Natural Philosopher |
8 Dec 24 |                                               Re: Joy of this, Joy of that | 1 | | rbowman |
8 Dec 24 |                                             Re: Joy of this, Joy of that | 1 | | D |
8 Dec 24 |                                            Re: Joy of this, Joy of that | 2 | | Robert Riches |
8 Dec 24 |                                             Re: Joy of this, Joy of that | 1 | | D |
7 Dec 24 |                                           Re: Joy of this, Joy of that | 1 | | D |
8 Dec 24 |                                        Re: Joy of this, Joy of that | 1 | | 186282@ud0s4.net |
7 Dec 24 |                                      Re: Joy of this, Joy of that | 14 | | D |
7 Dec 24 |                                     Re: Joy of this, Joy of that | 2 | | 186282@ud0s4.net |
6 Dec 24 |                                    Re: Joy of this, Joy of that | 53 | | D |
5 Dec 24 |                                  Re: Joy of this, Joy of that | 4 | | Lawrence D'Oliveiro |
29 Nov 24 |                          Re: Joy of this, Joy of that | 10 | | Lawrence D'Oliveiro |
28 Nov 24 |                      Re: Joy of this, Joy of that | 2 | | Lawrence D'Oliveiro |
25 Nov 24 |             Re: Joy of this, Joy of that | 8 | | vallor |
24 Nov 24 |            Re: Joy of this, Joy of that | 3 | | D |
24 Nov 24 |          Re: Joy of this, Joy of that | 1 | | Rich |
21 Nov 24 |     Re: Joy of this, Joy of that | 1 | | Rich |
20 Nov 24 |   Re: Joy of this, Joy of that | 606 | | John Ames |
20 Nov 24 |   Re: Joy of this, Joy of that | 1 | | rbowman |