freenode/#lisp - IRC Chatlog
Search
13:35:23
Xach_
flip214: i usually use *compile-file-truename* there. i'm not sure it is the critical difference though.
14:45:56
beach
What standard containers would be reasonable for an application programmer to invent a reader syntax for? Clearly lists, arrays, standard objects, and hash-tables are reasonable. Structs too, but I don't know how to do those portably. Anything else? I can't see anyone trying to invent a syntax for packages, for example.
14:51:37
Zhivago
I think that javascript/json hit on the two most important cases -- maps of symbols to values, and contiguous maps of counts from zero to values, and Steele on the third, less important case of maps from arbitrary object to arbitrary object with his xapping syntax. It would be nice to have more consistent syntax using those forms for the various different implementations of mappings in CL.
14:52:09
Zhivago
Given that, everyone seems reasonably happy to build syntaxes for things like packages on top.
14:53:19
Zhivago
But modern lisp isn't for reasonable people, so that line of reasoning probably won't work out too well.
14:56:34
beach
So, I'm not planning to invent any input syntax. But I need to know what kinds of objects to traverse to look for instances of #n# after reading some expression. I came up with the list that I wrote, and I am wondering whether any other standard containers could apply. Most application-specific stuff would be in the form of standard-objects, and I can handle those.
14:57:28
jmercouris
before this turns into an x-y problem, I was thinking of offering a set of trusted systems/packages for my users via running a quicklisp server for nEXT
14:57:45
jmercouris
Xach_: So I just need to host these in some www on some web server and it just works?
14:58:05
Xach_
jmercouris: yes, the trick is to get the right contents of the text-based index files, which is unfortunately not documented.
14:59:41
jmercouris
Can someone install lets say something available on official quicklisp repository and then on that same image install something from another repository?
14:59:43
Xach_
jmercouris: you can have any number of "dists". the one i provide is named "quicklisp". you can add more than one as long as it is named something else.
14:59:55
Zhivago
beach: Predicting which kinds of objects might use that syntax seems fraught with exciting possibilities for the wailing and gnashing of teeth.
15:00:17
jmercouris
Xach_: Okay, very cool, this is probably the mechanism I will use then for my "package manager"
15:00:29
Xach_
jmercouris: when you load a project named "foo", and more than one dist provides it, there is a score system to decide which dist "wins"
15:00:51
beach
Zhivago: Well, I did turn the traversal into a generic function, so anyone who has specific needs can supply a method. I just want to provide as many cases as I can.
15:00:57
Xach_
it is automatically set to the most recently installed dist, but the score can be changed
15:01:38
Xach_
jmercouris: I use a program called "quicklisp-controller", but it is pretty specific to a number of manual processes I use, so I don't know if it would be good to use directly. it might be good for learning about how things work.
15:01:44
jmercouris
It's something I'll be doing in the coming months, I'm sure I'll have more questions, perhaps I can document the index files when I do that
15:02:31
jmercouris
Xach_: I assume you are referring to this: https://github.com/quicklisp/quicklisp-controller?
15:03:43
pjb
beach: AFAIK, any kind of object can contain #n# in their serialization; standard are lists, vectors and structures (compound objects), but user objects may also have them. Sometimes, in surprising places.
15:04:37
pjb
beach: eg. one could expect to find them in pathname (I don't think that it's specified that make-pathname copies strings for then components, even if it's probably what it does).
15:04:40
beach
pjb: Yes, but like I said, I handle most user object, because I handle STANDARD-OBJECTs. All I care about now are other standard containers.
15:05:28
beach
But someone could very well write a reader macro for a hash table, so I include those.
16:40:17
jmercouris
What do you guys think of this secondary icon for next: https://imgur.com/a/sXM6M as compared to the original icon: https://next-browser.github.io/assets/icon_512x512.png
18:35:00
flip214
(DIRECTORY "*") vs. (DIRECTORY "*.*") vs. (DIRECTORY "*.*.*") all return different things...
18:35:20
pfdietz
DIRECTORY on a pathname ending in a wildcard, although I don't know that gives subdirectories.
18:42:02
shka
it consist of a handful generic functions (like make-state) that are called all over again and it turns out whole thing is just around 2.5 times slower then simple reduce
18:42:15
flip214
shka: also this might be interesting: https://github.com/guicho271828/inlined-generic-function
18:42:54
flip214
well, bad luck ;) if I knew more about your constraints I might be able to offer better ideas
18:48:53
flip214
shka: you can try, but I don't have much time left before having to fetch my loved one.
18:49:01
beach
shka: In fact, you could. Generic functions with the SICL-style dispatch can coexist with native standard generic functions. But it would take some work on your part. :)
18:49:38
shka
in dplyr you can call group-by, and call aggregation on the result to get aggregation for each group
18:59:07
beach
Maybe. I never think of it. He is still "Em" to me ("younger sibling" in Vietnamese).
20:38:00
jasom
uiop makes one decision I really don't like, and that's parsing ".." as :back vs :up in unix namestrings
21:45:47
jasom
jmercouris: different implementations handle symlinks very differently, so uiop, to a certain degree, gives up on portably handling symlinks
21:48:29
jasom
jmercouris: it would be a lot of code to get it right portably and ASDF doesn't rely on :back/:up working differently so it's out of scope to add that much complexity
21:48:55
jasom
this is by memory, I can find the actual discussion if you want the definitive answer
21:53:18
jmercouris
Nah, I don't need exact details, I'm not going to make a PR or anything, I was just curious if there was some good reasoning behind it
21:54:05
jmercouris
I wish that CL paths weren't so strange, I understand their design and historical significance, but maybe the implementation can be extended with a new way to make and handle paths
21:54:27
jmercouris
Of course we can always write a library to do this, so it doesn't truly matter, but yeah
22:24:43
aeth
Shinmera: The advantage of a custom do-foo is that even though it looks like the "for foo in bar" idiom that can be duplicated manually or with loop, it can be made to be non-consing without changing the API because it's a macro. Basically, foo could be iterated over more efficiently. In this case a loop with "in (users ...)" is different than "(do-users (user (users ...)) ...)"
22:26:35
aeth
Initially, they would probably be essentially identical, but because do-users is a custom macro that doesn't have to follow the loop semantics, do-users could be rewritten to essentially lie about calling users (which would cons a list) and instead iterate in a way that doesn't allocate a user list.
22:27:26
aeth
For IRC, probably overkill. For other things, it could be very useful to have this extra layer of abstraction.
22:31:00
aeth
I see no issue with essentially lying about calling an accessor if the API is identical and the macro can handle things more efficiently. setf sort of does this. The foo in the setter (setf (foo 42) 3) has the same API as the getter (foo 42) but doesn't have to. So setf macro is already doing this sort of lie, in the standard language.
22:35:21
aeth
Well, what I mean is: setf is a macro, and (setf (foo 42) 3) doesn't evaluate "(foo 42)" and #'(setf foo) doesn't even have to have the same API as #'foo
23:47:22
fiddlerwoaroof
Recently, I've been experimenting with logical pathnames, and I find that they are a really nice way of dealing with paths
23:47:44
fiddlerwoaroof
For one thing, they allow for a fairly nice abstraction over the os/implementation-specific details of pathnames
23:49:00
fiddlerwoaroof
You just use + document a particular prefix for the files you need, and then the user sets up the translations to point the logical pathnames wherever they please
23:49:59
fiddlerwoaroof
And, they can specify translations very granularly: e.g. "MYAPP:config;**;*.*" can map one place and "MYAPP:data;**;*.*" can go somewhere else
23:51:48
fiddlerwoaroof
And, sbcl's implementation-specific part is pretty cool: you add a mapping for "SYS:SITE;**;*.*.*" to your .sbclrc and then it looks for files named <HOST>.translations in that directory to auto-load other hosts
0:05:07
didi
How do I configure the printer so (let ((x (cons nil nil))) (setf (car x) x)) prints, without looping forever?
0:13:07
jasom
(let ((*print-circle* t)) (prog1 nil (print (let ((x (cons nil nil))) (setf (car x) x))))) ;; <-- works for me
0:14:06
jasom
The REPL will try to print the results of PRINT, after *print-circle* is no longer bound to t, which is why the prog1 nil is there
0:14:47
jasom
didi: indeed because the print happens outside of the dynamic scope of your print-circle binding
0:22:37
jasom
dynamic bindings are useful for some things, but it also quickly becomes obvious why lexical bindings are the default
0:24:11
jasom
I find myself doing things like (defun foo (arg1 &key (option1 *option1*)) ...) so that I can be explicit when I need it, but not have to have the same 2 arguments passed to every single function everywhere for the common case.
0:35:24
didi
Heh, I've never used #'prog1 to stop the REPL from printing something. Before setting *print-length*, I used to add a final t or nil to form.
0:41:01
jasom
fiddlerwoaroof: https://github.com/jasom/sqlitestore/blob/master/build.lisp <-- here's my current build script, it works on everything that supports images. A small change can let it work on ECL type lisps as well, but I haven't done that yet.