Created
March 5, 2024 12:32
-
-
Save elderica/e6ba582d5ecee94006cdcc4835daca1c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(in-package :common-lisp-user) | |
(defpackage :dezero-naive.steps.step01 | |
(:use :common-lisp)) | |
(in-package :dezero-naive.steps.step01) | |
(defclass <variable> () | |
((data :initarg :data :accessor @data))) | |
(defun <variable> (data) | |
(make-instance '<variable> :data data)) | |
(let* ((data #(1.0)) | |
(x (<variable> data))) | |
(format t "~A~%" (@data x)) | |
(setf (@data x) #(2.0)) | |
(format t "~A~%" (@data x))) | |
; #(1.0) | |
; #(2.0) | |
; => NIL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment