libera/#commonlisp - IRC Chatlog
Search
11:46:38
rotateq
jackdaniel: of course I didn't include myself ^^ but yes, there is always more to learn, even for a master/expert
11:50:48
sabra
researchers I support sometimes get gigs of data in json form from who knows where. No web stuff here
11:57:03
rotateq
but when i see XML data format it seems to me it's a very exhausting one and that so much work is unnecessarily doubled and tripled by bringing it to a computable layout
12:41:09
yitzi
sabra: Thanks for your review of shasht. I'll look into the rough edges that you did find. I appreciate the your detailed reviews as always!
12:42:48
sabra_
Yitzi: thanks. Let me know if there is anything I can do or should correct or update
12:51:34
yitzi
sabra_: Aside from the some of the issues that you mentioned that I obviously need to look at I did notice that you said that "[123.456e78]" fails...
12:52:57
yitzi
shasht reading of floating point is affected by `*read-default-float-format*` so setting that to 'double-float or doing `(shasht:read-json* :stream "[123.456e78]" :float-format 'double-float)` should work.
12:53:59
yitzi
There could be a better way to handle that issue. I am open to suggestions/criticism.
13:02:22
yitzi
Awesome. I don't think it is an ideal solution, but it does follow the core CL behavior so at least it is not unexpected.
13:12:10
yitzi
sabra_: Can you give me the test case that caused shasht to hang on nil? I am probably just being dense, but I am not seeing it.
14:08:32
phoe
if they are defined in the same ASD file, how does Quicklisp work in that situation though?
14:10:08
Xach
Quicklisp tries to build every system it can find. If it builds, it is indexed in systems.txt and can be found via QL's system search function. If it doesn't, it isn't.
15:12:25
beach
fe[nl]ix: scymtym maintains Clouseau, the inspector. And we are both working on Second Climacs as an editor. I have a paper about debugging and McCLIM has a backtrace inspector "debugger".
15:13:49
beach
And scymtym has done work on incremental analysis of Common Lisp code. He occasionally shows a demo here.
15:15:10
beach
The main thing holding Second Climacs back is that I can't make up my mind about the data structure for computing indentation.
15:22:57
fe[nl]ix
and the list of features I'd need in order to switch to it as my main editor is pretty large
15:23:46
fe[nl]ix
last time I tried to do anything with it I have up after 5 minutes because it was full of bugs
15:27:09
beach
It is being actively maintained and improved by jackdaniel and many others. I am sure they would appreciate "issues" that you find.
15:27:53
beach
It is quite usable as it is, but there are some very nice improvements being worked on.
15:28:36
foxfromabyss
Let's say I have a class `(defclass point () (x y))` and a list `(list p1 p2 p3 p4)`
15:28:36
foxfromabyss
And I would like to splice(?) the values of the class instances into the list, so that it looks like `(list x1 y1 x2 y3 x3 y3 x4 y4)`
15:28:37
foxfromabyss
I initially tried to do that with `mapcar` but that obviously doesn't work, since I would need to return multiple values for that which is not supported by `mapcar` afaik
15:30:27
phoe
it's not the lisp way because it doesn't have many parens and doesn't feel "lispy" the same way the rest of the language does
15:30:54
phoe
it's very the lisp way because CL allows you to design sublanguages meant for specific things, like iteration, formatting text, regex matching, pattern matching et al
15:31:11
phoe
the moment you reconcile these two approaches you will attain one of the first steps for lisp enlightenment™
15:32:44
phoe
if you need functional programming, do it; if you need OOP, do it; if you need declarative programming, do it; if you need imperative control like GOTO, do it; if you need to mix all four, do it; if you need to design another four paradigms, just do it as well
15:33:28
jackdaniel
except that when you join the irc channel everyone will shun you down if you don't go full-clos road (or be caustious to not speak about it:)
15:34:37
jackdaniel
re mcclim, I'm not sure whether these are small things, many important parts are rewritten and there may be regressions
15:35:00
scymtym
beach: i couldn't read the who discussion and i would like to make a new demo (in particular with some semantic highlighting), but for now https://techfak.de/~jmoringe/second-climacs-1.ogv and https://techfak.de/~jmoringe/drei-experiment-2.ogv may give an impression
15:35:30
rotateq
foxfromabyss: even some older professors at universities still think that or can't distinguish from generic LISP
15:35:52
random-nick
foxfromabyss: CL is a general purpose language with the speciality of being general purpose
15:36:31
random-nick
pretty much any paradigm can be implemented in CL or has already been implemented in CL
15:43:49
foxfromabyss
even more unrelated: i am using the Sketch library for some visualizations. Is it possible to render the image and save it to memory, instead of displaying it?
15:44:09
foxfromabyss
sorry if I am asking too many dumb questions, googling was not too much of a success tbh
15:51:00
phoe
looks like it should be possible to get out the contents of the foreign SDL2-WINDOW object somehow, but I have no idea how
15:51:13
phoe
I'd open an issue on GitHub and ask for adding that to the manual - it does sound like a good use case
16:28:43
hobo
That was the set from the first real attempt. I've since been playing with colorizing it, generating segments of the whole image in separate threads, and have started writing some scaffolding for image analysis.
17:04:04
mgl
Apart from the slightly related declaration DECLARATION, is there any support for user defined declarations in any implementation?
17:05:12
White_Flame
it's mostly part of the compiler infrastructure, so "support" is still going to be in the guts of things
17:08:41
mgl
Nothing concrete, just wondering whether some lisps provide user defined declarations that a macro can access through its environment object.
17:09:42
White_Flame
I haven't noticed that explicitly documented, but just adding to to the environment doesn't sound like it should be too difficult.
17:10:24
EdLangley[m]
I think all the in scope declarations are accessible in sbcl through internal APIs
17:11:48
EdLangley[m]
I also submitted an issue on Trucler about providing a portable interface to this functionality
17:29:58
mgl
Oh, wow. Looking at trivial-cltl2 it seems to cover most lisps with the notable exception of clisp.
17:32:04
phoe
hard to write a compatibility layer over something that has no implementation support and cannot have a meaningful fallback implementation
17:37:47
mgl
I've just added linking to the hyperspec to mgl-pax (https://melisgl.github.io/mgl-pax-world/mgl-pax-manual.html#x-28MGL-PAX-3A-2ADOCUMENT-LINK-TO-HYPERSPEC-2A-20VARIABLE-29) for most things. But to link to declarations, pax would need a declaration locative (roughly equivalent to namespec id). If there is actually a way for users to define
17:38:56
phoe
you want to get a list of all declarations? if yes, (trivial-cltl2:declaration-information 'declaration) will give you the custom-defined ones
17:40:08
mgl
mgl-pax terminology, sorry. Locatives specify what role of a symbol to consider. E.g. the same symbol might denote a function and compiler macro.
17:40:57
phoe
in the worst case, try calling (ignore-errors (trivial-cltl2:declaration-information symbol)) then and see what you get
17:41:52
phoe
or ask for a list of all custom declarations first via (d-i 'declaration) and check if the symbol in question is on the list first
17:57:38
mgl
For the record, while trivial-cltl2 has reader conditionals for major implementations, so far no lisp other than SBCL implements both define-declaration and declaration-information.
19:05:37
contrapunctus
I was reading demo.lisp in the Clobber repository to figure out how to use it, and I'm not sure what `clobber:define-save-info` does (other than "it defines a save-info method", from the macro definition), or why (and how) client code is supposed to use it... https://github.com/robert-strandh/Clobber/blob/master/demo.lisp#L19
19:15:10
Josh_2
Not much has changed with the bot, I upgraded it to the second version of my matrix-api library a few days ago which has resulted in 100% uptime since. Other than that I have not done anything with it for months
19:16:42
Josh_2
I have written a library that wraps all of the matrix api, the admin api and the spaces api
19:22:17
Josh_2
contrapunctus: Currently I am designing a new MOP for use in my new project, the MOP is really awesome! Its great how you can encapsulate so much behaviour behind a simple class like interface
19:27:14
rotateq
and hmm, first 2 years ago i found some cl21 ideas not bad, now i see that it violates things and you can't really rely anymore
19:31:42
rotateq
as long as it's running in 30 years still the same way. or more "i was there gandalf, 3000 years ago ..."
19:35:12
EdLangley[m]
It’s just the standard advice, right? Don’t define a method for a generic function unless you control either one of the classes in the specializers or you defined the generic function.
19:35:32
Josh_2
gabc: you can define methods at runtime but I do not know if this creates the generic for you
19:35:55
Bike
it's not. it's common for libraries/etc to define generic functions with the expectation that they'll be extended.
19:35:57
Josh_2
EdLangley[m]: but this is exactly how you extend the functionality of someones library
19:35:58
rotateq
gabc: no methods are instances of generic functions (or do i miss some terminology?)
19:36:20
moon-child
suppose module X defines generic function F and module Y defines class O. I want to pass instances of O to module X. Specialising F for O seems like the obvious thing to do
19:36:24
Bike
for a standard example, it's probably not an issue to define print-object or make-load-form for someone else's class.
19:36:31
gabc
rotateq: that's my assumption, and if you don't have the generic function explicit it's made implicitely
19:37:12
Bike
and if you use defmethod without a previous defgeneric the generic function is indeed made implicitly
19:37:13
rotateq
yes gabc, when calling first time DEFMETHOD and the protocol checks for it. but this way you can't have another method-combination (direectly)
19:39:03
random-nick
hmm, am I reading the spec wrong or does MOP not allow for you to define a new kind of specialization and use it in a method on a standard-generic-function?
19:39:29
mfiano
With the MOP, what is the way to get all of the effective slot _names_ of a finalized class?
19:40:10
Bike
random-nick: right. that part of mop is pretty weak, yeah. there was an extension proposal for it but i don't think it was implemented
19:40:43
EdLangley[m]
(Maybe partially, I forget the details here, but I’ve seen relevant commit messages in sbcl)
19:45:38
rotateq
oh nice, with scymtym as one author. he seems not being soo far from me in distance ^^
19:57:52
_death
moon-child: the problem is when someone else also defines an F method specialized on O.. then you have two possibly incompatible definitions.. so one solution is to create your own class MY-O that is a subclass of O and specialize on that and make sure to pass instances of that to F
20:17:38
EdLangley[m]
There is a valid use-case here when you want to bridge two unrelated libraries but this is still dangerous for the reasons _death mentions
20:18:30
EdLangley[m]
Another option would be to create an adapter system that’s intended to be the bridge
20:19:18
gabc
At least the definition of methods are package-local, right? So if I do them in my package they aren't global, right?
20:19:48
EdLangley[m]
Or use the client technique beach uses where the generic functions have an argument specifically intended to be used by the user to switch between sets of implementations
20:44:30
nij-
A modern webpage is similar to a interactive program hosted in the browser. If it were CL (but not JS) that dominated the web, it'd be possible to launch a slynk server from-within the webpage, and hack it through emacs. CL didn't dominate the web, but I suspect something like this is possible. Is there some script I can run from-within a webpage that effectly enables me to hack the page with CL, sly, and emacs?
20:47:03
Josh_2
If I have a list like '(a b c d) how can I compute every possible combination of those elements?
20:49:40
edgar-rft
in case of doubt there's a "Common Lisp" code example section here -> https://rosettacode.org/wiki/Permutations
20:54:52
Alfr
Josh_2, to get all (that's 2^n) subsets, you can consider the numbers 0 to 2^n-1, every number n corresponds to a selection for elements, e.g. bit i set, choose element i to be part of the n-th set.
20:55:54
nij-
EdLangley[m]: There's js+swank.. and there's parenscirpt. So I guess something like this should work.
20:57:08
mfiano
Josh_2: something like: (let ((list '(a b c d)) (result nil)) (dotimes (i (length list)) (alexandria:map-combinations (lambda (x) (when x (push x result))) list :length i)) result)
20:57:18
_death
the way clog works is by sending arbitrary js via a websocket.. you can generate that js using parenscript
20:57:49
nij-
Josh_2 just to compare the length of code.. (defun comb (list) (let ((l (length list))) (cond ((= l 0) nil) ((= l 1) (list list nil)) (t (append (mapcar (lambda (x) (cons (car list) x)) (comb (cdr list))) (comb (cdr list)))))))
20:59:37
mfiano
Josh_2: Also might want to nreverse the retval, if you want them in increasing order
21:02:18
nij-
EdLangley[m]: I understand that Parentscript can turn on a server that runs its own webpage. Do you know if it can hack a page that's already running?
21:04:18
mfiano
Fixed code: (let ((list '(a b c d)) (result nil)) (dotimes (i (length list)) (alexandria:map-combinations (lambda (x) (push x result)) list :length (1+ i))) (nreverse result))
22:12:05
masinter
(defun comb (x) (if x (let ((y (comb (cdr x)))) (mapc #'(lambda '(z) (push (cons (car x) z) y)) y)
23:04:22
rotateq
lel a friend of mine to who i talked more than one time about CL said "you need some object-oriented language like Java to get a job"