<ixelp>
Initialization of Generic Function Metaobjects
<beach>
But now I think it is deliberate that there is no description of any defaulting behavior in the chain of functions from ENSURE-GENERIC-FUNCTION, to ENSURE-GENERIC-FUNCTION-USING-CLASS, to initialization of generic-function metaobjects. From reading the page on ENSURE-GENERIC-FUNCTION, it now seems to me that this argument must be a method-combination metaobject, and that no default is possible.
<beach>
Any remarks?
glaucon has joined #commonlisp
traidare has joined #commonlisp
shka has joined #commonlisp
<beach>
Now that I think about it again, it does seem silly not to default to the STANDARD method combination when the generic function is being initialized.
<beach>
But it seems that the method-combination metaobject will always be supplied, if the chain of calls starts with ENSURE-GENERIC-FUNCTION.
danse-nr3 has quit [Ping timeout: 268 seconds]
danse-nr3 has joined #commonlisp
czy has quit [Remote host closed the connection]
czy has joined #commonlisp
chomwitt has quit [Ping timeout: 246 seconds]
dcb has quit [Quit: Connection closed for inactivity]
pillton has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.2)]
szkl has joined #commonlisp
mgl has joined #commonlisp
alcor has joined #commonlisp
epony has joined #commonlisp
younder has quit [Ping timeout: 256 seconds]
glaucon has quit [Quit: WeeChat 3.5]
amb007 has quit [Ping timeout: 256 seconds]
leungbk has quit [Remote host closed the connection]
decweb has joined #commonlisp
rendar has quit [Ping timeout: 264 seconds]
markb1 has quit [Ping timeout: 264 seconds]
rendar has joined #commonlisp
markb1 has joined #commonlisp
igemnace has quit [Read error: Connection reset by peer]
igemnace has joined #commonlisp
igemnace has quit [Read error: Connection reset by peer]
igemnace has joined #commonlisp
markb1 has quit [Ping timeout: 246 seconds]
agm has joined #commonlisp
<agm>
beach: i still don't have a full grasp of CLOS, let alone MOP ;)
danse-nr3 has quit [Ping timeout: 260 seconds]
green_ has quit [Ping timeout: 255 seconds]
markb1 has joined #commonlisp
yitzi has joined #commonlisp
<jmercouris>
Let's say I have a multiline string
<jmercouris>
and I want to replace the newlines with a character
<ixelp>
substitute, substitute-if, substitute-if-not, nsubstitute, nsubstitute-if, nsubstitute-if-not | Common Lisp Nova Spec
<jmercouris>
I'm asking how can I reference the newline characters?
<random-nick>
are they only linefeeds? (unix newlines)
<yitzi>
`(substitute #\w #\newline str)
<jmercouris>
let me try
<jmercouris>
I see, thanks yitzi
<yitzi>
yw
NicknameJohn has quit [Ping timeout: 255 seconds]
pranavats has left #commonlisp [Disconnected: Replaced by new connection]
pranavats has joined #commonlisp
tyson2 has joined #commonlisp
szkl has quit [Quit: Connection closed for inactivity]
Mondenkind has quit [Quit: !]
jonatack has quit [Ping timeout: 264 seconds]
childlikempress has joined #commonlisp
josrr has joined #commonlisp
jonatack has joined #commonlisp
<beach>
agm: You will learn.
<agm>
:)
green_ has joined #commonlisp
amb007 has joined #commonlisp
flip214 has quit [Read error: Connection reset by peer]
danse-nr3 has joined #commonlisp
chomwitt has joined #commonlisp
mzan has quit [Ping timeout: 252 seconds]
azimut_ has joined #commonlisp
azimut has quit [Ping timeout: 255 seconds]
dra has joined #commonlisp
dra has quit [Changing host]
dra has joined #commonlisp
mzan has joined #commonlisp
jonatack has quit [Quit: WeeChat 4.2.1]
cage has joined #commonlisp
jonatack has joined #commonlisp
mzan has quit [Quit: No Ping reply in 180 seconds.]
unl0ckd has joined #commonlisp
amb007 has quit [Ping timeout: 268 seconds]
Lycurgus has quit [Quit: leaving]
mzan has joined #commonlisp
danse-nr3 has quit [Remote host closed the connection]
danse-nr3 has joined #commonlisp
agm has quit [Ping timeout: 272 seconds]
dnhester has joined #commonlisp
<dnhester>
is it possible to simply initialize a class based on a given object? Say I have an object of class A, and class A inherits from class B, and I want to initialize an object of class B with the same fields as A The reason is that I want to remove certain slot values from the object but I want to keep another instance with the values Without just doing (with-slots...)
<ixelp>
change-class | Common Lisp (New) Language Reference
epony has quit [Remote host closed the connection]
<dnhester>
worked like a charm! change-class :D
epony has joined #commonlisp
<dnhester>
beach: thanks for answering the question the other day on reinitialize-instance, it helped me find the right answer by reading the reference
aurelius_nero has quit [Ping timeout: 268 seconds]
wacki has quit [Ping timeout: 252 seconds]
wacki has joined #commonlisp
edgar-rft has quit [Ping timeout: 256 seconds]
waleee has joined #commonlisp
aeth has quit [Ping timeout: 256 seconds]
edgar-rft has joined #commonlisp
semz has quit [Quit: ZNC 1.8.2+deb2build5 - https://znc.in]
semz has joined #commonlisp
bendersteed has joined #commonlisp
<beach>
Great!
aeth has joined #commonlisp
<beach>
About your previous question, you don't initialize the class, but the instance.
OlCe` has quit []
lucasta has joined #commonlisp
OlCe has joined #commonlisp
OlCe has quit [Remote host closed the connection]
<beach>
So "Say I have an instance a of class A, and an instance b of class B, and A is a subclass of class B, and I want to turn b into an instance of A. The reason is that I want to modify certain slots of a, but I want to keep the old slot values of a in b." Yes?
anticomputer has quit [Remote host closed the connection]
triffid has quit [Read error: Connection reset by peer]
ec has quit [Remote host closed the connection]
anticomputer has joined #commonlisp
ec has joined #commonlisp
triffid has joined #commonlisp
<younder>
josrr. thanks.
traidare has quit [Ping timeout: 252 seconds]
synchromesh has quit [Ping timeout: 255 seconds]
dnhester has quit [Remote host closed the connection]
dnhester has joined #commonlisp
SunClonusX has joined #commonlisp
SunClonusX has quit [Remote host closed the connection]
SunClonusX has joined #commonlisp
SunClonus has quit [Ping timeout: 246 seconds]
SunClonusX has quit [Remote host closed the connection]
son0p has quit [Quit: Bye]
chomwitt has quit [Quit: WeeChat 3.8]
tyson2 has quit [Remote host closed the connection]
younder has quit [Remote host closed the connection]
mehlon has joined #commonlisp
pillton has joined #commonlisp
SunClonus has joined #commonlisp
mehlon has quit [Remote host closed the connection]
son0p has joined #commonlisp
green_ has quit [Ping timeout: 255 seconds]
tyson2 has joined #commonlisp
epony has joined #commonlisp
dino__ has quit [Ping timeout: 272 seconds]
rgherdt has quit [Remote host closed the connection]
dnhester has quit [Ping timeout: 252 seconds]
jonatack has joined #commonlisp
a51 has quit [Ping timeout: 264 seconds]
a51 has joined #commonlisp
epony has quit [Quit: QUIT]
shka has quit [Ping timeout: 264 seconds]
azimut_ has quit [Ping timeout: 255 seconds]
yottabyte has joined #commonlisp
a51 has quit [Remote host closed the connection]
a51 has joined #commonlisp
<Kingsy>
is it possible if I have a class to iterate over all slots on that class? I am trying to create a method that makes it easy to build a hashmap of the class without having to manually setf for each slot. its annoying with classes that have lots of slots.
dnhester has joined #commonlisp
donleo has quit [Ping timeout: 268 seconds]
synchromesh has joined #commonlisp
dnhester has quit [Ping timeout: 264 seconds]
<clothespin>
class-slots
synchrom1 has joined #commonlisp
<Kingsy>
clothespin: I don't know what that is.. its undefined. its not in cl?
<clothespin>
(let* ((class (class-of instance)) (slotds (class-slots class))) (loop for slotd in slotds collect (slot-value-using-class instance class slotd)))
synchromesh has quit [Ping timeout: 264 seconds]
<clothespin>
class-slots is a mop function in most implementations
<Kingsy>
slot-value-using-class is also undefined. sorry what is MOP? is this something I need to use :use?
<clothespin>
if in sbcl use-package sb-mop
ymir has joined #commonlisp
<Kingsy>
ah so its not possible with standard CLOS
<clothespin>
MOP is nearly ubiquitous, except for like CLISP