clos Questions

7

Does there exist anything like CLOS (Common Lisp Object System) for Clojure?
Fleming asked 28/10, 2010 at 19:9

2

Solved

In the following program, removing the line (declare (type (simple-array bit) arr)) makes running time increase by more than a factor of 3, using SBCL. The type information given in the defclas...
Podium asked 14/4, 2014 at 13:3

1

Solved

http://mop.lisp.se/concepts.html says: An implementation is free to add additional properties to the canonicalized slot specification provided these are not symbols accessible in the common-li...
Whitehead asked 24/2, 2014 at 11:52

1

Solved

CL-USER> (defclass a () ()) CL-USER> (defclass b (a) ()) CL-USER> (make-instance 'b) #<STANDARD-CLASS B> What predicate function can I call on my instance b, which returns T if it ...
Granulation asked 3/10, 2013 at 5:38

1

I am using common-lisp for my real-time graphics experiments and so far it has being great. My requirements for speed and easy compatibility with cffi mean I am using 'typed' arrays. The one area o...
Chophouse asked 2/10, 2013 at 15:2

1

Solved

I've run into a problem that a third-party library needs to act on a class as if it was finalized. After some reading I understand the motivation behind this mechanism, but I don't really know how ...
Coeval asked 29/7, 2013 at 21:33

1

Solved

In common lisp, what can I use to access structure slot using slot name/symbol? What I want is (defstruct point (x 0) (y 0)) (defmacro -> (struct slot) `(slot-value ,struct ,slot)) (setf p (...
Ticking asked 22/6, 2013 at 5:14

2

I'm trying to create a class that can store a vector of symbols in a slot in SBCL. I cannot figure out how to set it up. My best guess thus far has been (defclass Individual () ((discrete-decisi...
Fornof asked 23/9, 2012 at 21:41

3

Solved

During development I defined an 'initialize-instance :after' method which after a while was not needed anymore and actually gets in my way because inside it calls code that is not valid anymore. Si...
Stilly asked 12/5, 2011 at 10:12

3

Solved

I'm studying Common Lisp (with Lispworks) and I'm trying to get into class system right now. There is a class called standard-object and it is defined as The class standard-object is an instanc...
Beedon asked 10/10, 2012 at 8:29

1

Solved

This is my class's package: (in-package :cl-user) (defpackage foo (:use :cl) (:export :bar)) (in-package :foo) (defclass bar () (baz)) I can create an instance of bar in package cl-user. CL...
Nucleo asked 5/7, 2012 at 19:42

3

Solved

In Common Lisp, how can I override the default string representation of a CLOS class so that calls to format or princ will print something intelligible, even when objects of that class are embedded...
Judo asked 11/9, 2011 at 23:52

1

Solved

Say we have a slot without :initform (defclass foo () ((x :reader x :initarg x))) How can I check if slot x of an instance of foo is bound? There is a way to do this with MOP, which I find ver...
Paratyphoid asked 2/3, 2012 at 3:28

1

I'd like to use Common Lisp CLOS objects as keys in a hashtable. I thought it would be as simple as this: (defclass my-class () ((a :accessor a :initarg a))) (defun my-class= (my-instance-1 my-in...
Luxembourg asked 7/7, 2011 at 2:5

2

Solved

In Common lisp: Redefine an existing function within a scope? the OP asked for something similar. But I want to create a method specializer, not a function. Essentially suppose that a method is def...
Chemosmosis asked 27/4, 2011 at 13:43

1

Solved

I've come across claims that Common Lisp Object System (CLOS) is superior to traditional (class-based) Object-Oriented systems. Wikipedia entry for CLOS mentions differences between the two approac...
Wellfavored asked 21/2, 2011 at 13:11

2

Solved

I'm pretty intrigued by Gambit Scheme, in particular by its wide range of supported platforms, and its ability to put C code right in your Scheme source when needed. That said, it is a Scheme, whic...
Bukharin asked 3/1, 2011 at 20:10

3

Solved

In my class definition, I want to initialize one slot based on the value of another slot. Here is the sort of thing I would like to do: (defclass my-class () ((slot-1 :accessor my-class-slot-1 :i...
Periapt asked 1/9, 2010 at 16:37

1

Solved

If you want to make CLOS objects in common lisp printable (print readably), how do you go about doing this without using anything but print and read.
Profane asked 21/6, 2010 at 16:41

1

Solved

I need to write a macro (with-hooks (monster method who what) &body body) for a game I'm writing. Monster is a CLOS object, method and who are strings and what is a function (#' notation). The ...
Sibyls asked 23/5, 2010 at 16:41

1

Solved

What is the right way to define a generic in package A and to provide a method for this generic in package B in CLOS? Thank you in advance! Example: (defpackage :common (:use :cl)) (in-package ...
Lawmaker asked 28/1, 2010 at 17:31

2

Solved

I'm forming a class for some work on molecular dynamics as follows: (defclass %atom (particle) ((name :initarg :name :initform (error "Every atom in the system must have a name!")) (mass :access...
Suctorial asked 5/11, 2009 at 19:53

5

Solved

im reading Practical common Lisp as a result of another question. I just read chapter 16 and 17 where you can find how LISP manages objects. But after a couple of years of thinking how Java manage...
Gaffney asked 12/1, 2009 at 22:45

© 2022 - 2024 — McMap. All rights reserved.