• 5 Posts
  • 7 Comments
Joined 4M ago
cake
Cake day: Oct 13, 2022

help-circle
rss



![screenshot](https://merv.news/pictrs/image/ea8bcdba-923a-44a8-9e81-7d9a69bfb78f.png)

It works for adding new slots, but won’t update default values after the fact:

* (defclass point () (x y))
* (defvar p1 (make-instance 'point))
* (inspect p1)
The object is a STANDARD-OBJECT of type POINT.
0. X: "unbound"
1. Y: "unbound"
* (defclass point () (x y (z :initform 4)))
* (inspect p1)
The object is a STANDARD-OBJECT of type POINT.
0. X: "unbound"
1. Y: "unbound"
2. Z: 4

* (defclass point () ((x :initform 3) y (z :initform 4)))
* (inspect p1)
The object is a STANDARD-OBJECT of type POINT.
0. X: "unbound"
1. Y: "unbound"
2. Z: 4

Even this seems like black magic to me.


Hmm, here’s a SBCL session that seems to contradict him:

> (defclass point () (x y))
#<STANDARD-CLASS COMMON-LISP-USER::POINT>

> (defvar p1 (make-instance 'point))
#<POINT {1001C4F873}>

> (inspect p1)
The object is a STANDARD-OBJECT of type POINT.
0. X: "unbound"
1. Y: "unbound"

> (defclass point () ((x :initform 3) y))
#<STANDARD-CLASS COMMON-LISP-USER::POINT>
> (inspect p1)
The object is a STANDARD-OBJECT of type POINT.
0. X: "unbound"
1. Y: "unbound"

I set the default value of a slot, but it wasn’t picked up by existing objects. Same result through an accessor as well.


Yeah, the transparent data migration was something I hadn’t heard before. I can see that easily getting hairy in practice. Say you change the default value of a slot. Will CL go through all objects in memory and update the slot? What if someone had explicitly reset the slot in the past to the old default value?




The rap idea is priceless!


Do it! 😄

I don’t immediately see how you can communicate between two running cartridges on either console. LÖVE allows both network and file system access, for better and worse.

And if you can’t combine two, the screen and memory constraints seem pretty tight.

But constraints are good for creativity! It would indeed be sweet if we came up with a way to get this experience.