freenode/#lisp - IRC Chatlog
Search
17:06:08
fiddlerwoaroof
jfrancis: you could probably also use these special variables to make decoding unambiguous: https://common-lisp.net/project/cl-json/cl-json.html#DECODER-CUSTOMIZATION
17:13:11
jmercouris
I'm hesitant to iterate over the hashtable keys and do remhash because I have a feeling it won't like that
17:15:16
jackdaniel
(let ((to-remove nil)) (maphash #'(lambda (k v) (when (pred v) (push v to-remove))) ht) (mapc #'remhash* to-remove))
17:17:00
_death
jmercouris: the standard guarantees that you should be able to do that for the entry currently being passed
17:18:53
sjl_
yeah, (maphash (lambda (k v) (when (funcall predicate k v) (remhash foo k)) foo) should be portable
17:23:16
_death
yep.. that would save you from errors like pushing value instead of key, or rotating the arguments to remhash ;)
17:24:39
sjl_
ugh, yet another instance of *hash functions having the opposite arg order to what I expect
17:30:08
_death
same argument for MAPCAR taking lists after the function.. while it could make sense for (single) sequence functions to take the sequence first, I guess
17:32:05
sjl_
I'd still probably lean toward taking the predicate first, because (curry #'mapcar #'pred) to make map-pred seems more useful than (curry #'mapcar somelist), which would be... map-over-some-particular-list
17:46:28
ogamita
The nth element of the list (nth n list); Let's reference the array a with the indices i j k (aref a i j k).
17:49:14
ogamita
(defun at-indices-of-array (&rest arguments) (apply (function aref) (first (last arguments)) (butlast arguments))) (at-indices-of-array 1 0 #2A((a b) (c d))) #| --> c |#
19:18:31
jcowan
It shouldn't be that hard to hack an interface to <good JSON package> that mimics <bad JSON package>.
19:48:25
jackdaniel
Greenspun's eleventh rule: there is never enough JSON packages and lisp implementations. :-)
19:51:48
dim
what about channeling this fabulous energy to McCLIM and a pure-CL dev environment (listener, editor, debugger, etc etc) that would compare favorably to DrRacket and its tutorial with images?
19:52:16
dim
so that next time a newcomer to CL asks questions about getting started, they just use thing new thing instead of having to learn SLIME or some derivatives
19:52:56
malice
jackdaniel: Hi! You're maintainer of both McClim and ECL projects, right? I suggest that you take a look at Google Summer of Code: https://opensource.googleblog.com/2018/11/google-summer-of-code-15-years-strong.html
19:52:57
sjl_
I've successfully resisted the temptation to write my own test framework and/or JSON library so far. I'm fighting the good fight.
19:53:16
dim
jackdaniel: I know you do, and I'd like to help, I don't have enough time to reproduce and fix pgloader issues already, unfortunately, though
19:53:21
malice
The registration for organizations starts in january, so there's still some time to familiarize yourself with the project if you were interested.
19:53:50
jasom
Google SoC might get you future contributors, but it's rare that useful contributions come out of it.
19:54:22
malice
Well, if you manage to prepare that, I believe it might be beneficial (or maybe someone can do it for you?)
19:55:21
malice
jasom: I think it would be beneficial because (1) people would browse GSoC to find projects. Some of those people could get familiar with Lisp and its projects by seeing those there
19:56:11
malice
I agree. This is best thought of as a way of easing a person into the project and/or its ecosystem
19:56:53
jasom
speaking of which, what's a current need for McClim that isn't getting some TLC (other than non-X11 backends; I don't use any non x-11 guis regularly so wouldn't be uesful for me)
19:59:35
jackdaniel
jasom: this ticket would be a big step in good direction: https://github.com/McCLIM/McCLIM/issues/35
20:00:02
jackdaniel
this would make life easier when using the Listener: https://github.com/McCLIM/McCLIM/issues/307
20:03:27
jasom
jackdaniel: what extensions can the X11 backend assume the server will have (or more generally which X servers do you wish to support)?
20:06:25
jackdaniel
right now it supports very old x11, but we are slowly moving towards xrender model
20:17:15
jcowan
Unlike CLICC CL1 and stand-alone CL0 it will be based on ANS CL and will not restrict the language of macros, since I assume the compiler will be written in full CL.
20:41:48
jcowan
I think so, but I'm open to arguments against. It seems only trivially different from symbol-function at first glance
21:00:25
dim
kinlo: the new file https://github.com/dimitri/pgloader/blob/master/bundle/save.lisp should help you build pgloader from the bundle distribution, you just need to prepare a version.sexp file containing "3.5.2" with the quotes and then either sbcl --no-userinit --load ./save.lisp or ccl -l save.lisp
22:08:22
pjb
I'm trying to use asdf:make-build, but I get errors "An error occurred during initialization: Component "<my-system>" not found.", even if I quickload successfully "<my-system>" before asdf:make-build. What would be the problem?
22:28:29
dim
pjb: could it be that you're using QL facilities to find your projects that are unknown to ASDF itself? ql:*local-project-directories* comes to mind
22:30:32
pjb
I've set asdf:*central-registry* with the paths to the directories where all my asd are.
22:31:54
dim
(asdf:initialize-source-registry) might be necessary after setting the central registry
22:37:37
pjb
Nope, same result with all the directories containing asd in the project and in ~/quicklisp in asdf:*central-registry*, and with (asdf:initialize-source-registry)…
22:41:13
pjb
Ok, it's an asdf problem with this setup. (asdf:oos 'asdf:load-op "<my-system>") fails too. Not specific to asdf:make-build. I'll debug that tomorrow.
0:04:22
White_Flame
thoughts on another stupid hack of mine: To READ multiple terms from a single string, encase the string with paren characters, and READ once into a list.
0:05:04
White_Flame
I think the only difference is that if there's an unclosed paren in the string, the location of the error would be different?
0:05:32
noobly
in the little schemere, there is a function as such: (define even? (lambda (n) (= (* (/ n 2) 2) n))). SO, because (* (/ n 2) 2) alwasy equals n, I've come to the conclusion that this either errata, a quirk of a specific scheme dialect. I'm using guile.. any help here?
0:06:25
White_Flame
this channel is about CL, not scheme. try #scheme. However, / might be an integer division or a divmod or something
0:12:14
noobly
and I'll try finding the specs, not quite sure how though (in emacs using guile, fwiw)
0:14:34
jmercouris
so if I make a program with asdf:make, right, it has an entry point, how can I keep that program running without doing a while true loop?
0:16:25
jmercouris
Bike: so the thing is, all events come from s-xml-rpc, invoked by xml-rpc from the client program
0:18:00
jmercouris
what if I used BT threads to run a loop that is sleeping 99% of the time to avoid the program closing
0:18:04
sjl
Is there some built-in function that takes a list and an element and appends that element to the list? I realize this will be slow.
0:18:30
pillton
jmercouris: You should wait for the thread which controls the event loop to terminate.
0:19:30
jmercouris
pillton: wait for the thread which controls the event loop...? how could I possibly know what thread s-xml-rpc is running on, or are you suggesting I make an event loop thread?
0:25:47
pillton
jmercouris: Have the main thread wait on a mutex which a s-xml-rpc handler sets upon termination.
0:26:45
jmercouris
are mutexs native to common lisp? or will I have to use a library or some bool or something?
0:51:39
no-defun-allowed
if you can chase the last cons in the list you can append to the end very quickly
0:52:03
no-defun-allowed
eg the results of (macroexpand '(loop for n from 1 to 10 collect n)) might involve such cons chasing
0:52:19
sjl
Sure. I could also use the queue implementation I wrote a while ago... I'm looking for a portable built-in or one-liner equivalent
0:55:36
sjl
starting with a vector and v-p-e would work, but v-p-e's args are in the wrong order and CL doesn't have flip
0:56:49
sjl
well, if I had flip and could live with reversed output it could be (flip #'cons) I guess
1:21:36
sjl
exactly. if append doesn't solve the problem, nconc will only not solve the problem faster and more dangerously
3:53:11
beach
What is your intended use for CL-R? It is hard to give advice unless the purpose is clear. Like, why would you want to give up reflection?
3:56:48
beach
jcowan: Another way of asking the same question, I guess: What problem with full Common Lisp is CL-R meant to solve?
3:57:56
pfdietz
Perhaps it's intended for more minimal, static compiled apps? Sort of a scheme-like CL?
3:59:13
beach
I am not saying there is anything wrong with wanting such a thing. I am just curious about the goal.
4:14:25
jcowan
I don't have in mind to actually write such a compiler, just lay down the work for what such a compiler might reasonably accept
4:15:25
jcowan
The hope would be to be able to get good performance from a more naive compiler than SBCL or SICL.
4:17:05
beach
And for the size part, are you thinking of a small number of applications for an operating system like UNIX?
4:17:47
beach
I am asking this, because if you give up either one, there are simpler ways of obtaining what you want.
4:18:03
jcowan
"The Lisp community must listen to the marketplace, which has shouted small, small, small and efficient, efficient, efficient for two decades [as of 1992]" (Henry Baker)
4:18:38
jcowan
His proposals are far more radical than anything I have in mind, and indeed in some ways more radical than Scheme or Racket
4:19:26
beach
jcowan: I am asking because, if think you might have a large number of applications, you can put most of the code in a shared library, so each application would be small.
4:19:32
jcowan
I was actually thinking about embedded processors and other highly constrained environments
4:20:26
jcowan
By 2018 standards, essentially all 1992 computers, to say nothing of 1972, were highly constrained environments.
4:21:25
jcowan
With whole-program compilation, tree shaking is trivial: omit anything not in the call graph
4:26:14
jcowan
Not when someone's library has the complete works of Shakespeare embedded in it. (Sorry, can't find the reference offhand.)
4:28:13
beach
For example, in order for CLOS to be efficient, you need the compiler at run time. So you probably need to give up CLOS as well in order to get both small size and good performance.
4:28:50
beach
And then the language is so far removed form Common Lisp that the CL part of the name is probably no longer justified.
4:29:29
jcowan
Why do you need the compiler at run time if you only have a fixed number of immutable classes, all known at compile time?
4:36:01
aeth
jcowan: For instance, I've come to the exact opposite conclusion about "Using (declare (type ...)) is the least-desirable mechanism to use"
4:36:48
aeth
jcowan: I've actually put a substantial amount of work into making macros that handle both declare and check-type at the same time to silence the critics because declare is simply too useful not to use in implementations that handle it reasonably.
4:37:01
jcowan
Am I right to think that (eval-when (:compile-toplevel) ...) has the effect of making any defuns it wraps available at compile time only? That would be the Right Thing for procedures at (Scheme) phase 1; that is, used only in the implementation of macros.
4:38:01
aeth
Macro-implementation functions tend to be available all of the time, possibly for easier debugging/testing, and they often are in a separate file to avoid a giant 300-line eval-when
4:46:26
pillton
jcowan: I don't understand why you would do it this way. Why don't you implement a CL compiler which isn't restricted to fast LOADing?