freenode/#lisp - IRC Chatlog
Search
18:05:30
phoe
SpaceIgor2075: DEFPACKAGE options are not quoted, and remember that strings respect case whereas symbols, by default, don't
18:22:01
SpaceIgor2075
phoe: 1. why is :cl used instead of 'cl? 2. (:export #:new-stuff) has a # because new-stuff is a function, am i right?
18:22:56
phoe
and writing FOO causes the reader to intern the symbol named "FOO" in the current package
18:23:33
phoe
when you evaluate a DEFPACKAGE, this can happen in literally any package, because usually only after a package is defined you use IN-PACKAGE to switch into it
18:23:53
phoe
so a DEFPACKAGE form that has unqualified symbols like FOO in it can intern unnecessary symbols into other packages.
18:24:51
phoe
which kiiinda sidesteps the problem but not really, because now symbols are interned into the KEYWORD package, which can produce unnecessary keywords
18:25:15
phoe
option 3) is to use strings, which is permissible, but has issues if someone uses a different readtable case than the standard, upcasing one
18:26:01
phoe
and I personally suggest to use #:foo for everything in DEFPACKAGE, including imports and uses and exports and package-local nicknames
18:26:28
phoe
so (defpackage #:newpackage (:use #:cl) (:export #:new-stuff)) (in-package #:newpackage)
18:31:31
minion
sauvin: tclcs: The Common Lisp Condition System, https://www.apress.com/us/book/9781484261330
18:35:12
SpaceIgor2075
CL seems to be quite deep. Are there any books dedicated to other programming languages' condition systems?
18:35:12
phoe
the intended one was to write about the ideas, implementation, and use cases of the condition system
18:35:42
SpaceIgor2075
Or is it specific to CL that you can write a whole book on it's condition system?
18:35:59
phoe
the accidental one: I seem to have described how to implement a non-trivial piece of Common Lisp code, bit by bit, while testing it heavily in the REPL
18:37:53
Nilby
If we just copy the irc logs and throw a few headings on, i feel like we'd have like 2 more phoe books pretty quick.
18:42:23
sauvin
I should imagine that if the S/N ratio here is high enough, browsing the logs would be a great tool for brainstorming all KINDS of random stuff.
18:42:48
phoe
#lisp is moderated rather heavily when it comes to off-topic discussion, so S/N should be high in general
19:39:43
SpaceIgor2075
_death: really, they changed the standsrd? I thought CL didn't change for decades
19:40:47
_death
SpaceIgor2075: in fact for a newbie, it may be better to first read a book like Practical Common Lisp first
19:46:50
_death
kind of, except K&R was a short guide and CLtL2 is more a sprawling creature that's between spec and guide
20:11:20
VincentVega
Guys, is the funcall version slower here, and if yes is there a way not to repeat arg, while retaining performance?
21:02:14
scymtym
fiddlerwoaroof: if you like linedit, would this be interesting for you: https://techfak.de/~jmoringe/linedit-1.ogv
21:13:43
scymtym
phoe: yes, eclector-based highlighting. more or less the same thing that did the highlighting in the eclector presentation
0:57:12
fiddlerwoaroof
I tend to think of DI more as "passing arguments to functions" than "dynamic variables"
0:57:50
fiddlerwoaroof
Spring's XML stuff or Guice might be more like dynamic variables, but those are both abominations
0:59:54
fiddlerwoaroof
One way to do DI in lisp is "defun over lambda" (defun (dep1 dep2) (lambda (&rest other-args) ...))
1:02:16
fiddlerwoaroof
scymtym: that video is cool; my only objection is there's no code for me to try out...
1:03:56
scymtym
fiddlerwoaroof: i can try to publish an initial version tomorrow. i just didn't want to put too much effort into a thing that i wouldn't use myself
1:05:30
fiddlerwoaroof
scymtym: yeah, makes sense, I have a "lisp-sandbox" repository on github for this sort of demo
1:09:44
fiddlerwoaroof
One thing that would be useful with eclector is a more intelligent way to diff CL code
1:11:38
fiddlerwoaroof
git supports custom diff tools, and a syntax-aware diff for CL would be really helpful
1:13:45
fiddlerwoaroof
Interesting, I've looked for this every couple months and never run across an implementation that would work.