freenode/#lisp - IRC Chatlog
Search
15:43:37
Lycurgus
phoe, I meant that I presume the collective readership/audience will appreciate both the function and it's documentation
16:45:44
mfiano
I only know of one threading macro library in CL that handles diamond symbols at an arbitrary depth, and at first glance it appears this one does not.
16:46:21
phoe
arrow-macros depend on a code walker to implement this, but the author of arrows does not want to depend on such a heavy piece of machinery
16:52:48
mfiano
When I used threading macros, I switched to arrow-macros because limiting diamonds to the top level is pretty restrictive in the code I was writing
16:53:10
Bike
looks like it would happily replace the <> in '<>, since it doesn't know anything about lisp?
17:10:55
jeosol
Is there anyway, I can build an executable (SBCL) but have it run and enter a repl. I understand building application takes an entry function. I am trying to avoid (re)building a docker, if I can just rebuild on my local machine, then push to docker.
17:11:29
jeosol
Using core files, I obviously run into the issue of different runtime. Is there some hack around this?
17:11:40
lotuseater
but in a class that inherits from superclasses the :allocation :class isn't given to the subclass
17:12:17
jeosol
really. I tried to build a core file on my box but push it to the docker image and do sbcl --core corefile
17:12:53
jeosol
so maybe that is the hack I need, build an executable but leave out the entry function
17:23:59
jeosol
phoe: for my learning, when you say match, that's takes into account the machine/os. So using the same SBCL compiler v2.0.10 and say OpenSuSe, will not work for SBCL v2.0.10 and Debian
17:24:59
phoe
jeosol: AFAIK they must have the identical binary, so differently compiled binaries with different md5 hashes likely won't work
17:26:51
lotuseater
as far as i understand yet arrows are coming from category theory und functional programming for concurrency
17:28:48
_death
ebrasca: they may make sense in cases where you have a lazy processing pipeline, e.g. with series (->> (scan-file ...) (map-fn t ...) (choose-if ...) (collect)) but otherwise they're just massively abused
17:29:14
jackdaniel
is it possible on sbcl for the object to change its address (or whatever that number means) asynchronously? I mean the number in #<some-class {123412341234}>
17:30:29
jackdaniel
well, asynchronous in a sense that I'm not doing anything what could cause side effects, that's not the right term
17:31:09
jackdaniel
but it "looks like asynchronously", and it confused me quite a bit, because I was trying to find a piece of code that swapped my object (and find out when that has happened)
17:32:30
jackdaniel
thanks Bike and beach, that's the only explanation I could come up with - and printing a gensym seems to "prove" that it is the same object
17:33:47
beach
Sure. It happens to me all the time, given that I probably allocate huge amounts of memory, so the GC runs all the time.
17:38:34
jeosol
I know there is talk about CL libs having poor documentation, but given most libs are developed by small teams/individuals, there isn't much time to do full documentation for every function and also show how to use them.
17:38:57
jeosol
I say that in the light of having discovered gems and use cases by actually looking at library source code.
17:39:18
beach
jeosol: I don't think you can generalize that way. The libraries I mentioned before are usually well documented.
17:39:27
phoe
jackdaniel: yes, the GC is moving these objects - I asked about specifically this on #sbcl some time ago
17:39:46
phoe
in other words, the identity printed by print-unreadable-object is allowed to change at any time
17:40:29
jeosol
Pardon if my comment came out as a generalization. it is also not intended to mean we should not document or make things clearer
17:41:33
jeosol
I am considering teaching CL in a class setting, not formal, but introducing the students, so look for ways to avoid the frustration I hear with emacs and other tooling. I am no expert though
17:42:00
jeosol
esbrasca: I guess, I conflated "tutorial/examples" with documentation. I meant the former.
17:43:16
jackdaniel
sure, I'm usually recommending this writing by sjl_ when the topic of documentation comes up, because I've really enjoyed reading it
17:48:52
jeosol
beach: I do remember your metamodular document has a section about guidelines for documenting libraries
17:50:48
beach
jeosol: Oh? Great! I can never remember what stuff I write. People keep reminding me all the time.
17:51:58
jeosol
I remembered that section because around that time, I was trying to write and document better; so I looked at the google guide, norvig/pitman guide etc.
17:52:34
jeosol
beach: IIRC, in one of your libs you recommented for better doc, you advocted prepended % to slot names
17:53:45
beach
jeosol: I have to vanish. My (admittedly small) family just announced that dinner is served. I'll be back tomorrow morning (UTC+1).
18:00:13
ebrasca
jackdaniel: Probably I need to practice this fantastic tips of how to write documentation, instead of only reading it.
18:06:32
ebrasca
ACTION think if he master documentation he is going to have 2 topics to learn left : profiling and testing.
18:08:55
fiddlerwoaroof
Testing isn't so hard in lisps: the sorts of things you do to make a codebase nice to work with in the REPL makes testing easier too
18:09:20
fiddlerwoaroof
And things like WITH-INPUT-FROM-STRING make a huge difference here, compared to Java or somethign
18:10:51
fiddlerwoaroof
What I've found is that separating the part of code that interacts with outside things (disks/etc.) from the code that doesn't need to (file format parsers, etc.) makes a huge difference
18:11:30
fiddlerwoaroof
ebrasca: that's tricky :) property testing helps there, but it can be relatively slow
18:12:03
fiddlerwoaroof
I find well-chosen unit tests are often sufficient for the certainty you need in most cases
18:12:43
ebrasca
fiddlerwoaroof: How can you be sure you have 100% coverage or data waiting to be lost?
18:19:52
fiddlerwoaroof
ebrasca: yeah, for filesystems it gets more complicated because the stakes are higher
18:20:47
fiddlerwoaroof
In my experience, though, unit tests are a good way to discover edge cases and especially because they're easier to write and maintain than a lot of other sorts of tests
18:21:19
fiddlerwoaroof
Proofs, for example, often are too difficult to change to be feasible for anything except the most important code
18:48:09
phoe
which is an original development, not coming from clojure - mostly because clojure doesn't have places
18:48:31
fiddlerwoaroof
ebrasca: well, I'd say the first thing to do is to write unit tests, because that's easy to do and it'll help you think about things like API design and code structure
18:48:55
fiddlerwoaroof
phoe: is that just relying on the macroexpansion provisions of the specification?
18:49:51
phoe
fiddlerwoaroof: not really; I am currently rewriting arrows to expand into LET* for readability
19:16:15
phoe
my current implementation of arrows makes the assumption that each form passed to the threading macro is going to be evaluated; splicing such a form into a form with special evaluation rules, e.g. OR, breaks this assumption
19:16:39
phoe
and now that I think of it, I have no idea if this is acceptable from an implementation of arrow macros
19:19:45
fiddlerwoaroof
I've written a lot of Clojure code that uses arrows with macros that change evaluation rules
19:24:42
pfdietz
Property based tests are wonderful and powerful. I use them to find all sorts of bugs.
19:25:16
pfdietz
All those weird SBCL bugs I report? All due to various kinds of property based tests.
19:26:12
pfdietz
Example property: "the SBCL compiler should never signal an error, even on erroneous input".
19:26:42
pfdietz
Or: "a valid Common Lisp expression should do the same thing regardless of OPTIMIZE settings".
19:28:57
fiddlerwoaroof
pfdietz: yeah, it's a great tool my experience, though, is that I use the property tests to generate more deterministic test cases in my unit test suite.
19:30:39
pfdietz
Sure, you want to capture the failures, just to make sure they dont unfix themselves later. But PBT keeps finding new bugs as development introduces them. And sometimes it finds a very low probability failure, something that took billions of inputs to expose.
19:39:33
pfdietz
Nice! It's interesting that they have value later. That may say something deep about testing.
19:52:53
pfdietz
I have considered using random test generation and minimization to generate unit tests, not by keeping failures, but by keeping tests that satisfy some other property (coverage, killing mutants). This might give a distilled unit test set that preserves some of the value of a prolonged run of the random tester.
19:57:42
fiddlerwoaroof
pfdietz: I think unit test's primary value is in helping you figure out the problem space as you're working
19:58:24
fiddlerwoaroof
Making it efficient to run 100+ picked examples every minute or so to verify that you're making progress
21:28:15
no-defun-allowed
The HyperSpec is a bit like a dictionary. It is rarely a good idea to try to learn how to do things from it, but you can clear up your understanding using it.
21:37:40
dbotton
In quickproject the defpackage is placed in package.lisp is there a reason for not placing the defpackage in the actual package at the top?
21:42:30
dbotton
Correct, lotuseater was offering possible answer to my question that multiple files being used for same namespace
21:43:37
mfiano
modules have dependencies, just like the root module. You don't have to load serially
21:43:55
dbotton
So we go back to my question, rephrased, what is the advantage of having a packages.lisp file instead of leaving defpackage at start of files
21:44:52
mfiano
library chosen randomly: https://github.com/Shinmera/verbose/blob/master/verbose.asd#L17
21:45:07
lotuseater
I also had this question in my mind when it comes to frequently changing some files
21:46:52
dbotton
Ie you have to copy out the definition of the package from the packages file when re-using the package
21:47:38
mfiano
I am having a hard time parsing what you are even saying. Maybe someone else can ask the right question so you can ask the right question.
21:47:54
dbotton
Let me give an example, if I have a file that defines a package of string functions
21:48:29
dbotton
If I want to copy that file to a new project, I have to copy that file and also cut and paste from that packages.lisp
21:50:05
Xach
dbotton: if a project is big enough to have a separate package file, it's common to define a system for it, and depend on the system, not copy things around.
21:50:35
Xach
I sometimes copy rather than depend-on, but only for pretty small self-contained things. Single functions, or self-contained files of related things.
21:53:06
dbotton
Ok, so you find in large projects defining all the packages in one file works out well.
22:20:51
fiddlerwoaroof
I've found it more convenient to centralize packages in package.lisp because then, when I want to move a set of definitions to a new file, I just put (in-package :the-package) and copy/paste
22:21:08
fiddlerwoaroof
Ultimately, I want to store the code in the lisp image and treat files as disposable
0:17:19
lotuseater
cepl seems nice but I'm not aware how to start, the videos are for the old version
0:42:03
mfiano
Speaking of compiler macros, I don't remember the last time I needed to write one, but I have a question related to them: Do I have to gensym when introducing a new lexical variable as part of its expansion to prevent unwanted capture in the same case as for regular macros?
1:56:28
_death
mfiano: yes.. e.g., (define-compiler-macro foo (x y) `(let ((z ,x)) (list z ,y))) (let ((z 123)) (foo 1 z)) ==> (1 1)
2:37:13
_death
https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node101.html#SECTION001240000000000000000