freenode/#lisp - IRC Chatlog
Search
11:03:46
drl
How can this be fixed: ; Evaluation aborted on #<SB-KERNEL:SIMPLE-PACKAGE-ERROR "~A is a nickname for the package ~A" {1006988463}>.
13:04:32
pve
Hi, are implementations required to store the source code of function definitions (as a string or cons)? I can see that on SBCL, (describe #'foo) shows me the source form, but (describe #'+) does not. Does it depend on the optimization settings used when compiling the code?
14:07:09
TwoNotes
In my logged error messages from a handler, I see a routine reference like this: "(semantics fun8)" I do have a function named "semantics" but what is the "fun8"??
14:12:10
TwoNotes
log4cl includes the name of the function it was called from. Sometimes it is putting in this extra name like "fun8"
15:44:14
drmeister
Displaced arrays in Common Lisp don't have an accessor like (setf (array-displacement displaced-array) ...)
15:45:29
drmeister
How much trouble would I be getting myself into if I added two, one to set the array that I want to displace-to and the other for the displayed-index-offset.
15:47:27
Bike
having a more restricted setf might be kind of interesting, since adjust-array can adjust a whole lot of things, but it's not in the language
15:47:55
drmeister
I'm writing simulators - and I find it's really convenient to put all the values that represent the state of the system at any point in one big vector. I'd like to displace a bunch of other vectors into that state vector to interpret the single state vector into other, more meaningful vectors.
15:54:31
drmeister
I've got these two robotic synthesizers that each have like 35 bottles of solutions that it takes material out of and 6 reactors that it assembles molecules onto. I want to simulate them both for a week and then set up another simulation. I'm going to create a state vector with (* 2 (+ 35 6)) entries for the whole system and then simulate two machines that have displaced vectors for their bottles and reactors into that
15:55:03
drmeister
Then I can copy the state vector, run it for a couple of days, make a decision, throw it away and go back to the previous state. Things like that.
18:07:58
drl
When I use quicklisp to try to load "alexandria" I get the following error message: Evaluation aborted on #<SB-KERNEL:SIMPLE-PACKAGE-ERROR "~A is a nickname for the package ~A" {1003D60BF3}>.
18:24:49
|3b|
any suggestions for handling warnings differently for some packages in QL or ASDF? in particular i want to be strict about warnings for my code when testing, but permit them for dependencies i don't control
18:25:35
|3b|
so far cleanest idea i have is to ask ASDF for a list of dependencies of my projects, and load those separately ignoring warnings
18:26:29
|3b|
other ideas are to add a mixin to the systems before loading them, so i can put around methods on asdf ops to handle things specifically
18:27:03
|3b|
(or just put methods on them directly without introducing my own classes, but that's probably too fragile, even assuming they don't have around methods already)
18:29:40
|3b|
asking for a list of dependencies has the problem of requiring the systems to already exist, which isn't always the case if i want to be strict about something that would normally be installed by ql (and even if it does exist, i still need to sort them, etc)
18:32:53
|3b|
drl: also, what does (ql:where-is-system 'alexandria) return, and does it load if you run sbcl with --no-sysinit --no-userinit
18:34:35
|3b|
true, i guess you need to add --load '(load "/quicklisp/setup.lisp")' after the --no-*
18:36:52
|3b|
drl: the error should show what package name and/or nickname is conflicting, might paste entire output (to gist or a paste site, not here) so we can look for clues
18:38:20
drl
I uninstalled alexandria, then tried to load it. quicklisp downloaded the file and uncompressed it, but then again gave the error message.
18:45:48
drl
pve, I exited emac, restarted emacs, started slime, tried to load alexandria before loading anything else. I still get the same error message.
18:49:04
|3b|
drl: if you type alexandria into the repl in slime and hit M-. on it, does it go to a file? if so, is it in that path?
18:59:06
|3b|
but either way, just need to figure out which config file is doing odd things if it loads on shell in some form
19:00:33
|3b|
if it loads without --no-sysinit --no-userinit, it should be something in slime/swank or emacs config, otherwise try just one of those to see if the other init file is the problem
19:35:39
|3b|
drl: might also try deleting fasl cache in ~/.cache/common-lisp/ (assuming unix-like os) and ~/.slime/fasl/
19:38:08
easye
I think it's from Bill Clementson's Blog <https://web.archive.org/web/20060707174628/http://bc.tech.coop/blog/041106.html>
19:46:58
scymtym
Xach: do you know whether anything has happened here https://github.com/quicklisp/quicklisp-projects/issues/1889 ? in one of my builds it seems as if trivia is quickloaded to satisfy a :depends-on "optima" but then the OPTIMA package does not exist
19:49:47
Xach
http://report.quicklisp.org/2020-09-25/failure-report.html shows some optima-related breakage
19:51:35
Xach
(I am pleased with my new report format, which pulls critical ERROR/WARNING info out into the main index page)
19:52:55
scymtym
yeah, fare-quasiquote seems to have been "fixed": https://gitlab.common-lisp.net/frideau/fare-quasiquote/-/commit/28c556771c5551339bbd86306cc01f76caa0700f
19:53:12
rustisafungus
so, i am language-surfing, for fun. i get the impression that the lisp community isn't so fond of types (?) is there some good reading on this philosophy i can look at?
19:54:47
rustisafungus
so you guys do like your variables to be strongly typed? i think there is some quote from pg saying that values have types, not variables
19:55:39
Xach
there's some joke in there to be made along the lines of "if trees could scream, would we be so cavalier about cutting them down? maybe if they screamed all the time, for no reason"
19:56:12
|3b|
though telling the compiler we will only put values of a specific type in a particular variable can allow some nice optimizations, so we do that sometimes
19:56:57
rustisafungus
"values have types" sounds equivalent to "i dont like declaring a variety of different variable names when i could just have one"
19:58:27
|3b|
if you like, you can just say we default to all variables being strongly typed as T (which is the type in CL that is a supertype of all other types), so can hold any values
19:58:45
aeth
The language surrounding types is really confusing. But "strong vs weak" afaik is normally about coercively typed languages being "weak", while in CL, there really are only rules for autoconversion within the numeric tower (e.g. (+ integer float)) afaik.
19:59:17
aeth
Where the canonical problem with weak types is 42 + "4" which could be "424" or 46 (or, really, anything else)
19:59:46
aeth
rustisafungus: if you want to be careful with your floats, you end every literal with "f0" or "d0" depending on which type you want. It's not that bad.
20:00:12
aeth
And, yeah, you can get wrapping integers, but only if you wrap them in an operation that wraps them, such as MOD
20:00:19
rustisafungus
aeth: idiomaticity is important in programming languages imo, i want all my libraries etc to treat floats as being radioactive
20:01:21
aeth
rustisafungus: every library that's worthwhile will use the "f0" suffix for all single-floats and the "d0" suffix for all double-floats with no exceptions. Once a float, things stay as floats, although they turn into the one with the highest precision if you mix them iirc.
20:03:21
aeth
rustisafungus: The rules are very consistent. An integer is a fixnum or a bignum. It becomes a bignum automatically if it leaves its range, but you can keep it in range to keep it efficient (with e.g. MOD, which might be optimized to the appropriate asm + instruction if the right size)
20:04:23
rustisafungus
yes but i could write a program where everything is some kind of String, and that would be all statically typed
20:04:24
aeth
rustisafungus: Division of an integer with an integer produces a rational, which is conceptually like a pair of bignums. Certain operations like SQRT that produce irrationals can turn something into a float (the one part I don't like, tbh), but otherwise, floats are only obtained by mixing something with a float, in which case it uses the most precise float.
20:04:50
aeth
And any of these numerical types can become complex (e.g. you can have a complex with integers, or a complex with any float type)
20:05:02
rustisafungus
but really i should be defining more about my values to my compiler, so i say "strongly" to distinguish the fact that i want to reveal as much as is practical about my program operation to my compiler, because it is smarter than i am, often
20:06:19
aeth
rustisafungus: CL numerical programs are more... mathematical than most programming languages. An integer is a mathematical integer. If you want it to be an efficient machine integer, you better actually establish bounds algorithmically, or DECLARE it and hope it errors.
20:07:05
rustisafungus
aeth: yeah, but that means that my program is either total with bounds or not total and i have to pray
20:07:24
rustisafungus
i hadn't realized that duality until now,... i guess all variables need to be bounded in order to have totality
20:07:57
aeth
rustisafungus: Other programs tolerate incorrect behavior for efficiency, but CL perfers to either error or turn into a mathematical type that prevents it from being an error (e.g. sqrt can produce complex)
20:08:35
aeth
rustisafungus: You can however disable this for floating point and get the NaN/inf of other languages. You have to use float-features:with-float-traps-masked because the way to do it is not standard.
20:09:05
aeth
for better or for worse, most numerical programs (1) use floats and (2) disable the built-in safety of the language this way.
20:11:06
aeth
arguably, single-floats should never overflow because it would be more consistent with the language design if they just overflowed into double-floats just like fixnums overflow into bignums
20:13:14
aeth
In practice, though, if you care about your numerical type, you're going to statically type or check-type your code there... so your integer becoming a float because one float was passed in won't really be an issue.
20:14:44
user51
has anyone done any emulation in lisp? i'm specifically talking about intel 8080, i figured it would be a decent first project.
20:16:55
aeth
user51: to be efficient on this sort of thing... (1) use SBCL, (2) use structs whose slots have a :type or use arrays with an :element-type that can be optimized (mostly just various simple numerical types; test with upgraded-array-element-type first) or some combination of these