Nonsense. Lisp has a plethora of standard classes: T, NUMBER, PATHNAME, SYMBOL, SIMPLE-ARRAY, BASE-STRING &c. &c. &c. In fact, I just ran this on a pristine SBCL (no user or :
(let ((ch (make-hash-table :test 'eq)))
(labels ((pc (class)
(loop for subclass in (sb-mop:class-direct-subclasses class)
unless (gethash subclass ch)
do (progn
(setf (gethash subclass ch) t)
(pc subclass)))))
(pc (find-class t)))
(length (loop for class being each hash-key of ch collect class)))
→ 659
Yes, a basic running SBCL has six hundred and fifty-nine classes built into it. It all works remarkably well.> one can argue that CLOS isn't what we normally describe as OOP
Probably not, but it's better.
> Both normally have a global namespace.
CLOS classes are themselves instances, identified by a symbol which lives in a package — i.e., within a namespace. E.g:
(defclass foo () ())
→ #<STANDARD-CLASS COMMON-LISP-USER::FOO>
(defclass swank::foo () ())
→ #<STANDARD-CLASS SWANK::FOO>
(make-instance 'foo)
→ #<FOO {1003ED8AA3}>
(make-instance 'swank::foo)
→ #<SWANK::FOO {1003EDEC03}>
Those are two different classes, both name FOO, but their names live in different packages.Modern PHP development almost exclusively uses Composer libraries rather than the standard libraries, which overwhelmingly use namespaces in Vendor\Project format.
There's going to be a push to clean up the standard library in the coming years. The plan is to introduce a namespaced alternative to the standard library in the global namespace which also cleans up a lot of nits (e.g. phpsadness.com posts). Maybe in PHP 8? Then when the ecosystem catches up, we can discuss deprecating/removing the "just dumped in global" way of doing things in PHP 9.
Source: I'm very likely going to be the main person driving this push.
Just because "most others use . or :" doesn't mean it's the only correct syntax in the realm of possibility.
CLOS is built-in.
> CLOS isn't what we normally describe as OOP
There is no 'normal' description of OOP. Smalltalk, C++, Java, Self, Javascript, ... are all object-oriented programming languages and are widely different. If you look at the OOP literature you will find dozens of definitions of OOP.
CLOS has classes, instances, inheritance, dispatch, and other features of OOP.
> Both normally have a global namespace.
Namespaces for symbols in Common Lisp are called 'packages'.
Well, yes, though I consider it far superior to most other object systems out there.
Still, the selection of languages that do is so vast that such reasons hardly answer the question "why Pascal, of all the options".
I care about performance (ruling out any GC language), multi-platform native binaries, language readability, dev community, and a bundle of other factors. Pascal turns out to hit most of my needs and not annoy me too much.
Of the thousands of more obscure languages, I'm sure there's one that'd be perfect, except I'd have a worse time with libraries.
[Citation needed]
Scheme & LISP have no built-in classes, and one can argue that CLOS isn't what we normally describe as OOP. Both normally have a global namespace.
Inheritance in JavaScript is possible but very hard to implement correctly before ES6. Node has namespaces (sort of) but client-side JavaScript generally doesn't.
PHP in theory has namespaces, but the standard libraries are just dumped in global.