<Pixel_Outlaw>
I'd not think mutating numbers causes it.
<beach>
You can't mutate numbers.
<Pixel_Outlaw>
I misspoke.
<Pixel_Outlaw>
Rebinding values then.
<beach>
It looks like your numbers are bignums. Those won't fit in a register, so space is allocated on the heap for them.
<Pixel_Outlaw>
Ah, that would make sense.
<Pixel_Outlaw>
Thank you.
<beach>
Pleasure.
<aeth>
if you want to avoid consing unexpectedly, you'd have to make your own bignums (the hard part is exp/expt/log/sqrt/trig, but you don't need that there)... but mutating a custom bignum allocated up front and then turning it into a normal bignum at the end may not be a win for something that small (and it grows quickly, so either you'd have to calculate the size up front (which you can do there) or you'd
<aeth>
need an adjustable vector, anyway)
placidusax has joined #commonlisp
<aeth>
in the end it's a lot of work just for consing-expectedly instead of consing-unexpectedly
jweek has joined #commonlisp
donleo has joined #commonlisp
<Pixel_Outlaw>
I just found about the "room" report in SBCL. It's a nice feature.
Th30n has joined #commonlisp
shka has joined #commonlisp
Inline has joined #commonlisp
wacki has joined #commonlisp
Pixel_Outlaw has quit [Quit: Leaving]
jonatack has joined #commonlisp
King_julian has joined #commonlisp
duuqnd_ has joined #commonlisp
duuqnd has quit [Ping timeout: 260 seconds]
duuqnd_ is now known as duuqnd
Cymew has joined #commonlisp
danse-nr3 has joined #commonlisp
duuqnd has quit [Ping timeout: 255 seconds]
duuqnd has joined #commonlisp
Inline has quit [Ping timeout: 260 seconds]
JuanDaugherty has joined #commonlisp
jonatack has quit [Ping timeout: 260 seconds]
dino_tutter has joined #commonlisp
amb007 has quit [Ping timeout: 252 seconds]
jonatack has joined #commonlisp
flip214 has quit [Ping timeout: 260 seconds]
flip214 has joined #commonlisp
X-Scale has quit [Ping timeout: 256 seconds]
flip214 has quit [Ping timeout: 252 seconds]
flip214 has joined #commonlisp
pve has joined #commonlisp
danse-nr3 has quit [Quit: on the move]
danse-nr3 has joined #commonlisp
X-Scale has joined #commonlisp
JuanDaugherty has quit [Quit: JuanDaugherty]
Cymew has quit [Quit: Konversation terminated!]
Cymew has joined #commonlisp
X-Scale66 has joined #commonlisp
X-Scale has quit [Ping timeout: 256 seconds]
alcor has joined #commonlisp
X-Scale66 has quit [Ping timeout: 256 seconds]
Cymew has quit [Quit: Konversation terminated!]
kamafam has joined #commonlisp
King_julian has quit [Ping timeout: 244 seconds]
attila_lendvai has joined #commonlisp
Reinfeld has quit [Ping timeout: 248 seconds]
dnhester26 has joined #commonlisp
<dnhester26>
My use case is basically that I want to check a bunch of inputs in a function for their types, if any type is not correct, I want to stop executing the function, and return some error message "Invalid Data", however if the inputs are all the right types (and pass other validations) then I want the function to execute normally and return whatever it returns. I've not used the condition system much, but it seems to me that this would
<dnhester26>
be a right fit. Is that correct? If it is, the next question is maybe more about style: is the normal way of doing it by passign a (progn ) form to the handler-case? I ask because it seems to me from the spec that handler-case is only accepting one case at a time. Or perhaps I should just define the function in an flet and then call it with the inputs in the handler-case?
<dnhester26>
Question about conditions <
<beach>
You absolutely do not want to indicate an error by a special return value.
<dnhester26>
Sorry, my message copy/paste got messed up. I have a question about conditions. Is that (above) the right idea about how to approach my use case?
<dnhester26>
beach: it's a webapp, so if the input data is invalid I want to return an error message to the frontend
<dnhester26>
otherwise I want the actual function to execute
<beach>
You signal an error and the report function is used to show the message.
pillton` has joined #commonlisp
<beach>
OK, so maybe web applications are special, but then I am not able to help. Sorry.
<beach>
The condition system exists precisely to avoid indicating exceptional situations by special return values. That way of handling errors usually results in very messy code.
<dnhester26>
beach: the report function that is included in the `define-condition`, so instead of using a handler-case, the condition itself takes care of showing the message?
<beach>
If you print the condition, the message is displayed.
<ixelp>
The value 234 is not of the expected type CONS. => #<TYPE-ERROR #x144171E6>
<beach>
dnhester26: Like that ^.
<dnhester26>
Thanks, but printed just means to some stream that goes to the REPL or some log, what I really need is to set some headers, response codes, and send a message back. So if I understood correctly, I do want to use handler-case and not the report function
<beach>
I once consulted for a company that had written an application in C, and they used special return values to indicate error situations. The author of the code had been very careful to "handle" every error situation. But the code was incomprehensible because more than half of it was about error handling, so it was unclear what the code was doing.
<danse-nr3>
wrong encapsulation i guess
<beach>
You can use HANDLER-CASE or HANDLER-BIND to handle the condition, and then you print it in the handler to get the message as I showed.
<beach>
The problem with return values indicating errors is that every intermediate function must know about the error. The condition system is designed to avoid that.
mgl has joined #commonlisp
<beach>
If A can handle an error, and A calls B that calls C that calls D and only D can detect the error, then B and C must know about the error code and pass it on.
<beach>
Anyway, I am off for a lunch break. I hope others can give further help if required.
<dnhester26>
beach: thanks for the explanation. I think this is exactly what I need then. In my code I don't want to worry about return values, but to the front end that's what I have to do. So this takes care of the issues I had.
King_julian has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
hexa6 has quit [Ping timeout: 248 seconds]
pillton` has quit [Remote host closed the connection]
hexa6 has joined #commonlisp
dnhester26 has joined #commonlisp
dans59786 has joined #commonlisp
dans59786 has quit [Client Quit]
danse-nr3 has quit [Ping timeout: 252 seconds]
awlygj has joined #commonlisp
random-nick has joined #commonlisp
X-Scale has joined #commonlisp
pranav has quit [Remote host closed the connection]
pranav has joined #commonlisp
Noisytoot has quit [Ping timeout: 260 seconds]
King_julian has quit [Ping timeout: 248 seconds]
yitzi has joined #commonlisp
Noisytoot has joined #commonlisp
dcb has joined #commonlisp
danse-nr3 has joined #commonlisp
Cymew has joined #commonlisp
vats has quit [Ping timeout: 252 seconds]
jonatack has quit [Ping timeout: 252 seconds]
Cymew has quit [Quit: Konversation terminated!]
X-Scale has quit [Ping timeout: 256 seconds]
danse-nr3 has quit []
King_julian has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
Cymew has joined #commonlisp
X-Scale has joined #commonlisp
vats has joined #commonlisp
decweb has joined #commonlisp
<beach>
Sure. Good luck!
Cymew has quit [Quit: Konversation terminated!]
kamafam has quit [Ping timeout: 265 seconds]
amb007 has joined #commonlisp
X-Scale has quit [Quit: Client closed]
Ruby has quit [Ping timeout: 264 seconds]
Ruby has joined #commonlisp
kamafam has joined #commonlisp
jonatack has joined #commonlisp
craigbro has quit [Ping timeout: 252 seconds]
Th30n has quit [Quit: going off]
kamafam1 has joined #commonlisp
kamafam has quit [Ping timeout: 252 seconds]
kamafam1 is now known as kamafam
zxcvz has joined #commonlisp
zxcvz has quit [Client Quit]
dlowe has joined #commonlisp
JuanDaugherty has joined #commonlisp
waleee has joined #commonlisp
lucasta has joined #commonlisp
raynei has quit [Ping timeout: 252 seconds]
casionaut has joined #commonlisp
X-Scale has joined #commonlisp
wacki has quit [Read error: Connection reset by peer]
danse-nr3 has joined #commonlisp
shawnw has quit [Ping timeout: 276 seconds]
wacki has joined #commonlisp
X-Scale has quit [Ping timeout: 256 seconds]
X-Scale has joined #commonlisp
hexa6` has joined #commonlisp
hexa6 has quit [Ping timeout: 245 seconds]
amb007 has quit [Ping timeout: 265 seconds]
amb007 has joined #commonlisp
vats has quit [Ping timeout: 252 seconds]
King_julian has quit [Ping timeout: 245 seconds]
X-Scale has quit [Ping timeout: 256 seconds]
amb007 has quit [Read error: Connection reset by peer]
danse-nr3 has quit [Quit: on the move]
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
attila_lendvai has quit [Remote host closed the connection]
attila_lendvai has joined #commonlisp
edgar-rft_ has joined #commonlisp
edgar-rft has quit [Ping timeout: 248 seconds]
danse-nr3 has joined #commonlisp
edgar-rft_ is now known as edgar-rft
hexa6` is now known as hexa6
Cymew has joined #commonlisp
Inline has joined #commonlisp
alcor has quit [Remote host closed the connection]
alcor has joined #commonlisp
dnhester26 has joined #commonlisp
placidusax has quit [Ping timeout: 252 seconds]
placidusax has joined #commonlisp
waleee has quit [Ping timeout: 260 seconds]
dnhester26 has quit [Ping timeout: 276 seconds]
placidusax has quit [Ping timeout: 248 seconds]
placidusax has joined #commonlisp
Cymew has quit [Quit: Konversation terminated!]
olnw has joined #commonlisp
placidusax has quit [Ping timeout: 260 seconds]
casionaut has quit [Quit: o/]
dnhester26 has joined #commonlisp
placidusax has joined #commonlisp
olnw has quit [Ping timeout: 246 seconds]
placidusax has quit [Ping timeout: 245 seconds]
placidusax has joined #commonlisp
placidusax has quit [Ping timeout: 264 seconds]
olnw has joined #commonlisp
placidusax has joined #commonlisp
olnw has quit [Client Quit]
olnw has joined #commonlisp
olnw has quit [Client Quit]
lucasta has quit [Quit: Leaving]
placidusax has quit [Ping timeout: 272 seconds]
semarie has quit [Quit: WeeChat 4.3.4]
olnw has joined #commonlisp
synchrom1 has joined #commonlisp
synchromesh has quit [Ping timeout: 244 seconds]
semarie has joined #commonlisp
dnhester26 has quit []
thuna` has quit [Ping timeout: 248 seconds]
cage has joined #commonlisp
thuna` has joined #commonlisp
hexa6 has quit [Remote host closed the connection]
danse-nr3 has quit [Quit: on the move]
kamafam has quit [Remote host closed the connection]
placidusax has joined #commonlisp
inline__ has joined #commonlisp
kamafam has joined #commonlisp
inline__ has quit [Remote host closed the connection]
Inline has quit [Ping timeout: 252 seconds]
danse-nr3 has joined #commonlisp
JuanDaugherty has quit [Quit: JuanDaugherty]
placidusax has quit [Ping timeout: 265 seconds]
placidusax has joined #commonlisp
placidusax has quit [Ping timeout: 260 seconds]
kamafam has quit [Remote host closed the connection]
placidusax has joined #commonlisp
kamafam has joined #commonlisp
danse-nr3 has quit [Quit: crappy window$]
placidusax has quit [Ping timeout: 248 seconds]
placidusax has joined #commonlisp
kamafam has quit [Remote host closed the connection]
kamafam has joined #commonlisp
danse-nr3 has joined #commonlisp
placidusax has quit [Ping timeout: 252 seconds]
placidusax has joined #commonlisp
kamafam has quit [Remote host closed the connection]
Pixel_Outlaw has joined #commonlisp
placidusax has quit [Ping timeout: 244 seconds]
placidusax has joined #commonlisp
Inline has joined #commonlisp
kamafam has joined #commonlisp
placidusax has quit [Ping timeout: 244 seconds]
placidusax has joined #commonlisp
placidusax has quit [Ping timeout: 252 seconds]
mgl has quit [Ping timeout: 252 seconds]
kamafam has quit [Remote host closed the connection]
kamafam has joined #commonlisp
kamafam has quit [Read error: Connection reset by peer]
kamafam1 has joined #commonlisp
varjag has joined #commonlisp
kamafam1 is now known as kamafam
amb007 has joined #commonlisp
waleee has joined #commonlisp
ym has joined #commonlisp
placidusax has joined #commonlisp
kamafam has quit [Remote host closed the connection]
placidusax has quit [Ping timeout: 276 seconds]
kamafam has joined #commonlisp
placidusax has joined #commonlisp
awlygj has quit [Quit: Lost terminal]
placidusax has quit [Remote host closed the connection]
placidusax has joined #commonlisp
kamafam has quit [Remote host closed the connection]
kamafam has joined #commonlisp
placidusax has quit [Ping timeout: 255 seconds]
placidusax has joined #commonlisp
JuanDaugherty has joined #commonlisp
placidusax has quit [Ping timeout: 248 seconds]
placidusax has joined #commonlisp
igemnace has quit [Remote host closed the connection]
igemnace has joined #commonlisp
placidusax has quit [Remote host closed the connection]
placidusax has joined #commonlisp
placidusax has quit [Ping timeout: 255 seconds]
placidusax has joined #commonlisp
placidusax has quit [Ping timeout: 252 seconds]
kamafam1 has joined #commonlisp
kamafam has quit [Ping timeout: 255 seconds]
kamafam1 is now known as kamafam
King_julian has joined #commonlisp
dans68384 has joined #commonlisp
danse-nr3 has quit [Ping timeout: 276 seconds]
cage has quit [Quit: rcirc on GNU Emacs 29.4]
X-Scale has joined #commonlisp
King_julian has quit [Ping timeout: 252 seconds]
xlymian has joined #commonlisp
dans68384 has quit [Remote host closed the connection]
danse-nr3 has joined #commonlisp
placidusax has joined #commonlisp
placidusax has quit [Ping timeout: 252 seconds]
placidusax has joined #commonlisp
placidusax has quit [Ping timeout: 252 seconds]
dawids has joined #commonlisp
placidusax has joined #commonlisp
JuanDaugherty has quit [Quit: JuanDaugherty]
placidusax has quit [Ping timeout: 252 seconds]
ym has quit [Ping timeout: 264 seconds]
placidusax has joined #commonlisp
dawids has quit [Ping timeout: 265 seconds]
danse-nr3 has quit [Quit: good night]
placidusax has quit [Ping timeout: 252 seconds]
placidusax has joined #commonlisp
placidusax has quit [Ping timeout: 248 seconds]
placidusax has joined #commonlisp
placidusax has quit [Ping timeout: 265 seconds]
placidusax has joined #commonlisp
placidusax has quit [Ping timeout: 265 seconds]
msv has quit [Remote host closed the connection]
msv has joined #commonlisp
kamafam has quit [Read error: Connection reset by peer]
pve has quit [Quit: leaving]
yitzi has quit [Remote host closed the connection]
X-Scale has quit [Ping timeout: 256 seconds]
alcor has quit [Ping timeout: 252 seconds]
xlymian has quit [Ping timeout: 260 seconds]
placidusax has joined #commonlisp
zxcvz has joined #commonlisp
zxcvz has quit [Client Quit]
placidusax has quit [Ping timeout: 255 seconds]
placidusax has joined #commonlisp
varjag has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.2)]
amb007 has quit [Ping timeout: 264 seconds]
shka has quit [Ping timeout: 255 seconds]
akoana has joined #commonlisp
placidusax has quit [Remote host closed the connection]
donleo has quit [Ping timeout: 244 seconds]
placidusax has joined #commonlisp
placidusax has quit [Ping timeout: 260 seconds]
char has joined #commonlisp
placidusax has joined #commonlisp
placidusax has quit [Ping timeout: 248 seconds]
placidusax has joined #commonlisp
placidusax has quit [Remote host closed the connection]
placidusax has joined #commonlisp
placidusax has quit [Ping timeout: 252 seconds]
dino_tutter has quit [Ping timeout: 265 seconds]
Inline has quit [Ping timeout: 260 seconds]
placidusax has joined #commonlisp
placidusax has quit [Ping timeout: 264 seconds]
X-Scale has joined #commonlisp
ello has joined #commonlisp
ello has quit [Client Quit]
ello has joined #commonlisp
montxero has quit [Ping timeout: 252 seconds]
attila_lendvai has quit [Ping timeout: 252 seconds]
JuanDaugherty has joined #commonlisp
X-Scale has quit [Ping timeout: 256 seconds]
placidusax has joined #commonlisp
xlymian has joined #commonlisp
micro has quit [Ping timeout: 260 seconds]
micro has joined #commonlisp
xlymian has quit [Remote host closed the connection]
placidusax has quit [Remote host closed the connection]
placidusax has joined #commonlisp
placidusax has quit [Remote host closed the connection]