freenode/#lisp - IRC Chatlog
Search
18:23:23
makomo
pjb: i assume you meant the Liskov substitution principle? i've never seen that spelling. anyway, how is that related to LSP?
18:23:23
minion
makomo, memo from pjb: notice that defgeneric &rest with defmethod &key doesn't respect the Lyskoff substittution principle. Avoid it!
18:27:08
makomo
pjb: hm i think i see what you mean but in this case it doesn't have to do with types, which is the original setting for LSP, right? the problem is that the methods don't align with the interface specified by the generic function
18:27:26
makomo
i.e. S doesn't act like a T, even though it's a particular implementation of T. S being the method, T being the generic function.
18:29:25
makomo
i.e. if the method then specifies &key in its lambda list and you pass an unspecified keyword argument, why isn't that an error?
18:29:32
specbot
Congruent Lambda-lists for all Methods of a Generic Function: http://www.lispworks.com/reference/HyperSpec/Body/07_fd.htm
18:29:45
makomo
the last sentence of case 4 talks about it, but wouldn't that apply only when case 4 is in effect?
18:30:40
makomo
in this case the generic function doesn't specify &key anywhere, so :allow-other-keys shouldn't be implicitly true
19:06:15
pjb
makomo: it is related to the type of the &rest arguments. &key imposes that the &rest argument have an even length, and that each even-nubered element be a symbol.
19:23:42
ealfonso
anyone familiar with hunchentoot know how to redirect an http request to https on the same port when using ssl-acceptor?
19:38:08
makomo
pjb: mhm, i see. but do you know why no warning is issued for invalid keyword arguments then?
19:39:38
pjb
In anycase, giving a meaningfull warning would require global analysis, after all the defgeneric and defmethod forms for this method have been compiled.
19:52:16
makomo
pjb: by warning i meant error. for example, passing unspecified keyword arguments to a normal function is an error
19:54:11
aeth
You can actually afaik get some degree of global analysis in SBCL with (setf sb-ext:*derive-function-types* t)
19:54:31
aeth
It's behind a flag and defaulted to NIL because (1) it violates parts of the ANSI standard and (2) it will break the interactive flow of CL
19:55:02
aeth
It assumes function types will never change. I'm not sure if it also applies to generic functions.
20:02:59
aeth
I think you could have a conforming implementation with global analysis always on if you're willing to have the extra bookkeeping overhead of tracking when things are redefined and knowing what else to redefine in that case. That would also improve the experience with macros and inline functions.
21:54:46
cgay_
Go has that but I have to say I haven't seen it used much. I think in a local scope it's not that useful, though it provides a little more indication of intention.
21:56:12
Ukari
i wanna use lexical defconstant or a lexical let which can't assign twice, because it might make code more clear when a variable couldn't be changed
22:01:02
pfdietz
(let-const ((x e)) . body) ==> (let ((#:G0001 e)) (symbol-macrolet ((x (identity #:G0001))) . body))
22:02:30
cgay_
bike-shedding: would be nice to be able to indicate const-ness for a particular variable in a LET, rather than introducing a new level of indentation.
23:23:36
pillton
You could also use the position return value of read-from-string and its start argument.
3:58:46
aeth
What do people use for Lisp testing? I've seen two. Roswell. And now this lisp-devel Docker. https://lispcookbook.github.io/cl-cookbook/testing.html#gitlab-ci https://hub.docker.com/r/daewok/lisp-devel/
4:09:40
edgar-rft
aeth: there's an ANSI test suite for testing Lisp, but I assume that you're not looking what you're asking for.
5:03:34
low_brain_cache
I haven't registered a nick but I've been on here as beginner_supreme, cl0s, Common_Lisp (I think), etc.
5:06:37
low_brain_cache
I figure that since nicks are temporary assuming low activity, and registering a nick doesn't necessarily disallow others from using it, there's no reason to register
5:13:32
LdBeth
I believe freenode also allow to register several different nick under one mail address for bot or something
5:14:47
low_brain_cache
Is there a freenode manual of commands? /help lists a table but /help <command> doesn't do anything. <- Sorry for the non-lisp question but since we're on the topic of IRC... ;)