Search
Tuesday, 17th of October 2017, 18:40:36 UTC
18:42:37
Xach
Hmm, what's a good example of a project named "cl-foo" that defines a system named "foo"?
18:42:46
Xach
Or does that only happen on the system-name -> package-name level?
18:42:56
Xach
ACTION writes some code to find out
18:49:55
Xach
js defines cl-js, cl-yacc defines yacc
18:50:01
Xach
many more examples found by Coding
19:07:31
dim
lots and lots, I've had to struggle with that in ql-to-deb
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:07:43
dim
_death: that looks very interesting thanks!
19:08:58
_death
wonder if ecl has anything like sb-ext:defglobal
19:11:55
_death
guess just setfing also works
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:03:36
scymtym
how would you define it? not asking sarcastically - i really can't think of a way
20:05:59
pjb
It's found in libraries, either as defglobal or as deflex.
20:07:12
scymtym
symbol macros can be shadowed by LET bindings. i think DEFGLOBAL prevents that
20:08:45
pjb
If it's lexical, then it should be shadowable lexically.
20:09:26
scymtym
maybe, but that's not what SB-EXT:DEFGLOBAL does
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:14:52
aeth
I think that would be the problem with defining a global via define-symbol-macro
21:15:23
aeth
people might want a copy instead of a reference
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:17:00
aeth
It's fine for things like (define-symbol-macro foo 42)
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:28:26
pjb
and ccl and clisp and cmucl and abcl and and and
21:31:09
aeth
Where's ecl's defglobal located?
21:33:45
_death
pjb: I embedded ecl, not the other ones
21:34:18
aeth
It doesn't look like ECL has a defglobal. SBCL and CCL do.
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.
23:18:35
pierpa
well, ok it's related, but it doesn't do what it's name suggests.
23:38:43
aeth
I guess I should've written a full test then
0:31:49
QualityAddict
** NICK Guest68997
3:07:22
beach
Good morning everyone!
3:30:40
Josh_2
Morning beach I've not been to bed yet
3:33:53
beach
Josh_2: Whether that is good or bad depends on the time zone you are in.
3:34:04
Josh_2
Well I'm in Scotland
3:34:20
beach
Or, rather, it would have been if it were me.
3:34:23
Josh_2
Well I went out to a nightclub with some friends
3:35:39
beach
And you come to IRC afterwards? Hmm.
3:36:24
Josh_2
I left my laptop on, I was attacked by someone I know so that sobered me up pretty fast
Wednesday, 18th of October 2017, 6:40:36 UTC