libera/#commonlisp - IRC Chatlog
Search
7:57:44
gendl__
Hi, In a source file, I have `#+sbcl (require :sb-posix)` at the top-level. And I was told by a downstream library maintainer: "You can't use that form at the top-level and it would be better expressed in the system definition file." So I'm trying to figure out how to express that in the system definition file.
8:02:04
gendl__
Well. Indeed I would expect asdf to handle them platform-specific. So does asdf search first for matching visible asdf systems, then if not found searches for requirable modules?
8:03:04
pve
I'm not sure how it's done, only that there is a special asdf-system class "require-system" for this purpose
8:07:58
splittist
Perhaps - wild speculation - the information will be recorded in the asdf system object and can therefore be queried and reasoned about, instead of thrown-away at the reader level
8:38:24
jackdaniel
pve: the rationale was that sometimes you may want to analyze the full system definition including feature-conditional inclusions
8:38:52
jackdaniel
if you do #+foo (:file "foo") #-foo (:file "bar") then one of these branches is not read, hence it is not part of the system definition itself
8:40:43
splittist
see https://asdf.common-lisp.dev/asdf.html#Required-features for a brief discussion
8:41:59
jackdaniel
sufficiently smart asdf would define its own reader and parse #+xxx inside the defsystem ,)
11:18:55
parjanya
hayley: formatting is... less complicated, apparently this is decided by 'SB-FORMAT::FORMAT-PRINT-NAMED-CHARACTER, but I couldn’t tweak it...
11:22:33
gilberth
Consider (set-pprint-dispatch '(member #\space) (lambda (s o) (write-string "#\\Space" s) o))
11:26:15
gilberth
I personally also don't like that #\Space must print as "#\ ". But not doing so would not be conforming to ANSI-CL.