Questions tagged [clos]

Common Lisp Object System

The Common Lisp Object System (CLOS) is the facility for object-oriented programming which is part of ANSI Common Lisp. CLOS is a powerful dynamic object system which differs radically from the OOP facilities found in more static languages such as C++ or Java.

Source: Wikipedia (Common Lisp Object System)

187 questions
0
votes
1 answer

How do I best save/read data structures?

I want to write some data structures pointed to by FOO and BAR to a file, and to read the data structures back into the symbols FOO and BAR when I start a new session of Common Lisp. It would appear *PRINT-READABLY* allows objects to be printed in a…
wrongusername
  • 18,564
  • 40
  • 130
  • 214
0
votes
2 answers

Why can CLOS slots be unbound?

It is said, only special variables in Common Lisp can be unbound. For all lexical variables the default value is nil. I thought that class slots exist in something like closure, but obviously they don't. If I define a CLOS slots without :initform…
Mark Karpov
  • 7,499
  • 2
  • 27
  • 62
0
votes
2 answers

CLOS slot accessors: read but not write

I have a list of the names of slots of a CLOS object: (DEFCLASS TRIAL-DATA (STANDARD-OBJECT) ((A-DATUM :ACCESSOR A-DATUM :INITARG :A-DATUM :INITFORM NIL) (BOTH-DATA :ACCESSOR BOTH-DATA :INITARG :BOTH-DATA :INITFORM 0) (CUMULATIVE-DATA…
fpt
  • 358
  • 3
  • 11
0
votes
1 answer

common lisp defclass make-instance usage in custom macro

I have define a macro that create a new class and then defines a constant that creates an instance of the newly defined class: (defmacro my-class (name inst) `(progn (defclass ,name nil nil) (defconstant ,inst (make-instance…
José
  • 3,041
  • 8
  • 37
  • 58
0
votes
1 answer

make-operator returns swindleobject

#lang swindle (require swindle/misc swindle/setf ) (defclass* jacket () (size :initvalue 40 :accessor sj) :printer #t) (defclass* trousers () (size :initvalue 44 :accessor st) :printer #t) (defclass* suit (jacket…
-2
votes
1 answer

Lisp - Passing unquoted list to macro

I'm currently experimenting with macro's in Lisp and I would like to write a macro which can handle syntax as follows: (my-macro (args1) (args2)) The macro should take two lists which would then be available within my macro to do further…
Astarno
  • 405
  • 3
  • 10
-3
votes
1 answer

Does CLOS is a weakness in Common Lisp?

What I want to mean is if CLOS is a bad practice to the Lisp functional programming way?
csgui
  • 151
  • 5
1 2 3
12
13