News for hackers. Stuff that matters.
Re:Why I use Object Pascal by zeveb on Tuesday October 17, 2017 @10:44AM (#15491309)
> Scheme & LISP have no built-in classes

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.

There are no comments on this comment yet.