Alfr has quit [Killed (iridium.libera.chat (Nickname regained by services))]
Alfr has joined #commonlisp
olivial has quit [Read error: Connection reset by peer]
rkazak has quit [Ping timeout: 265 seconds]
olivial has joined #commonlisp
bitspook has joined #commonlisp
JuanDaugherty has quit [Quit: JuanDaugherty]
decweb has quit [Ping timeout: 252 seconds]
rkazak has joined #commonlisp
Pixel_Outlaw has quit [Quit: Leaving]
rkazak has quit [Ping timeout: 265 seconds]
yewscion has joined #commonlisp
yewscion_ has joined #commonlisp
troojg has joined #commonlisp
yewscion has quit [Ping timeout: 252 seconds]
rkazak has joined #commonlisp
rkazak has quit [Ping timeout: 252 seconds]
Pixel_Outlaw has joined #commonlisp
mishoo has joined #commonlisp
yewscion_ has quit [Read error: Connection reset by peer]
rkazak has joined #commonlisp
mountainman1312 has joined #commonlisp
<mountainman1312>
Howdy everyone. Got a weird thing going on, too noob to know if it's normal or not. I have a defconstant that's giving a "... is being redefined" error. This is happening when I first open a new REPL and it's the first thing I do after doing "in-package :xyz". Does SBCL keep some stuff around that I'm not aware of, even after killing the REPL and starting an entirely new one from scratch?
rendar has quit [Ping timeout: 248 seconds]
<beach>
No, it does not.
<beach>
mountainman1312: It may be that you define it in more than one place, or that you execute that definition more than once.
<beach>
mountainman1312: What is the constant you are defining?
<mountainman1312>
It happens when I first open sly in a fresh Emacs after a PC restart, that's what's got me all weirded out about it
<beach>
You must do something before the DEFCONSTANT so that the package is created. What is it that you do to make that happen?
<mountainman1312>
Just a simple (defpackage :xyz (:use #:common-lisp)) and (in-package :xyz)
dtman34 has quit [Ping timeout: 272 seconds]
<mountainman1312>
The very next thing is (defconstant +PUZZLE-INPUT-FILE+ "~/proj/Learn/aoc/src/2015.01._PUZZLE-INPUT.txt")
<beach>
That's very strange. The only thing I can think of is if you have something in your .sbclrc that defines that constant.
<beach>
Is the package really named "XYZ"?
<mountainman1312>
No, the package name is "2015-01-02-more-lispy-this-time"
<aeth>
Iirc, use alexandria:define-constant for sequences. Because you can define a test. Which for strings would be #'string=
<beach>
aeth: That's not the problem right now.
rkazak has quit [Ping timeout: 272 seconds]
<beach>
mountainman1312: Hold on, is the package named "2015-01-02-more-lispy-this-time" or "2015-01-02-MORE-LISPY-THIS-TIME"?
<beach>
I bet the latter.
amb007 has joined #commonlisp
<beach>
mountainman1312: OK, so what if you start your imagine and not do the DEFPACKAGE, and instead (FIND-PACKAGE <the-name-of-your-package>)? What happens then?
Pixel_Outlaw has quit [Quit: Leaving]
<mountainman1312>
Okay, I just killed every Emacs buffer with "sly" in the name... New sly...
<mountainman1312>
I get NIL
<beach>
That's normal, but doesn't give us any clue to the problem.
kpg has quit [Remote host closed the connection]
amb007 has quit [Ping timeout: 265 seconds]
<beach>
mountainman1312: Does the same thing happen no matter what name you give to your package?
<mountainman1312>
beach: Yes. I just attempted it in a new package: (defpackage "testing-weird-stuff" (:use #:common-lisp))... I still get the same error.
Posterdati has quit [Ping timeout: 260 seconds]
<beach>
That sounds like an SBCL problem then.
<mountainman1312>
Is it possible that killing all the sly-related buffers in Emacs isn't actually killing SBCL?
<beach>
I don't think that's possible. But even if it were, that doesn't explain the issue.
rainthree3 has joined #commonlisp
<beach>
If you define a totally new package with a totally new name, then you should be able to do a DEFCONSTANT in that package.
Posterdati has joined #commonlisp
<mountainman1312>
Also, I just checked and the constant is not defined in the base-level package "CL-USER>" prompt on the REPL either
<beach>
mountainman1312: What if you start SBCL from the command line and do the same thing?
<beach>
... i.e., no Sly.
<mountainman1312>
Works just fine
<mountainman1312>
So weird
dtman34 has joined #commonlisp
<beach>
Then Sly is messing things up somehow. I don't use Sly, so I can't help with that.
mishoo has quit [Ping timeout: 265 seconds]
<mountainman1312>
My uneducated guess is that sly is evaluating the buffer I'm in when I start sly?
<beach>
That can't be possible if FIND-PACKAGE returns NIL.
<mountainman1312>
But I've noticed that C-c doesn't work on the (in-package ...) bit so perhaps +PUZZLE-INPUT-FILE+ is actually being defined in the base package?
<beach>
What is "the base package"?
<mountainman1312>
Whatever it puts you in when you start the REPL... For me it says "CL-USER>"
<beach>
You can test that as follows: Before doing DEFCONSTANT, do an (APROPOS "puzzle-input-file").
<mountainman1312>
beach: that returned "; No values"... I also did (describe +PUZZLE-INPUT-FILE+) and it gave an error saying it's unbound.
<mountainman1312>
I did it again after defining the package and doing (in-package), still unbound
<bitspook>
mountainman1312: Maybe share the entire file here so someone can test if it is the code or your setup that's causing this?
<mountainman1312>
Is there a special way to share files or just dump it?
<Alfr>
mountainman1312, do not dump it here directly, please. Use a paste service.
<mountainman1312>
Jeez I know these things, sorry I'm in a frazzle over this haha
rkazak has joined #commonlisp
<mountainman1312>
Wow what happened to all the decent file hosting services? Got any recommendations, all the ones I can find want me to give them power of attourney
<mountainman1312>
Ah nvm, I found one
<Alfr>
mountainman1312, there's on in the topic.
<beach>
mountainman1312: Then, the only thing I can think of is that Sly somehow evaluates the DEFCONSTANT form twice.
<beach>
phoe: The problem is that the constant is reported to being redefined even the first time the DEFCONSTANT is evaluated, and only in Sly, not with SBCL at the command line.
<phoe>
huh
<phoe>
killing all buffers with "sly" in its name might not be enough, also kill the inferior-lisp buffer
<phoe>
or just M-x sly-restart-inferior-lisp
<beach>
phoe: Pleas read up. All that has been tried.
<mountainman1312>
phoe: trying M-x sly-restart-inferior-lisp now, just to be sure
<beach>
The image must be fresh if FIND-PACKAGE returns NIL.
<beach>
mountainman1312: So what if, instead of doing DEFCONSTANT, you do something like (eval (list 'defconstant '+PUZZLE-INPUT-FILE+ ".."))?
<bitspook>
I am able to replicate it. Just copied the file over, started sly, evaluated package-def and defconstant forms (L:8 and L:19), and get same error as mountainman1312 So it is not your setup.
<beach>
bitspook: That's good information.
<beach>
mountainman1312: I am working under the hypothesis that Sly somehow recognizes the DEFCONSTANT form and makes SBCL evaluate it twice.
<mountainman1312>
Ah the plot thickens :) let me try opening sly without this file open at all
<bitspook>
Problem does not occur if I interpret the defconstant form with `C-x C-e`. It occurs only on compile with `C-c C-c`
<bitspook>
I am using `sly-retart-inferior-lisp` to reset things.
<beach>
Oh, hold on.... I thought it was evaluated at the REPL and not by C-c C-c.
<beach>
That changes everything.
<mountainman1312>
beach: well, I've been trying it both ways because I knew there could be a difference. For me it happens even when entering everything directly into the sly REPL
<bitspook>
Package definition has nothign to do with it. Even in CL-USER behavior is same. Interpreting works, compilation don't. Is this documented behavior? I've never really used `defconstant' before.
<beach>
bitspook: It must be the case that the form is first compiled and then executed. Then the DEFCONSTANT will be evaluated twice.
<beach>
mountainman1312: Did you try the (EVAL...) test?
<beach>
bitspook: Or you.
<bitspook>
> For me it happens even when entering everything directly into the sly REPL
<bitspook>
mountainman1312: I can't replicate this in any combination. It fails only when I try to compile the form.
<mountainman1312>
I'm not sure about the (EVAL...) test, however I just tried opening sly without any .lisp files open, and now it works as expected, no errors.
<bitspook>
If I wrap `defconstant' form in `(eval-when (:compile-toplevel) ...)', it compiles just fine. But only once of course, trying to recompile gives same error.
<mountainman1312>
So should we just chalk this up to "C-c C-c is weird with defconstants"?
<beach>
mountainman1312: How can that be the case if you get the error when you evaluate the DEFCONSTANTS at the REPL?
<mountainman1312>
Oh yeah...
<beach>
But bitspook can't replicate that problem.
<bitspook>
mountainman1312: Can you try executing `sly-restart-inferior-lisp' and copy-paste just the `defconstant` form to REPL and see if it still fails?
rkazak has quit [Ping timeout: 252 seconds]
<mountainman1312>
one moment...
<mountainman1312>
No, does not fail
<bitspook>
I think you'll observe same behavior if you run `sly-restart-inferior-lisp' again and try `C-x C-e' on the form.
<mountainman1312>
Yes, it works perfectly fine that way
<bitspook>
So conclusion so far: in an empty lisp environment, this problem occurs only when we try to compile the form with `C-c C-c' of Sly. And does not occur if we wrap the form in `(eval-when (:compile-toplevel) ...)'.
<mountainman1312>
C-c C-c is sly-compile-defun for me, and C-x C-e is sly-eval-last-expression
<mountainman1312>
Thanks for the help everyone :)
<bitspook>
Same for me. I think these are the default.
<mountainman1312>
I'm not entirely sure if this means there's an issue or if I was just using the wrong keybind
<bitspook>
btw forcing evaluation instead of compilation by simply wrapping defconstant form in `(eval ...)' also works.
amb007 has joined #commonlisp
Pixel_Outlaw has joined #commonlisp
even4void has quit [Ping timeout: 276 seconds]
random-nick has joined #commonlisp
attila_lendvai_ has quit [Quit: Leaving]
Pixel_Outlaw has quit [Read error: Connection reset by peer]
rkazak has joined #commonlisp
mgl has joined #commonlisp
troojg has quit [Ping timeout: 260 seconds]
random-nick has quit [Ping timeout: 245 seconds]
apac has joined #commonlisp
mgl has quit [Ping timeout: 272 seconds]
cage has joined #commonlisp
cage has quit [Excess Flood]
cage has joined #commonlisp
rkazak has quit [Ping timeout: 260 seconds]
dtman34 has quit [Ping timeout: 252 seconds]
dtman34 has joined #commonlisp
edgar-rft_ has joined #commonlisp
<flip214>
Loading my system via ASDF gives me a runtime error "The value 47172871258001024 is not of type VECTOR
<flip214>
When loading a specific file via swank manually (does a CL:LOAD, I guess), it works fine.
<flip214>
ASDF is defined with :SERIAL T, and later files don't define macros or redefine functions.
<flip214>
Can anybody offer ideas how to debug that?
edgar-rft` has quit [Ping timeout: 260 seconds]
<flip214>
hmmm, assembly output of the offending function is identical for both cases (apart from start address)
rkazak has joined #commonlisp
rkazak has quit [Ping timeout: 246 seconds]
mishoo has joined #commonlisp
apac has quit [Ping timeout: 276 seconds]
pve has joined #commonlisp
<flip214>
"(eval-when (:compile-toplevel :load-toplevel :execute) ...)" isn't run on LOAD
wacki has joined #commonlisp
shka has joined #commonlisp
rkazak has joined #commonlisp
rkazak has quit [Ping timeout: 245 seconds]
alternateved has joined #commonlisp
rkazak has joined #commonlisp
<jackdaniel>
what an oddly long backlog
<beach>
flip214: What if you comment out the components in the system definition beyond the one that contains your function, and then load the system via ASDF?
<jackdaniel>
flip214: stalled fasls
<beach>
"stalled"?
<jackdaniel>
to be sure rm -rf ~/.slime/fasl ~/.cache/common-lisp
<jackdaniel>
a fasl file compiled with a different version of the compiler (i.e sbcl-1.4.0 vs sbcl-1.5.0)
<jackdaniel>
the source file does not change, but the fasl is not compatible (i.e some kind of offset changes). that's a guess of course
<jackdaniel>
but I've seen similar errors caused by exactly such happening
<jackdaniel>
in theory asdf should recognize it and recompile file, but it does not always happen, and there's also slime offender who caches its own fasls without any particlar protections against versioning
<jackdaniel>
does it answer your question?
<jackdaniel>
(and asdf won't recognize that the compiler changed when you have multiple different builds of the compiler with the same version)
<jackdaniel>
but i.e varying configuration flags -- threads vs no threads etc
<beach>
I think we usually use the term "stale" for that.
<jackdaniel>
I'm sure you could have figured it out, but yes, that's what I've meant
rkazak has quit [Ping timeout: 246 seconds]
rainthree3 has quit [Ping timeout: 252 seconds]
rainthree3 has joined #commonlisp
rkazak has joined #commonlisp
rkazak has quit [Ping timeout: 245 seconds]
random-nick has joined #commonlisp
rainthree3 has quit [Remote host closed the connection]
rainthree3 has joined #commonlisp
Alfr has quit [Quit: Leaving]
rainthree3 has quit [Remote host closed the connection]
rkazak has joined #commonlisp
Alfr has joined #commonlisp
rkazak has quit [Ping timeout: 265 seconds]
<flip214>
jackdaniel: it's reproducible -- so ASDF, broken, LOAD, working.
<flip214>
beach: thanks, might help
King_julian has joined #commonlisp
<jackdaniel>
and did you try to compile-file, and then in fresh image load the result?
<flip214>
hmmm, it's enough to recompile just the one offending function via swank... no LOAD of the whole file required
<flip214>
as soon as ASDF recompiles that file it gets broken
<flip214>
but dropping one file that is macro-heavy (and I'd have suspected as offender) from asdf isn't enough
kstuart has joined #commonlisp
rkazak has joined #commonlisp
varjag has joined #commonlisp
<flip214>
ah, when using sb-disassem:disassemble-fun there are differences
varjag has quit [Ping timeout: 252 seconds]
King_julian has quit [Ping timeout: 244 seconds]
soweli_iki has quit [Ping timeout: 276 seconds]
rkazak has quit [Ping timeout: 252 seconds]
shawnw has quit [Ping timeout: 246 seconds]
yaneko has quit [Quit: parting]
supercode has joined #commonlisp
rkazak has joined #commonlisp
yaneko has joined #commonlisp
rkazak has quit [Ping timeout: 276 seconds]
jon_atack has joined #commonlisp
jonatack has quit [Ping timeout: 265 seconds]
rkazak has joined #commonlisp
rkazak has quit [Ping timeout: 248 seconds]
yaneko has quit [Quit: parting]
rkazak has joined #commonlisp
rkazak has quit [Ping timeout: 260 seconds]
random-nick has quit [Read error: Connection reset by peer]
apac has joined #commonlisp
varjag has joined #commonlisp
rkazak has joined #commonlisp
varjag has quit [Ping timeout: 248 seconds]
kstuart has quit [Remote host closed the connection]
FragmentedCurve has quit [Remote host closed the connection]
rkazak has quit [Ping timeout: 248 seconds]
yaneko has quit [Quit: parting]
yaneko has joined #commonlisp
yaneko has quit [Quit: parting]
yaneko has joined #commonlisp
akoana has joined #commonlisp
wacki has quit [Ping timeout: 252 seconds]
yaneko has quit [Quit: parting]
yaneko has joined #commonlisp
yaneko has quit [Client Quit]
wacki has joined #commonlisp
yaneko has joined #commonlisp
yaneko has quit [Client Quit]
rkazak has joined #commonlisp
yaneko has joined #commonlisp
notzmv has joined #commonlisp
Lord_of_Life_ has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 260 seconds]
Lord_of_Life_ is now known as Lord_of_Life
rkazak has quit [Ping timeout: 252 seconds]
yaneko has quit [Read error: Connection reset by peer]
yaneko has joined #commonlisp
yaneko has quit [Client Quit]
McParen has joined #commonlisp
yaneko has joined #commonlisp
rkazak has joined #commonlisp
X-Scale has joined #commonlisp
<Posterdati>
hi
<Posterdati>
please help is there pjb around? Thanks!
rkazak has quit [Ping timeout: 276 seconds]
<bike>
Posterdati: nope. if you need to contact him he's "informatimago" on github.
bitspook` has joined #commonlisp
bitspook has quit [Read error: Connection reset by peer]
shawnw has joined #commonlisp
rkazak has joined #commonlisp
rkazak has quit [Ping timeout: 252 seconds]
McParen has left #commonlisp [#commonlisp]
rkazak has joined #commonlisp
varjag has quit [Ping timeout: 265 seconds]
<Posterdati>
bike: ok, thanks!
randm has quit [Remote host closed the connection]
randm has joined #commonlisp
<mountainman1312>
Anyone know a quick easy way to get the 2 lowest of 3 numbers? I can think up a big defun about it but I'm expecting there's already a function for that sort of thing?
<mountainman1312>
Or rather, the X lowest of Y numbers
<phoe>
I'd probably cl:remove the a:extremum
<bike>
sort the sequence and take the first couple elements
<bike>
there's no built in partial sort, though
<phoe>
or cdr the sor— yes what bike said
<mountainman1312>
oh yeah, forgot about sorting :)
<akoana>
would this be also acceptable? (let ((x '(2 1 3))) (remove (apply #'max x) x))
<edgar-rft_>
what would be the result when several numbers are equal?
<akoana>
hmm, good question ... maybe (remove (apply #'max x) x :count 1)) to ensure the result contains a list with 2 elements (for x being a 3 element list)
<edgar-rft_>
another questions is how would Lisp be able to identify the lowest 2 of a vertical row of numbers? :-)
chiselfuse has quit [Remote host closed the connection]
chiselfuse has joined #commonlisp
rkazak has joined #commonlisp
<akoana>
depends on which approach you choose: top-down or bottom-up :)
rkazak has quit [Ping timeout: 248 seconds]
supercode has quit [Quit: Client closed]
rkazak has joined #commonlisp
cage has quit [Quit: rcirc on GNU Emacs 29.4]
triffid has quit [Remote host closed the connection]
triffid has joined #commonlisp
pve has quit [Quit: leaving]
rkazak has quit [Ping timeout: 244 seconds]
kevingal has joined #commonlisp
amb007 has quit [Ping timeout: 264 seconds]
wobbol has quit [Ping timeout: 276 seconds]
mishoo has quit [Ping timeout: 252 seconds]
rkazak has joined #commonlisp
bitspook` has quit [Ping timeout: 252 seconds]
mountainman1312 has quit [Remote host closed the connection]
wobbol has joined #commonlisp
wobbol has quit [Max SendQ exceeded]
rkazak has quit [Ping timeout: 246 seconds]
wacki has quit [Quit: Leaving.]
Everything has quit [Quit: leaving]
amb007 has joined #commonlisp
wobbol has joined #commonlisp
akoana has quit [Quit: leaving]
alternateved has quit [Remote host closed the connection]
Pixel_Outlaw has joined #commonlisp
rkazak has joined #commonlisp
puke has quit [Ping timeout: 252 seconds]
puke has joined #commonlisp
dtman34 has quit [Ping timeout: 246 seconds]
mala has joined #commonlisp
rkazak has quit [Ping timeout: 246 seconds]
amb007 has quit [Ping timeout: 252 seconds]
ello has quit [Read error: Connection reset by peer]
ello has joined #commonlisp
dtman34 has joined #commonlisp
symdrome has quit [Remote host closed the connection]