|
|
|
|
|
by cm2187
2831 days ago
|
|
Python has its own inconsistencies, like any language that has been around for a very long time. Like some collection properties have to be accessed with a function (len()) while other as an instance function. It doesn’t seem to follow any logic. |
|
Or, for example, MID$ is a function, except when it's not:
Then there's stuff like DEFINT and GOSUB and ON STRIG and ...The reason for all this is that BASIC was never designed as a language in which the standard library could mostly be written, or even described, in that language. Thus, most features were implemented as intrinsics, with magic syntax and/or semantics, which varies drastically from feature to feature. This goes even for the standard functions - e.g. MID$ is a function (except when it's not, as above) - but it can take either 2 or 3 arguments, which is not something that you can declare yourself. As a result, when language evolved, it also did so in a haphazard way, as with LINE re-purposed for other reasons.
The original BASIC was very simple (but also non-extensible). The BASIC that most people remember - at its peak - was actually more complicated than an equivalent subset of Python.