clos Questions
4
Solved
I'm writing some methods to emit HTML for various elements. Each method has the same output, but doesn't necessarily need the same input.
The method for echoing a game-board needs to take a player...
Outgeneral asked 20/2, 2012 at 2:37
2
Solved
I am reading the book Object Oriented Programming in Common Lisp from Sonja Keene.
In chapter 2, the author says:
The procedure for determining which methods to call and then calling them is calle...
Sphygmomanometer asked 9/6, 2021 at 1:30
4
Solved
I'm looking for a way to clone CLOS objects in a shallow manner, so the created object would be of the same type with the same values in each slot, but a new instance. The closest thing I found is ...
Festal asked 16/6, 2012 at 23:47
2
Solved
I have added the following method to the generic function speak but would now like to remove this particular method in the REPL without removing the rest of the generic functions' methods.
(defmet...
Nanon asked 9/8, 2019 at 5:57
4
I would like to undefine a class and all of its methods but after a quite thorough search on Googlore I have been unable to find a clue about how to do this.
I am using an implementation of Commmo...
Scansorial asked 4/9, 2013 at 16:28
2
Solved
Let's say I have the following class declaration:
(defclass foo-class ()
((bar :initarg :bar
:type list)))
When I create an instance of this class, make-instance won't check whether passed arg...
Enfeeble asked 7/8, 2018 at 10:0
2
Solved
Having recently discovered an active fork of weblocks, I would like to combine it with the ORM library mito.
Weblocks defines a macro defwidget, which in practice wraps defclass like so:
(defcla...
Insessorial asked 9/12, 2018 at 16:54
1
Solved
Generics seem to offer a nice facility for pulling out a common word and letting it act on things according to the types you pass it, with extensibility after-the-fact.
But what about common words...
Rhetorician asked 1/12, 2018 at 20:37
2
Why happen this in sbcl? Maybe a bug?
(defclass myclass ()
((s1
:initform '((a . 1) (b . 2)))
(s2
:initform '((a . 1) (b . 2)))))
(defparameter ins (make-instance 'myclass))
(setf (cdr (ass...
Pleistocene asked 29/8, 2018 at 21:6
3
Solved
I am learning to structure my CL programm and now having trouble to use the CLOS while programming in the large with packages.
package.lisp
(defpackage :my-project.a
(:use :cl)
(:export
creat...
Disinfectant asked 10/1, 2017 at 17:50
1
Solved
I have a class like this one
(defclass shape ()
((color :initform :black)
(thickness :initform 1)
(filledp :initform nil)
(window :initform nil)))
Is there a function in common-lisp how to g...
Lake asked 22/11, 2016 at 12:36
1
Solved
This happens to me time and again: I define the class and forget that I wanted it funcallable or it is, say, Gtk widget class, thus it's metaclass needs to be stated. Once it is defined, however, S...
Doting asked 7/8, 2016 at 7:27
1
Solved
The generic function slot-definition-readers gets an argument that must be a direct-slot-definition. If an object is an instance of a class that inherits from another class how can I get hold of th...
Placoid asked 19/7, 2016 at 7:43
2
Solved
I'd like to use names such as elt, nth and mapcar with a new data structure that I am prototyping, but these names designate ordinary functions and so, I think, would need to be redefined as generi...
Slopwork asked 28/6, 2016 at 15:23
3
Solved
Maybe this question is too general, nevertheless i'll try:
Is there any comprehensive guide on types in common lisp?
I'm kind of confused about this subject:
Why are non-primitive types declared ...
Gilmagilman asked 8/6, 2016 at 14:29
2
Solved
How do I see if one CLOS class is a subclass of another CLOS class?
Writhe asked 3/6, 2010 at 23:6
2
Solved
How would you express the following Java code in Lisp?
class Foo {
private String s;
public Foo(String s) {
this.s = s;
}
}
class Bar extends Foo {
public Bar(int i) {
super(Integer.toStri...
Saransarangi asked 18/4, 2013 at 17:47
2
Solved
My understanding of a struct is that it has slots to store data in, has a type, has make-X and slot-accessor functions, and can be specialized on by a method (since it has a type).
My understandin...
Epigrammatize asked 12/12, 2015 at 20:52
3
Solved
I have the following class:
(defclass category ()
((cat-channel-name
:accessor cat-channel-name :initarg :cat-channel-name :initform "" :type string
:documentation "Name of the channel of this ...
Cassy asked 20/11, 2015 at 13:52
5
Solved
Reading myself into Lisp, currently on this page (http://landoflisp.com), I found the following statement on the second last paragraph on the page that shows when clicking the link CLOS GUILD:
T...
Voroshilov asked 31/8, 2015 at 9:59
2
I'd like to be able to use a defined type as a parameter specializer to a defmethod. The motivation is readability and flexibility to change at a later stage. Somehting like this:
(deftype foo () ...
Tiatiana asked 26/4, 2015 at 12:8
2
Solved
I notice, upon reading Keene's book, that defgeneric has a :method option, which seems like it allows you to specify a method in the generic definition itself. Most documentation I've seen has all ...
Chilly asked 15/4, 2015 at 0:26
3
Solved
Is there a way to find out how much memory is used by an instance of a class or basic data types in general?
I have a toy webframework in cl that creates and manages web pages with instances of c...
Frascati asked 1/9, 2012 at 18:58
1
Solved
I'm writing an multiarchitecture assembler/disassembler in Common Lisp (SBCL 1.1.5 in 64-bit Debian GNU/Linux), currently the assembler produces correct code for a subset of x86-64. For assembling ...
Reiterate asked 24/11, 2014 at 0:4
3
Solved
I am trying to find a solution to typical diamond inheritance problem in Common Lisp CLOS. The code :
(defclass C1.0 () ... )
(defclass C2.1 (C1.0) ...)
(defclass C2.2 (C1.0) ...)
(defclass C3.0 (...
Bennink asked 22/11, 2014 at 4:46
1 Next >
© 2022 - 2024 — McMap. All rights reserved.