libera/#commonlisp - IRC Chatlog
Search
8:17:07
beach
coat: The standard is very clear with its definition of SIMPLE for arrays, but it leaves a lot of decisions to the implementation when it comes to non-SIMPLE.
8:18:13
Colleen
Clhs: type simple-array http://www.lispworks.com/documentation/HyperSpec/Body/t_smp_ar.htm
8:19:39
pjb
beach: I don't see how the standard can forbid: (make-array 8 :element-type 'character :adjustable t :fill-pointer 0)
8:20:46
beach
The standard says: "The type of an array that is not displaced to another array, has no fill pointer, and is not expressly adjustable is a subtype of type simple-array."
8:21:55
pjb
Oh, ok. But then it doesn't say that simple-array have to be simple, ie. have to not be displaced, have no fill pointer or cannot be expressly adjustable.
8:23:38
coat
can this code be made simpler? https://plaster.tymoon.eu/view/2514 - I have repeated (char s n) calls. is there a way to put all the indices in the list, iterate over those indicies and collect (char s i) instead?
8:25:22
pjb
(coerce "1000-2000-30" 'list) #| --> (#\1 #\0 #\0 #\0 #\- #\2 #\0 #\0 #\0 #\- #\3 #\0) |#
8:26:57
coat
pjb: thanks! that would be useful if I wanted all characters. but I want to choose which indices I want so the LOOP solution is more useful for my specific problem.
8:29:05
pjb
(let ((string "1000-2000-30")) (coerce (remove #\- string) 'list)) #| --> (#\1 #\0 #\0 #\0 #\2 #\0 #\0 #\0 #\3 #\0) |#
10:43:54
coat
is there a function that take can take all elements of list *b* and append it to list *a*. For example, (defparameter *a* (list 10 20 30)) (defparameter *b* (list 40 50)). I need (some-func *a* *b*) such that the result would be *a* = (10 20 30 40 50)?
10:48:13
shka
also, note that destructive modification of lists is perhaps not the best idea if said list (or part of it) has any chance of being shared
11:36:13
coat
beach: Is the surprise about (nconc a b) regarding the fact that some other variable may be referring to 'a' and might be expecting it to not change?
11:45:04
beach
coat: Also, a piece of general advice: Do not worry about performance unless your application needs to be faster than it is. And then, only consider parts of the application that are bottlenecks in terms of performance.
11:45:36
beach
coat: Worry about your algorithms and data structures in terms of asymptotic complexity as usual.
11:50:34
beach
coat: There is a very general rule in programming, and that is, use the most specific construct that will get the job done.
11:51:29
coat
why are there so many equal functions in CLHS? it is quite confusing while programming and need to check the CLHS again and again
11:51:51
coat
is there a shortcut to look up function documentation in SLIME? say I want to see what equal does in SLIME itself without opening the browser
11:56:00
susam
coat: There are two things I use. C-c C-d d to describe symbol. C-c C-d h to open CLHS in a web browser.
11:59:02
coat
beach: but I understand your point about asymptotic complexity. you mean terms of big oh notation, right?
11:59:07
beach
I mean, those are both language specific resources, and they probably wouldn't cover rules like the one I just cited.
12:01:27
beach
coat: Part of the reason Common Lisp has so many operators is historical. But then, most people complain that it doesn't have enough.
12:02:33
beach
coat: But here is another general rule of programming: The smaller the language, the more code you have to write yourself, and you often need to do it differently for each project, and certainly in a way incompatible with what other people do.
12:03:26
beach
coat: I would have to think about that and look around. I haven't had to do that for a very long time.
12:04:34
beach
coat: I had some very good teachers at the university, and then I studied a lot myself.
12:08:46
beach
https://en.wikipedia.org/wiki/Erik_Sandewall https://sv.wikipedia.org/wiki/Anders_Haraldsson (last one only in Swedish)
12:12:03
beach
coat: You can learn a lot from people like Robert C Martin (a.k.a. Uncle Bob). He comes across as a bit weird if you watch his "clean code" videos, but he actually knows what he is talking about.
15:34:42
shka
is when he mentioned that nobody will be serious about the programming until software bug will cause a major aviation accident
15:36:28
shka
yeah, it sounded ludicrous at first, but i actually think that this may be not be worst idea ever
15:38:28
beach
I agree, but it would be a terrible idea presently. What will happen will depend a lot on the "experts" that are chosen to draft legislation. I won't be surprised if (say) free software is outlawed, and VSCode becomes mandatory, and stuff like that.
15:47:47
jcowan
Obviously Boeing has very good (and very expensive) e&o insurance, some of it paid for by taxpayers. I read once that aviation didn't become profitable (as opposed to pervasive) iuntil the 1960s or so
15:49:27
beach
I am not worried about Boeing. I am worried about the future of software development.
15:54:33
shka
regardless, despair https://www.bloomberg.com/news/articles/2019-06-28/boeing-s-737-max-software-outsourced-to-9-an-hour-engineers
17:47:47
pjb
well, airbus at least uses a Coq-validated C compiler: https://github.com/AbsInt/CompCert
17:48:44
pjb
Perhaps one day we'll have a formal specification of CL, and a Coq validated CL compiler?