freenode/#lisp - IRC Chatlog
Search
15:16:31
makomo
is there a way to force ASDF to recompile all dependencies of a system as well? (asdf:load-system :something :force t) only forces the recompilation of the system :something
15:16:52
makomo
it will recompile dependencies only if a change is detected, but not unconditionally
15:19:05
phoe
makomo: is there a way to get a list of all dependencies, direct and indirect, of a system?
15:20:12
phoe
makomo: you could perhaps do that by calling #'asdf:system-depends-on and #'asdf:find-system over and over
15:21:33
phoe
I have no idea if ASDF actually has anything that force-recompiles a system along with all dependencies
15:23:36
makomo
"If force is :all, then all systems are forced to be recompiled even if not modified since last compilation."
15:24:00
Jachy
phoe: Swank has a swank-asdf.lisp file with slime bindings, though it wasn't working for me so I changed it a bit and bound it to another slime xref type. https://pastebin.com/qM3yLbeW
15:31:51
pjb
akater: at first, I would have suggested a pattern matcher, for the unifying of the gensyms. But any existing function will have to be patched to do exactly what you need.
15:32:15
pjb
(com.informatimago.common-lisp.cesarum.pmatch:match (macroexpand-1 '(moo 42)) '(list 'foo (list #:foo) 42 #:bar)) #| --> (:failed (:different #:g7006 #:foo)) |#
15:32:34
pjb
akater: you could read the sources of those functions, and write the one you need from them.
16:23:55
phoe
for instance, most implementations prefer to implement Unicode rather than implement the part of standard that ensures that there is a 1-to-1 mapping between all lowercase and uppercase characters
16:25:06
phoe
because the CLHS says, "prog2 evaluates first-form, then second-form, and then forms, yielding as its only value the primary value yielded by first-form. "
16:33:55
beach
dtw: You could "fix" the dpANS, which is freely available, but what would you do with the result?
16:35:58
beach
dtw: I have a planned project for creating a new language, called WSCL (for Well-Specified Common Lisp) based on the dpANS. The new language will be like Common Lisp, but without the mistakes in the Common Lisp HyperSpec, and with more situations specified than what is the case for the Common Lisp HyperSpec.
16:37:41
beach
Step 1 is to parse the dpANS into a single LaTeX document (in several files) as opposed to the dpANS which is a TeX document for each chapter.
16:38:56
selwyn
does there exist communication between Common Lisp implementors concerning common approaches with which to resolve the known inconsistencies in the standard?
16:39:55
Fare
I mean, occasionally, someone who cares about a particular aspect sends bug reports to lots of implementations, but that's all.
16:42:11
Fare
While developing ASDF3, I did lots of work getting pathname bugs fixed, some CLOS bugs related to class redefinition, or readtable issues.
16:43:27
beach
Fare: I think of a bug as a failure to respect the standard, which is different from the inconsistencies of the standard itself.
16:43:35
Fare
which led to a few implementations adopting read-only readtables for the standard readtable, for instance
16:44:53
Fare
The standard is far from perfect, but some worship it as a sacred text rather than a work in arrested progress.
16:52:22
pjb
Fare: (copy-readtable nil) returns a new standard readtable. So why would we need read-only readtables?
16:54:56
makomo
Fare: not sure if you've seen my ping from a week or two ago, but i'd like to let you know that i've opened a PR for fare-quasiquote (not a bug, don't worry :-))
17:03:28
Fare
pjb: see the discussion a few years back on asdf-devel. The standard somewhere (in the glossary?) describes the standard table as read-only
17:12:02
jmercouris
when you guys are adding docstrings to a function and it spans multiple lines, do you indent it to be inline with the first line?
17:14:46
edgar-rft
jmercouris: looks shitty in the code but looks much better when read via (documentation ...)
17:17:27
jackdaniel
to be honest I do put newlines in them myself, but I think it is a wrong thing to do - it is the printer responsibility to wrap by word at chosen column
17:18:53
jmercouris
however I think the other tool should allow and understand newlines in the source code
17:19:11
jmercouris
as far as I understand it, if you want a new paragraph, you sould have two new lines
17:19:23
jackdaniel
if you put newline there is no way any tool could infere it is something what is a soft newline
17:30:25
pjb
jmercouris: In any case, I assume that a tool that extracts the docstring and use it will reformat it according to some rule, so you can do as you wish. The only problem is that we have sevearl markup syntax of possible formats for docstring…
17:30:52
pjb
jmercouris: in CL not much. In emacs lisp, emacs assumes the first line of the docstring contains a summary.
17:31:17
pjb
jmercouris: the point is that it depends on the tools that interpret the contents of the docstring. Some people use HTML!
17:31:31
Fare
makomo, the first bullet point still doesn't display properly. Thanks for the magic quoting.
17:32:16
pjb
jmercouris: you could use #.(my-doc-string-format "…") and generate different strings depending on the circumstances.
17:32:19
jmercouris
either way, I don't use generated docstring, I only care about how emacs interprets
17:32:52
pjb
If the text is read to generate html documentation, my-doc-string-format would convert to html, if it's read to compile, it would convert to a simple ascii docstring, etc.
17:33:51
pjb
Another one is the localization. Some times, you want to have different language versions (French, English, Russian, etc)
17:37:48
jackdaniel
in London I'm using output records for documentation, so it may contain arbitrary content with specialized rendering method
17:38:36
jackdaniel
so documentation output-record is not limited to text and is disjoint from the source function definition
18:11:52
asdf_asdf_asdf
(map 'list #'(lambda (x) (if (evenp x) x)) '(1 2 3 4 5 6 7 8 9)) => (NIL 2 NIL 4 NIL 6 NIL 8 NIL)
18:15:01
asdf_asdf_asdf
OK, thanks - works. But how do the same on the map - my example above. Instead NIL print "nothing"?
18:15:51
jackdaniel
map collects result for each element, if there is no result NIL is returned instead
18:17:08
jackdaniel
(collecting (evens) (map nil (lambda (elt) (when (evenp elt) (evens elt))) col) (evens)) ; collecting is a macro which has numerous variants, i.e there is implementation of it in cl-collectors (or something named like that)
21:50:30
didi
Hum. Why (constantp (quote 42)) => t, but (constantp '(42)) => nil? Shouldn't ' be identical to quote?
21:52:55
pjb
42 always evaluates to 42. (42) signals an error (and each time a different condition is created anyways), so in no way can it be considered a constant expression.
21:52:56
didi
Related, SBCL describes CONSTANTP with "True of any FORM that has a constant value: self-evaluating objects, keywords, defined constants, quote forms.". Isn't (quote (42)) a "quote form"?
21:54:11
pjb
didi: be careful, people are sloppy, and then say IS when they mean EVALUATES TO. I can't fathom how they can do that.
22:14:31
makomo
pjb: the same idiom/construct appears in the context of arguments to macros, docstrings, etc.
22:15:09
makomo
for example, if a macro M takes an argument A and produces an expansion which arranges for A to be evaluated at runtime, people usually write "M evaluates A"
22:16:05
makomo
one could interpret that to mean evaluate at macroexpansion-time, but that's rarely the case so for such behavior it is usually explicitly clarified that macroexpansion-time is meant
22:19:27
makomo
another thing that comes to mind is saying "the variable M" when what you really mean is "the variable named by (the symbol) M"
22:20:50
makomo
sometimes it's good to clarify what you mean, but sometimes the description just gets overly verbose, hard to read and annoying to write
22:21:45
makomo
so blurring the line between an object and the name for that object (or similarly (but not completely, i guess) between an expression and the value of that expression) comes in handy :-)
22:51:10
phoe
https://github.com/ruricolist/serapeum/blob/cd82e23548e79038233c3ac7b165edc83ba22d69/packages.lisp#L3 I see.
22:58:56
phoe
There was some ASDF option that specified the relative pathname under which all source files are available. What was that?
22:59:19
phoe
Say, I have /foo/foo.asd and /foo/src/bar.lisp - I want to have a component (:file "bar") for it.
23:17:06
phoe
I'm becoming a better lisper every day - I've never used this ASDF option until today, even though I've created multiple systems that have their files separated like that
23:38:34
pjb
phoe: (subseq (com.informatimago.common-lisp.cesarum.package:package-exports :cl) 0 10) #| --> (fboundp some end-of-file caadr *read-eval* member symbol-function array-element-type terpri nil) |#
2:09:01
jmercouris
I have (flet ((func (x) (print x))) (mapcar func listz)) and it complains that func is unused
2:10:05
jmercouris
why is it sometimes to only quote a symbol rather than using the explicit function notation
2:14:35
didi
jmercouris: Others can explain it in more details, but FLET dines local named functions. By calling (mapcar 'func listz), you're passing a function designator, not the function.
2:15:17
didi
"The names of functions defined by flet are in the lexical environment; they retain their local definitions only within the body of flet."
2:16:10
jmercouris
so (quote func) is only a symbol that designates a ffunction rather than #' which somehow explicitly notes a function
2:19:32
White_Flame
since FUNCALL and APPLY accept function designators, anything that falls through to that implicitly supports them
2:21:20
White_Flame
in your original question, mapcar can't see the lexical binding of FUNC, and nothing you pass to it links to it
2:21:32
didi
jmercouris: I learned to use #' after a COMPLEMENT failed with a symbol deep inside my program.
2:25:08
didi
jmercouris: Read chapter 3. Scope and Extent. It will do a better job than I will ever be able to.
2:34:09
White_Flame
jmercouris: did you also get an error about FUNC being unbound when you're passing it into mapcar?
2:34:45
White_Flame
so you're just passing a symbol. Mapcar can't see anything about that symbol besides its toplevel symbol-value, symbol-function etc
2:37:06
jmercouris
my peak has been around 180, and I can average 100-120 for sustained periods of time
2:45:26
pjb
(flet ((fun-fbound-to-fun (x) (print x))) (mapcar (function fun-fbound-to-fun) '(1 2 3)))
2:47:17
PuercoPope
There is an advantage to using the symbol instead of the function itself. Because the symbol is looked up when the code is run if you redefine the function you'll get the new function instead of keeping a reference to the old function object until you recompile the call sites as well