freenode/lisp - IRC Chatlog
Search
17:51:23
sjl
That's another thing I wasn't clear on -- if I subclass the source, will that new subclass be used for ALL mp3 files?
17:52:13
Shinmera
PLAY doesn't do too much so you can also replicate what it does easily enough if you already have an instance.
17:53:10
sjl
So it would be something like (defclass music-source (mp3-source) ...) ..after method on setf ended-p... (play "foo.mp3" :music :source-type 'music-source) ?
17:53:32
Shinmera
Well, I'd probably make what you want to play next a slot on the class so you can chain things and parametrise it, yeah?
17:55:07
Shinmera
Actually you'd probably want to do it on a :before method and instead do something like (add (make-instance 'bla ...) (mixer source))
17:55:56
sjl
(mixer source) is to automatically add it to the same mixer as the thing that's ending?
18:42:37
Xach
Hmm, what's a good example of a project named "cl-foo" that defines a system named "foo"?
19:07:32
minion
dim, memo from _death: maybe you'll find what I hacked this past few hours a useful start - https://github.com/death/TIC-80
19:52:30
pjb
_death: given that you can define defglobal in two lines, why should it have it? Just do it!
20:00:37
scymtym
pjb: which aspects would that replicate? performance characteristics or behavior or both?
20:10:22
scymtym
then again, _death said "like sb-ext:defglobal", so he could have referred to a subset of its behavior
21:14:41
aeth
(defparameter *foo* (list 1 2 3)) (define-symbol-macro foobar (elt *foo* 2)) (macroexpand-1 'foobar) => (ELT *FOO* 2)
21:16:28
aeth
in fact, referencing things that aren't global won't work, e.g. (let ((temp (elt *foo* 2))) (define-symbol-macro barfoo temp)) ; barfoo will only work in places where there's a defined temp, like e.g. (let ((temp (elt *foo* 2))) barfoo)
21:27:52
aeth
I suppose the way to handle it properly would be to have a mutable global *foo* (probably an array or hash table, though) because otherwise setf won't work as expected.
21:27:54
_death
pjb: yes, for my purposes defvar+define-symbol-macro could work.. I just wanted to know whether ecl already has such a thing
21:34:57
aeth
At the very least, there's no mention of it here. https://common-lisp.net/project/ecl/static/ecldoc/Extensions.html
21:36:35
_death
guess that for a nicer CL experience w/ tic-80 there'd have to be a specific module.. but that is a job for another time
23:16:21
pierpa
CCL's DEFGLOBAL doesn't do what I understand you are talking about here. It's only vaguely related to global variables.
3:36:24
Josh_2
I left my laptop on, I was attacked by someone I know so that sobered me up pretty fast